]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8975 #resolve [DTMF variables not functioning]
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 23 Mar 2016 14:55:43 +0000 (09:55 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 23 Mar 2016 14:55:43 +0000 (09:55 -0500)
src/include/switch_core_media.h
src/switch_core_media.c

index ad5028b0b1201e49687e5a7dfc7e00719ad9e6ee..82a0373e39b160c9348844e90b7a4301ab27d193 100644 (file)
@@ -42,6 +42,7 @@ SWITCH_BEGIN_EXTERN_C
 #define SWITCH_NO_CRYPTO_TAG -1
 
 typedef enum {
+       DTMF_AUTO,
        DTMF_2833,
        DTMF_INFO,
        DTMF_NONE
index f4a1a9b4913e4d0f741dada5a63dc9b42395a9aa..903846359548882efc5a4fc7237b8809290e518d 100644 (file)
@@ -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) {