]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
DTMF removal code - by default making disable
authorKapil Gupta <kgupta@sangoma.com>
Fri, 7 Sep 2012 15:44:45 +0000 (11:44 -0400)
committerKapil Gupta <kgupta@sangoma.com>
Fri, 7 Sep 2012 15:44:45 +0000 (11:44 -0400)
src/mod/endpoints/mod_media_gateway/media_gateway.c
src/mod/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
src/mod/endpoints/mod_media_gateway/media_gateway_xml.c
src/mod/endpoints/mod_media_gateway/mod_media_gateway.h

index 4272e414af3750fe28f25d72351bad61f8e3d90a..1a1bba547504d4b49f005a548ecfb6d31e2e314b 100644 (file)
@@ -244,6 +244,10 @@ switch_status_t megaco_tdm_term_dtmf_removal(mg_termination_t *term, int enable)
 
        sprintf(buf,"%s",(1 == enable)?"enable":"disable");
 
+       if(enable){
+               switch_set_flag(term, MG_DTMF_REMOVAL_ENABLE);
+       }
+
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Sending DTMF Removal Event[%s] for MG Term[%s], TDM span[%s] channel[%d]\n",
                                         buf,tdm_term->name, tdm_term->u.tdm.span_name, tdm_term->u.tdm.channel);
 
@@ -441,6 +445,11 @@ void megaco_termination_destroy(mg_termination_t *term)
     switch_clear_flag(term, MGT_ALLOCATED);
     switch_clear_flag(term, MGT_ACTIVE);
     switch_clear_flag(term, MG_FAX_NOTIFIED);
+       
+       if(switch_test_flag(term, MG_DTMF_REMOVAL_ENABLE)){
+               switch_clear_flag(term, MG_DTMF_REMOVAL_ENABLE);
+               megaco_tdm_term_dtmf_removal(term,0x00);
+       }
     
     if (term->type == MG_TERM_RTP) {
         switch_core_hash_delete_wrlock(term->profile->terminations, term->name, term->profile->terminations_rwlock);
index cc393d8ff8fa59121c9dc20948ad015f1c8e6800..fe99a25b8d00b7ccf4eb8f400a34edf16d868a1d 100644 (file)
@@ -747,8 +747,6 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
                tdm_term = megaco_context_get_peer_term(mg_ctxt, term);
                if(term->u.rtp.rfc2833_pt){
                        megaco_tdm_term_dtmf_removal(tdm_term,0x01);
-               }else{
-                       megaco_tdm_term_dtmf_removal(tdm_term,0x00);
                }
        }
 
index 3bfe075c80e7cfe5c57a631c214ca551d34c78c7..3f3e2c01c517e2eb3310a02c04ce2e5fa06d59dd 100644 (file)
@@ -264,6 +264,10 @@ void mg_create_tdm_term(megaco_profile_t *profile, const char *tech, const char
                        term->name, term->u.tdm.span_name, term->u.tdm.channel);
        megaco_prepare_tdm_termination(term);
 
+       /* by-default : DTMF removal disable 
+        * by default do not modify in-band audio stream*/
+       megaco_tdm_term_dtmf_removal(term,0x00);
+
        profile->total_cfg_term++;
 }
 /****************************************************************************************************************************/
index 95d738d559f677607515cdf588b77422db5ef5d0..640b22d7e0deaa2e3d233d21b7489baec433d06b 100644 (file)
@@ -120,6 +120,7 @@ enum {
     MG_IN_SERVICE      = (1 << 2),
     MG_OUT_OF_SERVICE  = (1 << 3),
     MG_FAX_NOTIFIED    = (1 << 4),
+    MG_DTMF_REMOVAL_ENABLE     = (1 << 5),
     
 } mg_termination_flags;