updating rfc2833 variable code

This commit is contained in:
Kapil Gupta 2012-08-08 14:43:55 -04:00
parent e5d140d1e6
commit d04606fb09
2 changed files with 38 additions and 18 deletions

View File

@ -85,7 +85,7 @@ static switch_status_t mg_on_dtmf(switch_core_session_t *session, const switch_d
{ {
switch_channel_t *channel = switch_core_session_get_channel(session); switch_channel_t *channel = switch_core_session_get_channel(session);
mg_termination_t *term = switch_channel_get_private(channel, "_mg_term_"); mg_termination_t *term = switch_channel_get_private(channel, "_mg_term_");
char digit[2] = { dtmf->digit }; //char digit[2] = { dtmf->digit };
if (!term) { if (!term) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot find termination structure for session [%s]\n", switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot find termination structure for session [%s]\n",
switch_core_session_get_uuid(session)); switch_core_session_get_uuid(session));
@ -94,7 +94,7 @@ static switch_status_t mg_on_dtmf(switch_core_session_t *session, const switch_d
//switch_status_t mg_send_dtmf_notify(megaco_profile_t* mg_profile, const char* term_name, char* digits, int num_of_collected_digits); //switch_status_t mg_send_dtmf_notify(megaco_profile_t* mg_profile, const char* term_name, char* digits, int num_of_collected_digits);
//mg_send_dtmf_notify(term->profile, term->name, digit, 1); //mg_send_dtmf_notify(term->profile, term->name, digit, 1);
switch_log_printf("NOT Sending notify to MGC for dtmf: %c\n", dtmf->digit); //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "MEGACO DTMF Signaling NOT Sending notify to MGC for dtmf:%c\n",dtmf->digit);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }

View File

@ -528,7 +528,7 @@ void mgco_handle_sdp_attr_set(CmSdpAttrSet *s, mg_termination_t* term)
CmSdpAttrFmtp* f = &a->u.fmtp; CmSdpAttrFmtp* f = &a->u.fmtp;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "\t CM_SDP_ATTR_FMTP: \n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "\t CM_SDP_ATTR_FMTP: \n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "\t Format Type = %d \n",(NOTPRSNT == f->type.pres)?f->type.val:-1); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "\t Format Type = %d \n",(NOTPRSNT != f->type.pres)?f->type.val:-1);
break; break;
} }
@ -540,30 +540,47 @@ void mgco_handle_sdp_attr_set(CmSdpAttrSet *s, mg_termination_t* term)
if(NOTPRSNT != r->pres.pres){ if(NOTPRSNT != r->pres.pres){
/* payload type */ /* payload type */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "\t Payload Type = %d \n", switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
(NOTPRSNT != r->pay.type.pres)?r->pay.type.val:-1); "\t Payload Type = %d \n",
(NOTPRSNT != r->pay.type.pres)?r->pay.type.val:-1);
/* payload value */ /* payload value */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "\t Payload Value = %d \n", switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
(NOTPRSNT != r->pay.val.pres)?r->pay.val.val:-1); "\t Payload Value = %d \n",
(NOTPRSNT != r->pay.val.pres)?r->pay.val.val:-1);
/* encoding name */ /* encoding name */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "\t Encoding Name value = %d \n", switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
(NOTPRSNT != r->enc.val.pres)?r->enc.val.val:-1); "\t Encoding Name value = %d \n",
(NOTPRSNT != r->enc.val.pres)?r->enc.val.val:-1);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "\t Encoding Name name = %s \n", if((NOTPRSNT != r->enc.val.pres ) &&
(NOTPRSNT != r->enc.name.pres)?(char*)r->enc.name.val:"Not Present"); (CM_SDP_ENC_TELEPHONE_EVENT == r->enc.val.val)){
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);
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
"\t Encoding Name name = %s \n",
(NOTPRSNT != r->enc.name.pres)?
(char*)r->enc.name.val:"Not Present");
#ifdef BIT_64 #ifdef BIT_64
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "\t Clock Rate = %d \n", switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
(NOTPRSNT != r->clk.pres)?r->clk.val:-1); "\t Clock Rate = %d \n",
(NOTPRSNT != r->clk.pres)?r->clk.val:-1);
#else #else
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "\t Clock Rate = %ld \n", switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
(NOTPRSNT != r->clk.pres)?r->clk.val:-1); "\t Clock Rate = %ld \n",
(NOTPRSNT != r->clk.pres)?r->clk.val:-1);
#endif #endif
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "\t Encoding Parameters = %s \n", switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
(NOTPRSNT != r->parms.pres)?(char*)r->parms.val:"Not Present"); "\t Encoding Parameters = %s \n",
(NOTPRSNT != r->parms.pres)?
(char*)r->parms.val:"Not Present");
} }
break; break;
} }
@ -1832,8 +1849,11 @@ switch_status_t mg_rem_unsupported_codecs (megaco_profile_t* mg_profile, mg_term
/* see if received codec is present in our codec supported list */ /* see if received codec is present in our codec supported list */
for (id = 0; codecs[id] && id < codec_count; id++) { for (id = 0; codecs[id] && id < codec_count; id++) {
int pt = codecs[id]->ianacode; int pt = codecs[id]->ianacode;
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, "Matching recv codec[%d] with supported codec[%d] \n", fmt->val.val, pt); switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO,
"Matching recv codec[%d] with supported codec[%d] \n", fmt->val.val, pt);
//const char *name = codecs[id]->iananame; //const char *name = codecs[id]->iananame;
/* anything > 96 is dymanic we should skip codec match */
if(fmt->val.val >= 96) {foundCodec = 0x01; break;}
if(pt == fmt->val.val){ if(pt == fmt->val.val){
foundCodec = 0x01; foundCodec = 0x01;
break; break;