From 3392db98bff6f17fb69e941d71c53f42ea45c7dd Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 12 Sep 2013 20:39:57 +0500 Subject: [PATCH] FS-5781 --resolve try now --- src/switch_core_media.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index a2ddecd026..a4ccab3805 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -5095,7 +5095,9 @@ static void generate_m(switch_core_session_t *session, char *buf, size_t buflen, if (!cng_type) { //switch_snprintf(buf + strlen(buf), buflen - strlen(buf), "a=rtpmap:%d CN/8000\n", cng_type); //} else { - switch_snprintf(buf + strlen(buf), buflen - strlen(buf), "a=silenceSupp:off - - - -\n"); + if (switch_media_handle_test_media_flag(smh, SCMF_SUPPRESS_CNG)) { + switch_snprintf(buf + strlen(buf), buflen - strlen(buf), "a=silenceSupp:off - - - -\n"); + } } if (append_audio) { @@ -5478,13 +5480,15 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=rtpmap:%d telephone-event/8000\na=fmtp:%d 0-16\n", smh->mparams->te, smh->mparams->te); } } - if (!switch_media_handle_test_media_flag(smh, SCMF_SUPPRESS_CNG) && smh->mparams->cng_pt && use_cng) { + + if (switch_media_handle_test_media_flag(smh, SCMF_SUPPRESS_CNG)) { + switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=silenceSupp:off - - - -\n"); + } else if (smh->mparams->cng_pt && use_cng) { switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=rtpmap:%d CN/8000\n", smh->mparams->cng_pt); + if (!a_engine->codec_params.rm_encoding) { smh->mparams->cng_pt = 0; } - } else { - switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=silenceSupp:off - - - -\n"); } if (append_audio) { -- 2.47.2