<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><div>for example i want to read the &nbsp;value of &nbsp;sip-header '&nbsp;CSeq' &nbsp; in lua(that is configure for mod_xml in /usr/loca/freeswitch/conf/autoload/lia.xml.conf), must to issue as follow:</div><div>local var = session:getVariable("sip_CSeq")<br></div><div>but the error occure:</div><div>&nbsp;attempt to index global 'session' (a nil value)<br></div><div><br></div><div><div><br></div><div><br></div></div><div><br></div><div>&nbsp;REGISTER sip:192.168.10.89 SIP/2.0</div><div>&nbsp; &nbsp;Via: SIP/2.0/UDP 192.168.18.120:33648;branch=z9hG4bK-d8754z-7e634b5c7a239f6b-1---d8754z-;rport</div><div>&nbsp; &nbsp;Max-Forwards: 70</div><div>&nbsp; &nbsp;Contact: &lt;sip:1000@192.168.18.120:33648;rinstance=313a890c6a269acd&gt;</div><div>&nbsp; &nbsp;To: &lt;sip:1000@192.168.10.89&gt;</div><div>&nbsp; &nbsp;From:
 &lt;sip:1000@192.168.10.89&gt;;tag=695adb0d</div><div>&nbsp; &nbsp;Call-ID: MGUzNTFkZWVlOTcwODBmOWViNGY4MjM3MzE2NTQzMTM.</div><div>&nbsp; &nbsp;CSeq: 1 REGISTER</div><div>&nbsp; &nbsp;Expires: 5454</div><div>&nbsp; &nbsp;Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO</div><div>&nbsp; &nbsp;Supported: timer</div><div>&nbsp; &nbsp;User-Agent: eyeBeam release 1102q stamp 51814</div><div>&nbsp; &nbsp;Content-Length: 0</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div>  <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Peter
 Olsson &lt;peter.olsson@visionutveckling.se&gt;<br> <b><span style="font-weight: bold;">To:</span></b> FreeSWITCH Users Help &lt;freeswitch-users@lists.freeswitch.org&gt; <br> <b><span style="font-weight: bold;">Sent:</span></b> Sunday, July 1, 2012 11:33 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Freeswitch-users] how to get the content of sip header ?<br> </font> </div> <br>
Use session:getVariable("var") to read whatever channel variable you need. As Michael said, the SIP headers are stored like sip_header_name. For instance, to read the header Diversion:, use the variable sip_diversion.<br><br>Michael also mentions the info app, which is a good way to dump all channel variables for a channel, so you know exactly what you have available. To use this, just execute the app info in the dialplan.<br><br>/Peter<br><br>1 jul 2012 kl. 05:47 skrev "Samira Mh" &lt;<a ymailto="mailto:saami_mh@ymail.com" href="mailto:saami_mh@ymail.com">saami_mh@ymail.com</a>&lt;mailto:<a ymailto="mailto:saami_mh@ymail.com" href="mailto:saami_mh@ymail.com">saami_mh@ymail.com</a>&gt;&gt;:<br><br>is it possible to explain in details? ,i have review the wiki on subject but don't understand clearly, i am new on freeswitch, thanks ...<br><br>________________________________<br>From: Michael Collins &lt;<a ymailto="mailto:msc@freeswitch.org"
 href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>&lt;mailto:<a ymailto="mailto:msc@freeswitch.org" href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>&gt;&gt;<br>To: FreeSWITCH Users Help &lt;<a ymailto="mailto:freeswitch-users@lists.freeswitch.org" href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a>&lt;mailto:<a ymailto="mailto:freeswitch-users@lists.freeswitch.org" href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a>&gt;&gt;<br>Sent: Sunday, July 1, 2012 1:33 AM<br>Subject: Re: [Freeswitch-users] how to get the content of sip header ?<br><br>See if you have a bunch of sip_xxx channel variables. Send the call to the info app and see what you've got.<br>-MC<br><br>On Sat, Jun 30, 2012 at 5:57 AM, Samira Mh &lt;<a ymailto="mailto:saami_mh@ymail.com" href="mailto:saami_mh@ymail.com">saami_mh@ymail.com</a>&lt;mailto:<a ymailto="mailto:saami_mh@ymail.com"
 href="mailto:saami_mh@ymail.com">saami_mh@ymail.com</a>&gt;&gt; wrote:<br>hi,<br>how to get the content of sip header&nbsp; in lua?<br><br><br><br>_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services:<br><a ymailto="mailto:consulting@freeswitch.org" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>&lt;mailto:<a ymailto="mailto:consulting@freeswitch.org" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>&gt;<br><a href="http://www.freeswitchsolutions.com/" target="_blank">http://www.freeswitchsolutions.com</a>&lt;<a href="http://www.freeswitchsolutions.com/" target="_blank">http://www.freeswitchsolutions.com/</a>&gt;<br><br>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br><a href="http://www.cudatel.com/" target="_blank">http://www.cudatel.com</a>&lt;<a href="http://www.cudatel.com/"
 target="_blank">http://www.cudatel.com/</a>&gt;<br><br>Official FreeSWITCH Sites<br><a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a>&lt;<a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a>&gt;<br><a href="http://wiki.freeswitch.org/" target="_blank">http://wiki.freeswitch.org</a>&lt;<a href="http://wiki.freeswitch.org/" target="_blank">http://wiki.freeswitch.org/</a>&gt;<br><a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a>&lt;<a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a>&gt;<br><br>Join Us At ClueCon - Aug 7-9, 2012<br><br>FreeSWITCH-users mailing list<br><a ymailto="mailto:FreeSWITCH-users@lists.freeswitch.org" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>&lt;mailto:<a ymailto="mailto:FreeSWITCH-users@lists.freeswitch.org"
 href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>&gt;<br>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a>&lt;<a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a>&gt;<br><br><br>!DSPAM:4fefc4ee32761372387519!<br>_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services:<br><a ymailto="mailto:consulting@freeswitch.org" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>&lt;mailto:<a ymailto="mailto:consulting@freeswitch.org"
 href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>&gt;<br>http://www.freeswitchsolutions.com<br><br>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>http://www.cudatel.com<br><br>Official FreeSWITCH Sites<br>http://www.freeswitch.org<br>http://wiki.freeswitch.org<br>http://www.cluecon.com<br><br>Join Us At ClueCon - Aug 7-9, 2012<br><br>FreeSWITCH-users mailing list<br><a ymailto="mailto:FreeSWITCH-users@lists.freeswitch.org" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>&lt;mailto:<a ymailto="mailto:FreeSWITCH-users@lists.freeswitch.org" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>&gt;<br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
 target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br><br><br>!DSPAM:4fefc4ee32761372387519!<br><br>_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services:<br><a ymailto="mailto:consulting@freeswitch.org" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br><a href="http://www.freeswitchsolutions.com/" target="_blank">http://www.freeswitchsolutions.com</a><br><br>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br><a href="http://www.cudatel.com/" target="_blank">http://www.cudatel.com</a><br><br>Official FreeSWITCH Sites<br><a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br><a href="http://wiki.freeswitch.org/" target="_blank">http://wiki.freeswitch.org</a><br><a href="http://www.cluecon.com/"
 target="_blank">http://www.cluecon.com</a><br><br>Join Us At ClueCon - Aug 7-9, 2012<br><br>FreeSWITCH-users mailing list<br><a ymailto="mailto:FreeSWITCH-users@lists.freeswitch.org" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br><br><br> </div> </div>  </div></body></html>