<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 value of sip-header ' CSeq' 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> 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> REGISTER sip:192.168.10.89 SIP/2.0</div><div> Via: SIP/2.0/UDP 192.168.18.120:33648;branch=z9hG4bK-d8754z-7e634b5c7a239f6b-1---d8754z-;rport</div><div> Max-Forwards: 70</div><div> Contact: <sip:1000@192.168.18.120:33648;rinstance=313a890c6a269acd></div><div> To: <sip:1000@192.168.10.89></div><div> From:
<sip:1000@192.168.10.89>;tag=695adb0d</div><div> Call-ID: MGUzNTFkZWVlOTcwODBmOWViNGY4MjM3MzE2NTQzMTM.</div><div> CSeq: 1 REGISTER</div><div> Expires: 5454</div><div> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO</div><div> Supported: timer</div><div> User-Agent: eyeBeam release 1102q stamp 51814</div><div> 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 <peter.olsson@visionutveckling.se><br> <b><span style="font-weight: bold;">To:</span></b> FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> <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" <<a ymailto="mailto:saami_mh@ymail.com" href="mailto:saami_mh@ymail.com">saami_mh@ymail.com</a><mailto:<a ymailto="mailto:saami_mh@ymail.com" href="mailto:saami_mh@ymail.com">saami_mh@ymail.com</a>>>:<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 <<a ymailto="mailto:msc@freeswitch.org"
href="mailto:msc@freeswitch.org">msc@freeswitch.org</a><mailto:<a ymailto="mailto:msc@freeswitch.org" href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>>><br>To: FreeSWITCH Users Help <<a ymailto="mailto:freeswitch-users@lists.freeswitch.org" href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><mailto:<a ymailto="mailto:freeswitch-users@lists.freeswitch.org" href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a>>><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 <<a ymailto="mailto:saami_mh@ymail.com" href="mailto:saami_mh@ymail.com">saami_mh@ymail.com</a><mailto:<a ymailto="mailto:saami_mh@ymail.com"
href="mailto:saami_mh@ymail.com">saami_mh@ymail.com</a>>> wrote:<br>hi,<br>how to get the content of sip header 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><mailto:<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><<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><<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><<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><<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><<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><mailto:<a ymailto="mailto:FreeSWITCH-users@lists.freeswitch.org"
href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>><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><<a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a>><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><mailto:<a ymailto="mailto:consulting@freeswitch.org"
href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>><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><mailto:<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>!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>