From bec42ba769aa1fc13ce3998d21b74d3645cf5ffc Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Fri, 8 Oct 2021 17:40:54 +0300 Subject: [PATCH] [Core] Implement NDLB_line_flash_16 channel variable. Set to true to enable deprecated 0-16 back (rfc4733) --- src/switch_core_media.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index d08b24559e..087a151570 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -10053,14 +10053,16 @@ static void generate_m(switch_core_session_t *session, char *buf, size_t buflen, } } } else { + uint8_t NDLB_line_flash_16 = switch_channel_var_true(session->channel, "NDLB_line_flash_16"); + for (i = 0; i < smh->num_rates; i++) { if (switch_channel_test_flag(session->channel, CF_AVPF)) { switch_snprintf(buf + strlen(buf), buflen - strlen(buf), "a=rtpmap:%d telephone-event/%d\r\n", smh->dtmf_ianacodes[i], smh->rates[i]); } else { - switch_snprintf(buf + strlen(buf), buflen - strlen(buf), "a=rtpmap:%d telephone-event/%d\r\na=fmtp:%d 0-15\r\n", - smh->dtmf_ianacodes[i], smh->rates[i], smh->dtmf_ianacodes[i]); + switch_snprintf(buf + strlen(buf), buflen - strlen(buf), "a=rtpmap:%d telephone-event/%d\r\na=fmtp:%d 0-%d\r\n", + smh->dtmf_ianacodes[i], smh->rates[i], smh->dtmf_ianacodes[i], (NDLB_line_flash_16 ? 16 : 15)); } } } @@ -10777,8 +10779,8 @@ 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/%d\r\n", smh->mparams->te, smh->mparams->te_rate); } else { - switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=rtpmap:%d telephone-event/%d\r\na=fmtp:%d 0-15\r\n", - smh->mparams->te, smh->mparams->te_rate, smh->mparams->te); + switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=rtpmap:%d telephone-event/%d\r\na=fmtp:%d 0-%d\r\n", + smh->mparams->te, smh->mparams->te_rate, smh->mparams->te, (switch_channel_var_true(session->channel, "NDLB_line_flash_16") ? 16 : 15)); } }