]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fixing issue of applying tdm dtmf removal
authorKapil Gupta <kgupta@sangoma.com>
Mon, 10 Sep 2012 15:09:28 +0000 (11:09 -0400)
committerKapil Gupta <kgupta@sangoma.com>
Mon, 10 Sep 2012 15:09:28 +0000 (11:09 -0400)
src/mod/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
src/mod/endpoints/mod_media_gateway/media_gateway_stack.h
src/mod/endpoints/mod_media_gateway/media_gateway_utils.c

index 9d0f19295a9ee8a6d5de2c7959fe6f81d6cd5196..754bebece98200530df45d748557307caf7a5ba9 100644 (file)
@@ -741,19 +741,8 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
         goto error;
     }
 
-       if(is_rtp){
-               mg_termination_t* tdm_term = NULL;
-               /* disable dtmf removal */
-               if(NULL != (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);
-                       }
-               }
-       }
+       mg_apply_tdm_dtmf_removal(term, mg_ctxt);
 
-    
     mg_print_t38_attributes(term);
 
     /********************************************************************/
@@ -1069,6 +1058,7 @@ switch_status_t handle_mg_modify_cmd(megaco_profile_t* mg_profile, MgMgcoCommand
                                        term->u.rtp.term_id);
                }
 
+               mg_apply_tdm_dtmf_removal(term, mg_ctxt);
                mg_print_t38_attributes(term);
 
 
index 4b1c80c220be586464508e24a80156fb49151ee7..6dfe9d2434c420e1acd0c5e8f4c72c8725c67542 100644 (file)
@@ -248,6 +248,7 @@ switch_status_t mg_activate_ito_timer(megaco_profile_t* profile);
 void mg_restart_inactivity_timer(megaco_profile_t* profile);
 
 switch_status_t mgco_process_mgc_failure(SuId suId);
+void mg_apply_tdm_dtmf_removal(mg_termination_t* term, mg_context_t *mg_ctxt);
 
 
 /****************************************************************************************************************/
index 8594e41d978588cd709f147d905e11c24f07b6a9..b3de32b0fefabc0dd2e677bb124e4fe89df5870e 100644 (file)
@@ -2354,3 +2354,22 @@ void mg_print_t38_attributes(mg_termination_t* term)
        }
 
 }
+
+/*****************************************************************************************************************************/
+void mg_apply_tdm_dtmf_removal(mg_termination_t* term, mg_context_t *mg_ctxt)
+{
+       mg_termination_t* tdm_term = NULL;
+
+       if(NULL == term) return ;
+
+       if((MG_TERM_RTP == term->type)){
+               if(NULL != (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);
+                       }
+               }
+       }
+}
+/*****************************************************************************************************************************/