[Freeswitch-users] sip_ph_X- header doesn't work for freetdm-sofia call

xiaofengcanyuexp at 163.com xiaofengcanyuexp at 163.com
Mon May 27 20:45:04 MSD 2013


Dear support

I got a problem to pass through SS7 info in SIP messages. Here is the code change and test call flow:
--------------------
Code change and log:
--------------------
1. At sangoma module:intercept ACM in ftmod_sangoma_ss7_*.c, parse the BCI and add it to the ftdmchan->call_data:
	sngss7_add_var(sngss7_info, "ss7_acm_bci_hex", val);

2. At freetdm  module mod_freetdm.c, get the variable and set it to channel. Of which, the "prefix" is 'sip_ph_X-':
	var_value = ftdm_sigmsg_get_var(sigmsg, "ss7_acm_bci_hex");
	if (!ftdm_strlen_zero(var_value)) 
	{
		snprintf(variable_name, "%sTEST-BCI-HEX", prefix);
		switch_channel_set_variable_printf(channel, variable_name, "%s", var_value);
	}

>From the test call log:

2013-05-27 07:03:47.747361 [INFO] ftmod_sangoma_ss7_handle.c:362 [s1c1][1:1] [CIC:1]Rx ACM
2013-05-27 07:03:47.747361 [DEBUG] ftmod_sangoma_ss7_support.c:2920 [s1c1][1:1] ACM BCI parameter Hex: 0x1636
2013-05-27 09:00:47.127357 [DEBUG] mod_freetdm.c:5513 Get ACM BCI parameter from sangoma
2013-05-27 09:00:47.127357 [DEBUG] mod_freetdm.c:5530 sip_ph_X-TEST-BCI-HEX:1636
---------------------
My purpose:
---------------------
What I want to do is the encapsulate the sip_ph_X-TEST-BCI-HEX in the 183 SIP message. Like handling IAM  in ftdm_channel_from_event(),
once it sets the the variable like below, the  "X-FreeTDM-SpanNumber" will automatically attached in INVITE message.
         switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-SpanNumber", "%d", spanid); 

---------------------
Problems:
---------------------
While, what's strange are:
1. I add one line in dialplan/default.xml to log the variable with:
    <action application="log" data="The BCI hex is: ${sip_ph_X-TRUSTID-BCI-HEX}"/>
    The freeswitch.log show ${sip_ph_X-TRUSTID-BCI-HEX} is empty
2. The 183 message does not attach the  'X-TRUSTID-BCI-HEX'. 

Can someone help to figure out what's wrong with it?

Thanks
-------------------
2013-05-28






Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list