From ddd7fa3c03a8f66a6cef2c41945e04ec9c6c0c8b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 23 Mar 2016 09:55:43 -0500 Subject: [PATCH] FS-8975 #resolve [DTMF variables not functioning] --- src/include/switch_core_media.h | 1 + src/switch_core_media.c | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/include/switch_core_media.h b/src/include/switch_core_media.h index ad5028b0b1..82a0373e39 100644 --- a/src/include/switch_core_media.h +++ b/src/include/switch_core_media.h @@ -42,6 +42,7 @@ SWITCH_BEGIN_EXTERN_C #define SWITCH_NO_CRYPTO_TAG -1 typedef enum { + DTMF_AUTO, DTMF_2833, DTMF_INFO, DTMF_NONE diff --git a/src/switch_core_media.c b/src/switch_core_media.c index f4a1a9b491..9038463595 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -4504,14 +4504,16 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s if (best_te) { smh->mparams->te_rate = best_te_rate; - if (sdp_type == SDP_TYPE_REQUEST) { - smh->mparams->te = smh->mparams->recv_te = (switch_payload_t) best_te; - switch_channel_set_variable(session->channel, "dtmf_type", "rfc2833"); - smh->mparams->dtmf_type = DTMF_2833; - } else { - smh->mparams->te = (switch_payload_t) best_te; - switch_channel_set_variable(session->channel, "dtmf_type", "rfc2833"); - smh->mparams->dtmf_type = DTMF_2833; + if (smh->mparams->dtmf_type == DTMF_AUTO) { + if (sdp_type == SDP_TYPE_REQUEST) { + smh->mparams->te = smh->mparams->recv_te = (switch_payload_t) best_te; + switch_channel_set_variable(session->channel, "dtmf_type", "rfc2833"); + smh->mparams->dtmf_type = DTMF_2833; + } else { + smh->mparams->te = (switch_payload_t) best_te; + switch_channel_set_variable(session->channel, "dtmf_type", "rfc2833"); + smh->mparams->dtmf_type = DTMF_2833; + } } if (a_engine->rtp_session) {