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@192.168.1.5 <mailto:1000@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@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
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