freetdm: ss7 - Fix for some SIP RDNIS headers being overwritten

This commit is contained in:
David Yat Sin 2011-04-26 11:04:44 -04:00 committed by root
parent ed11f2fed7
commit dd6853cb98
1 changed files with 12 additions and 7 deletions

View File

@ -1301,22 +1301,27 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
ftdm_set_string(caller_data.rdnis.digits, sipvar); ftdm_set_string(caller_data.rdnis.digits, sipvar);
} }
sipvar = switch_channel_get_variable(channel, "sip_h_X-FreeTDM-RDNIS-TON");
if (sipvar) {
caller_data.rdnis.type = (uint8_t)atoi(sipvar);
}
sipvar = switch_channel_get_variable(channel, "sip_h_X-FreeTDM-RDNIS-Plan"); sipvar = switch_channel_get_variable(channel, "sip_h_X-FreeTDM-RDNIS-Plan");
if (sipvar) { if (sipvar) {
caller_data.rdnis.plan = (uint8_t)atoi(sipvar); ftdm_call_add_var(&caller_data, "ss7_rdnis_plan", sipvar);
} }
/* Used by ftmod_sangoma_ss7 only */
sipvar = switch_channel_get_variable(channel, "sip_h_X-FreeTDM-RDNIS-NADI"); sipvar = switch_channel_get_variable(channel, "sip_h_X-FreeTDM-RDNIS-NADI");
if (sipvar) { if (sipvar) {
ftdm_usrmsg_add_var(&usrmsg, "ss7_rdnis_nadi", sipvar); ftdm_usrmsg_add_var(&usrmsg, "ss7_rdnis_nadi", sipvar);
} }
sipvar = switch_channel_get_variable(channel, "sip_h_X-FreeTDM-RDNIS-Screen");
if (sipvar) {
ftdm_call_add_var(&caller_data, "ss7_rdnis_screen_ind", sipvar);
}
sipvar = switch_channel_get_variable(channel, "sip_h_X-FreeTDM-RDNIS-Presentation");
if (sipvar) {
ftdm_call_add_var(&caller_data, "ss7_rdnis_pres_ind", sipvar);
}
sipvar = switch_channel_get_variable(channel, "sip_h_X-FreeTDM-Screen"); sipvar = switch_channel_get_variable(channel, "sip_h_X-FreeTDM-Screen");
if (sipvar) { if (sipvar) {
caller_data.screen = (uint8_t)atoi(sipvar); caller_data.screen = (uint8_t)atoi(sipvar);