<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Xiao<br>
      <br>
      I not quite sure what are you trying to accomplish.<br>
      <br>
      Where are you setting the "sip_ph_X" header? at dialplan level?
      script (lua, js, etc)?<br>
      <br>
      Why you dont "atomize" your actions? For example, at dialplan
      level:<br>
      <br>
      1. First grab what freetdm give you. Use info app<br>
      2. Then capture the channel variable into a new variable<br>
      3. When you bridge/transfer the call to the sip side, make the
      channel setting<br>
      4. Use again info app to validate<br>
      5. Also check, where are you setting the "sip_ph_X" header,
      perhaps you are setting it in the wrong leg<br>
      <br>
      <br>
      On 5/27/2013 12:15 PM, <a class="moz-txt-link-abbreviated" href="mailto:xiaofengcanyuexp@163.com">xiaofengcanyuexp@163.com</a> wrote:<br>
    </div>
    <blockquote cite="mid:201305280045030372439@163.com" type="cite">
      <pre wrap="">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-&gt;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);
        }

&gt;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:
    &lt;action application="log" data="The BCI hex is: ${sip_ph_X-TRUSTID-BCI-HEX}"/&gt;
    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




_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a class="moz-txt-link-abbreviated" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a class="moz-txt-link-freetext" href="http://www.cudatel.com">http://www.cudatel.com</a>

Official FreeSWITCH Sites
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://wiki.freeswitch.org">http://wiki.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.cluecon.com">http://www.cluecon.com</a>

FreeSWITCH-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>


-----
No virus found in this message.
Checked by AVG - <a class="moz-txt-link-abbreviated" href="http://www.avg.com">www.avg.com</a>
Version: 2012.0.2242 / Virus Database: 3184/5853 - Release Date: 05/24/13


</pre>
    </blockquote>
    <br>
    <br>
    <div class="moz-signature">-- <br>
      Atentamente,
      <br>
      <b>Dario Garc&iacute;a</b>
      <br>
      Consultor.
      <br>
      <br>
      CCCT, Nivel C2, Sector Yarey, Mz, <br>
      Ofc. MZ03a. <br>
      Caracas-Venezuela.
      <br>
      Tel&eacute;fono: +58 212 9081842
      <br>
      Cel: +58 412 2221515
      <br>
      <a class="moz-txt-link-abbreviated" href="mailto:dgarcia@anew.com.ve">dgarcia@anew.com.ve</a>
      <br>
      <a class="moz-txt-link-freetext" href="http://www.anew.com.ve">http://www.anew.com.ve</a></div>
  </body>
</html>