]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Some changes to ss7 variables to be more consistent
authorDavid Yat Sin <dyatsin@sangoma.com>
Wed, 30 May 2012 17:10:04 +0000 (13:10 -0400)
committerDavid Yat Sin <dyatsin@sangoma.com>
Wed, 30 May 2012 17:10:04 +0000 (13:10 -0400)
libs/freetdm/mod_freetdm/mod_freetdm.c
libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_support.c

index 430ace829f66fd712d07f4f684b89eac904c7753..e889d1ebba98adec41740593f3a0dd970f550b4c 100755 (executable)
@@ -1554,6 +1554,10 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
                if (sipvar) {
                        ftdm_usrmsg_add_var(&usrmsg, "ss7_ocn_pres", sipvar);
                }
+               sipvar = switch_channel_get_variable(channel, "sip_h_X-FreeTDM-IAM-FWD-IND-HEX");
+               if (sipvar) {
+                       ftdm_usrmsg_add_var(&usrmsg, "ss7_iam_fwd_ind_hex", sipvar);
+               }
        }
 
        if (switch_test_flag(outbound_profile, SWITCH_CPF_SCREEN)) {
@@ -1594,11 +1598,6 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
                ftdm_set_calling_party_category(var, (uint8_t *)&caller_data.cpc);
        }
 
-       if ((var = channel_get_variable(session, var_event, "iam_fwd_ind_HEX"))) {
-               ftdm_usrmsg_add_var(&usrmsg, "iam_fwd_ind_HEX", var);
-       }
-
-       
        if (!zstr(dest)) {
                ftdm_set_string(caller_data.dnis.digits, dest);
        }
index 39134f99259957afc3058f3a2c5f76ad17fa04df..b2edc2b497e792b0196598c66fbc2ccd35713542 100644 (file)
@@ -993,7 +993,7 @@ ftdm_status_t copy_fwdCallInd_to_sngss7(ftdm_channel_t *ftdmchan, SiFwdCallInd *
        fwdCallInd->sccpMethInd.pres            = PRSNT_NODEF;
        fwdCallInd->sccpMethInd.val             = SCCPMTH_NOIND;
        
-       val = ftdm_usrmsg_get_var(ftdmchan->usrmsg, "iam_fwd_ind_HEX");
+       val = ftdm_usrmsg_get_var(ftdmchan->usrmsg, "ss7_iam_fwd_ind_hex");
        if (!ftdm_strlen_zero(val)) {
                uint16_t val_hex = 0;
                if (four_char_to_hex (val, &val_hex) == FTDM_FAIL) {
@@ -1028,7 +1028,12 @@ ftdm_status_t copy_fwdCallInd_to_sngss7(ftdm_channel_t *ftdmchan, SiFwdCallInd *
        fwdCallInd->isdnUsrPrtInd.val           = ISUP_USED;
        fwdCallInd->isdnUsrPrtPrfInd.val        = PREF_PREFAW;
 
-       val = ftdm_usrmsg_get_var(ftdmchan->usrmsg, "iam_fwd_ind_isdn_access_ind");
+       val = ftdm_usrmsg_get_var(ftdmchan->usrmsg, "ss7_iam_fwd_ind_isdn_access_ind");
+       if (ftdm_strlen_zero(val)) {
+               /* Kept for backward compatibility */
+               val = ftdm_usrmsg_get_var(ftdmchan->usrmsg, "iam_fwd_ind_isdn_access_ind");
+       }
+
        if (!ftdm_strlen_zero(val)) {
                acc_val = (int)atoi(val);
        }