From 3235fa079a26142e8c499441b08660254dfee55c Mon Sep 17 00:00:00 2001 From: James Zhang Date: Thu, 26 Jan 2012 18:00:34 -0500 Subject: [PATCH] FreeTDM: fix for SPIROU - adding freetdm_iam_fwd_ind_isdn_access_ind (value must be 0 or 1) to modify forward call indicator's ISDN access indicator value in transparent IAM --- libs/freetdm/mod_freetdm/mod_freetdm.c | 5 ++++- .../ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_out.c | 3 +++ .../ftmod_sangoma_ss7/ftmod_sangoma_ss7_support.c | 10 +++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/libs/freetdm/mod_freetdm/mod_freetdm.c b/libs/freetdm/mod_freetdm/mod_freetdm.c index c2712621da..cdcb8ca1e0 100755 --- a/libs/freetdm/mod_freetdm/mod_freetdm.c +++ b/libs/freetdm/mod_freetdm/mod_freetdm.c @@ -1523,13 +1523,16 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi caller_data.pres = FTDM_PRES_RESTRICTED; } + if ((var = channel_get_variable(session, var_event, "freetdm_iam_fwd_ind_isdn_access_ind"))) { + ftdm_usrmsg_add_var(&usrmsg, "iam_fwd_ind_isdn_access_ind", var); + } + if ((var = channel_get_variable(session, var_event, "freetdm_iam_loc_pres"))) { ftdm_usrmsg_add_var(&usrmsg, "iam_loc_pres", var); } if ((var = channel_get_variable(session, var_event, "freetdm_bearer_capability"))) { caller_data.bearer_capability = (uint8_t)atoi(var); } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "freetdm_bearer_capability is set to %s \n", var ); if ((var = channel_get_variable(session, var_event, "freetdm_bearer_layer1"))) { caller_data.bearer_layer1 = (uint8_t)atoi(var); diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_out.c b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_out.c index a5311e9afc..d25b3342f0 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_out.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_out.c @@ -70,6 +70,9 @@ void ft_to_sngss7_iam (ftdm_channel_t * ftdmchan) /* Location Number information */ copy_locPtyNum_to_sngss7(ftdmchan, &iam.cgPtyNum1); + + /* Forward Call Indicators */ + copy_fwdCallInd_to_sngss7(ftdmchan, &iam.fwdCallInd); } else { /* Nature of Connection Indicators */ copy_natConInd_to_sngss7(ftdmchan, &iam.natConInd); diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_support.c b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_support.c index 957649fa21..c25597cd40 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_support.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_support.c @@ -763,6 +763,8 @@ ftdm_status_t copy_natConInd_to_sngss7(ftdm_channel_t *ftdmchan, SiNatConInd *na ftdm_status_t copy_fwdCallInd_to_sngss7(ftdm_channel_t *ftdmchan, SiFwdCallInd *fwdCallInd) { + const char *val = NULL; + int acc_val = ISDNACC_ISDN; sngss7_chan_data_t *sngss7_info = ftdmchan->call_data; fwdCallInd->eh.pres = PRSNT_NODEF; @@ -779,7 +781,13 @@ ftdm_status_t copy_fwdCallInd_to_sngss7(ftdm_channel_t *ftdmchan, SiFwdCallInd * fwdCallInd->isdnUsrPrtPrfInd.pres = PRSNT_NODEF; fwdCallInd->isdnUsrPrtPrfInd.val = PREF_PREFAW; fwdCallInd->isdnAccInd.pres = PRSNT_NODEF; - fwdCallInd->isdnAccInd.val = ISDNACC_ISDN; + + val = ftdm_usrmsg_get_var(ftdmchan->usrmsg, "iam_fwd_ind_isdn_access_ind"); + if (!ftdm_strlen_zero(val)) { + acc_val = (int)atoi(val); + } + + fwdCallInd->isdnAccInd.val = acc_val; fwdCallInd->sccpMethInd.pres = PRSNT_NODEF; fwdCallInd->sccpMethInd.val = SCCPMTH_NOIND;