<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Ballongtext Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.BallongtextChar
        {mso-style-name:"Ballongtext Char";
        mso-style-priority:99;
        mso-style-link:Ballongtext;
        font-family:"Tahoma","sans-serif";}
span.E-postmall19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;
        font-weight:normal;
        font-style:normal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="SV" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">I&#8217;m not sure if that specific header i available, but that is not the problem here. It seems you have not started the luascript from the dialplan,
 and because of this the session variable is not set.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">/Peter<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">Från:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org]
<b>För </b>Samira Mh<br>
<b>Skickat:</b> den 3 juli 2012 12:16<br>
<b>Till:</b> FreeSWITCH Users Help<br>
<b>Ämne:</b> Re: [Freeswitch-users] how to get the content of sip header ?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<div>
<div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black">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:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black">local var = session:getVariable(&quot;sip_CSeq&quot;)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black">but the error occure:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black">&nbsp;attempt to index global 'session' (a nil value)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black"><o:p>&nbsp;</o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black">&nbsp;REGISTER
<a href="sip:192.168.10.89">sip:192.168.10.89</a> SIP/2.0<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black">&nbsp; &nbsp;Via: SIP/2.0/UDP 192.168.18.120:33648;branch=z9hG4bK-d8754z-7e634b5c7a239f6b-1---d8754z-;rport<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black">&nbsp; &nbsp;Max-Forwards: 70<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black">&nbsp; &nbsp;Contact: &lt;<a href="sip:1000@192.168.18.120:33648;rinstance=313a890c6a269acd">sip:1000@192.168.18.120:33648;rinstance=313a890c6a269acd</a>&gt;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black">&nbsp; &nbsp;To: &lt;<a href="sip:1000@192.168.10.89">sip:1000@192.168.10.89</a>&gt;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black">&nbsp; &nbsp;From: &lt;<a href="sip:1000@192.168.10.89">sip:1000@192.168.10.89</a>&gt;;tag=695adb0d<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black">&nbsp; &nbsp;Call-ID: MGUzNTFkZWVlOTcwODBmOWViNGY4MjM3MzE2NTQzMTM.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black">&nbsp; &nbsp;CSeq: 1 REGISTER<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black">&nbsp; &nbsp;Expires: 5454<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black">&nbsp; &nbsp;Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black">&nbsp; &nbsp;Supported: timer<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black">&nbsp; &nbsp;User-Agent: eyeBeam release 1102q stamp 51814<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black">&nbsp; &nbsp;Content-Length: 0<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black"><o:p>&nbsp;</o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<div>
<div>
<div class="MsoNormal" align="center" style="text-align:center;background:white">
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black">
<hr size="1" width="100%" align="center">
</span></div>
<p class="MsoNormal" style="background:white"><b><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black"> Peter Olsson &lt;<a href="mailto:peter.olsson@visionutveckling.se">peter.olsson@visionutveckling.se</a>&gt;<br>
<b>To:</b> FreeSWITCH Users Help &lt;<a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a>&gt;
<br>
<b>Sent:</b> Sunday, July 1, 2012 11:33 AM<br>
<b>Subject:</b> Re: [Freeswitch-users] how to get the content of sip header ?</span><span style="color:black"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="color:black"><br>
Use session:getVariable(&quot;var&quot;) 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 &quot;Samira Mh&quot; &lt;<a href="mailto:saami_mh@ymail.com">saami_mh@ymail.com</a>&lt;mailto:<a 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 href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>&lt;mailto:<a href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>&gt;&gt;<br>
To: FreeSWITCH Users Help &lt;<a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a>&lt;mailto:<a 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 href="mailto:saami_mh@ymail.com">saami_mh@ymail.com</a>&lt;mailto:<a 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 href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>&lt;mailto:<a 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 href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>&lt;mailto:<a 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">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>&lt;<a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a>&gt;<br>
<br>
<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>&lt;mailto:<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>&gt;<br>
<a href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com">http://www.cluecon.com</a><br>
<br>
Join Us At ClueCon - Aug 7-9, 2012<br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>&lt;mailto:<a 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 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 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>
<o:p></o:p></span></p>
</div>
</div>
</div>
<p class="MsoNormal">!DSPAM:4ff2c56532769990114684! <o:p></o:p></p>
</div>
</body>
</html>