Freetdm: adding X-FreeTDM-ANI-NADI and X-FreeTDM-DNIS-NADI support

This commit is contained in:
James Zhang 2011-12-05 16:58:26 -05:00
parent b3297c7f3b
commit e582586876
3 changed files with 17 additions and 3 deletions

View File

@ -1355,7 +1355,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
/* Used by ftmod_sangoma_ss7 only */
sipvar = switch_channel_get_variable(channel, "sip_h_X-FreeTDM-DNIS-NADI");
if (sipvar) {
ftdm_usrmsg_add_var(&usrmsg, "ss7_clg_nadi", sipvar);
ftdm_usrmsg_add_var(&usrmsg, "ss7_cld_nadi", sipvar);
}
sipvar = switch_channel_get_variable(channel, "sip_h_X-FreeTDM-RDNIS");
@ -1711,6 +1711,12 @@ ftdm_status_t ftdm_channel_from_event(ftdm_sigmsg_t *sigmsg, switch_core_session
var_value = ftdm_sigmsg_get_var(sigmsg, "ss7_clg_nadi");
if (!ftdm_strlen_zero(var_value)) {
switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-NADI", "%s", var_value);
switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-ANI-NADI", "%s", var_value);
}
var_value = ftdm_sigmsg_get_var(sigmsg, "ss7_cld_nadi");
if (!ftdm_strlen_zero(var_value)) {
switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-DNIS-NADI", "%s", var_value);
}
var_value = ftdm_sigmsg_get_var(sigmsg, "ss7_rdnis_screen_ind");

View File

@ -201,10 +201,10 @@ ftdm_status_t handle_con_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circ
}
copy_redirgNum_from_sngss7(ftdmchan, &siConEvnt->redirgNum);
copy_genNmb_from_sngss7(ftdmchan, &siConEvnt->genNmb);
copy_cgPtyCat_from_sngss7(ftdmchan, &siConEvnt->cgPtyCat);
copy_cdPtyNum_from_sngss7(ftdmchan, &siConEvnt->cdPtyNum);
/* fill in the TMR/bearer capability */
if (siConEvnt->txMedReq.eh.pres) {

View File

@ -193,7 +193,15 @@ ftdm_status_t copy_cgPtyNum_to_sngss7(ftdm_channel_t *ftdmchan, SiCgPtyNum *cgPt
ftdm_status_t copy_cdPtyNum_from_sngss7(ftdm_channel_t *ftdmchan, SiCdPtyNum *cdPtyNum)
{
/* TODO: Implement me */
char var[FTDM_DIGITS_LIMIT];
sngss7_chan_data_t *sngss7_info = ftdmchan->call_data;
if (cdPtyNum->eh.pres == PRSNT_NODEF &&
cdPtyNum->natAddrInd.pres == PRSNT_NODEF) {
sprintf(var, "%d", cdPtyNum->natAddrInd.val);
sngss7_add_var(sngss7_info, "ss7_cld_nadi", var);
}
return FTDM_SUCCESS;
}