[Freeswitch-users] Add new headers with APIs

I put the Who? in Mishehu mishehu at freeswitch.org
Mon Dec 23 11:10:44 MSK 2013


You are doing this on a call to the originate application in ESL, so try 
adding the headers by adding them to the {} segment.  The set 
application requires an existing session object to work upon, and I 
don't believe you have any here (though I'm not an ESL lua expert).

So you would have 
{ignore_early_media=true,originate_timeout=60,sip_h_X-Token=abc123,....} 
in your origination.  For further information, see 
http://wiki.freeswitch.org/wiki/Mod_commands#originate

-Yossi

On 12/23/2013 01:44 AM, Sayyed Mohammad Emami Razavi wrote:
> Hello Alex,
> I used your guide in my lua script but in tcpdump and fs_cli, i can 
> find no new headers set.
> This is my lua code:
>
> #!/usr/bin/lua
> require("ESL")
> local command = 'originate 
> {ignore_early_media=true,originate_timeout=60}user/1000 at 192.168.1.5 
> <mailto:1000 at 192.168.1.5> 
> &playback(/usr/local/freeswitch/scripts/HelloWorld.wav)';
> local args = table.concat({}, " ");
> local con = ESL.ESLconnection("localhost", "8021", "ClueCon");
> con:execute("set", "sip_h_X-Token=abc123");
> con:execute("set", "X-Token=abc123");
> con:execute("set", 
> "<![CDATA[sip_h_P-Charge-Info=<sip:${caller_id_number}@${domain_name}>;npi=0;noa=3]]>");
> local e = con:bgapi(command, args);
> print(e:getBody());
>
> Can you help me more?!
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20131223/42b2735c/attachment-0001.html 


Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list