From dd6853cb983ef149ca61318900d7da1453d8ae88 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Tue, 26 Apr 2011 11:04:44 -0400 Subject: [PATCH] freetdm: ss7 - Fix for some SIP RDNIS headers being overwritten --- libs/freetdm/mod_freetdm/mod_freetdm.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/libs/freetdm/mod_freetdm/mod_freetdm.c b/libs/freetdm/mod_freetdm/mod_freetdm.c index 8739c4c0bf..e6930ab16f 100755 --- a/libs/freetdm/mod_freetdm/mod_freetdm.c +++ b/libs/freetdm/mod_freetdm/mod_freetdm.c @@ -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); } - 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"); 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"); if (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"); if (sipvar) { caller_data.screen = (uint8_t)atoi(sipvar);