code changes for the following issue

1)resetting term->u.rtp.rfc2833 , if ADD/MODIFY SDP does not have rfc2833
2) calling DTMF removal from modify request also depends on rfc2833 present in sdp or not
3) calling EC disable from ADD/MODIFY api handler if sdp contains T38
This commit is contained in:
Kapil Gupta 2012-09-10 13:33:54 -04:00
parent fc4365c8a5
commit 9537ed3737
3 changed files with 469 additions and 439 deletions

View File

@ -743,8 +743,10 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
mg_apply_tdm_dtmf_removal(term, mg_ctxt);
mg_apply_tdm_ec(term, mg_ctxt);
mg_print_t38_attributes(term);
/********************************************************************/
/* resp code -- begin */
@ -1059,9 +1061,12 @@ switch_status_t handle_mg_modify_cmd(megaco_profile_t* mg_profile, MgMgcoCommand
}
mg_apply_tdm_dtmf_removal(term, mg_ctxt);
mg_apply_tdm_ec(term, mg_ctxt);
mg_print_t38_attributes(term);
/* SDP updated to termination */
if(SWITCH_STATUS_SUCCESS != megaco_activate_termination(term)) {
mg_profile->mg_stats->total_num_of_term_activation_failed_error++;

View File

@ -249,6 +249,7 @@ 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);
void mg_apply_tdm_ec(mg_termination_t* term, mg_context_t *mg_ctxt);
/****************************************************************************************************************/

View File

@ -460,6 +460,7 @@ void mg_util_set_cmd_name_string (MgStr *errTxt, MgMgcoCommand *cmd)
void mgco_handle_sdp_attr_set(CmSdpAttrSet *s, mg_termination_t* term)
{
int i=0x00;
int rfc2833_pres = 0x00;
if (s->numComp.pres) {
for (i = 0; i < s->numComp.val; i++) {
CmSdpAttr *a = s->attr[i];
@ -583,6 +584,7 @@ void mgco_handle_sdp_attr_set(CmSdpAttrSet *s, mg_termination_t* term)
if((NOTPRSNT != r->enc.val.pres ) &&
(CM_SDP_ENC_TELEPHONE_EVENT == r->enc.val.val)){
rfc2833_pres = 0x01;
term->u.rtp.rfc2833_pt=r->pay.val.val;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
" Updating rfc2833_pt to [%d] \n", term->u.rtp.rfc2833_pt);
@ -909,9 +911,16 @@ void mgco_handle_sdp_attr_set(CmSdpAttrSet *s, mg_termination_t* term)
break;
}
}
}else{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "a-line not present \n");
}
if(0x00 == rfc2833_pres){
term->u.rtp.rfc2833_pt = 0x00;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
" Resetting rfc2833_pt to [%d] \n", term->u.rtp.rfc2833_pt);
}
}
void mgco_handle_sdp_c_line(CmSdpConn *s, mg_termination_t* term, mgco_sdp_types_e sdp_type)
@ -2373,3 +2382,18 @@ void mg_apply_tdm_dtmf_removal(mg_termination_t* term, mg_context_t *mg_ctxt)
}
}
/*****************************************************************************************************************************/
void mg_apply_tdm_ec(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.t38_options){
mg_term_set_ec(tdm_term,0x00);
}
}
}
}
/*****************************************************************************************************************************/