Is this some kind of xml-generating script for register bindings (as in here: http://wiki.freeswitch.org/wiki/Mod_lua/Serving_Configuration)? If that’s the case, you have no session object, and you will have to follow the information on that wiki page instead.

 

/Peter

 

Från: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] För Samira Mh
Skickat: den 3 juli 2012 12:16
Till: FreeSWITCH Users Help
Ämne: Re: [Freeswitch-users] how to get the content of sip header ?

 

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:

local var = session:getVariable("sip_CSeq")

but the error occure:

 attempt to index global 'session' (a nil value)

 

 

 

 

 REGISTER sip:192.168.10.89 SIP/2.0

   Via: SIP/2.0/UDP 192.168.18.120:33648;branch=z9hG4bK-d8754z-7e634b5c7a239f6b-1---d8754z-;rport

   Max-Forwards: 70

   Contact: <sip:1000@192.168.18.120:33648;rinstance=313a890c6a269acd>

   To: <sip:1000@192.168.10.89>

   From: <sip:1000@192.168.10.89>;tag=695adb0d

   Call-ID: MGUzNTFkZWVlOTcwODBmOWViNGY4MjM3MzE2NTQzMTM.

   CSeq: 1 REGISTER

   Expires: 5454

   Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO

   Supported: timer

   User-Agent: eyeBeam release 1102q stamp 51814

   Content-Length: 0

 

 


From: Peter Olsson <peter.olsson@visionutveckling.se>
To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org>
Sent: Sunday, July 1, 2012 11:33 AM
Subject: Re: [Freeswitch-users] how to get the content of sip header ?


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.

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.

/Peter

1 jul 2012 kl. 05:47 skrev "Samira Mh" <saami_mh@ymail.com<mailto:saami_mh@ymail.com>>:

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 ...

________________________________
From: Michael Collins <msc@freeswitch.org<mailto:msc@freeswitch.org>>
To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org<mailto:freeswitch-users@lists.freeswitch.org>>
Sent: Sunday, July 1, 2012 1:33 AM
Subject: Re: [Freeswitch-users] how to get the content of sip header ?

See if you have a bunch of sip_xxx channel variables. Send the call to the info app and see what you've got.
-MC

On Sat, Jun 30, 2012 at 5:57 AM, Samira Mh <saami_mh@ymail.com<mailto:saami_mh@ymail.com>> wrote:
hi,
how to get the content of sip header  in lua?



_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org<mailto:consulting@freeswitch.org>
http://www.freeswitchsolutions.com<http://www.freeswitchsolutions.com/>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com<http://www.cudatel.com/>

Official FreeSWITCH Sites
http://www.freeswitch.org<http://www.freeswitch.org/>
http://wiki.freeswitch.org<http://wiki.freeswitch.org/>
http://www.cluecon.com<http://www.cluecon.com/>

Join Us At ClueCon - Aug 7-9, 2012

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org<http://www.freeswitch.org/>



_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org<mailto:consulting@freeswitch.org>
http://www.freeswitchsolutions.com

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

Join Us At ClueCon - Aug 7-9, 2012

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


!DSPAM:4fefc4ee32761372387519!

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

Join Us At ClueCon - Aug 7-9, 2012

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

!DSPAM:4ff2c56532769990114684!