[Freeswitch-users] Need help with lua called from dial plan - How to delimit arguments?

Jim Lynch jim at k4gvo.com
Sun May 31 00:21:22 MSD 2015


I have a line in my dialplan that looks like this:
     <action application="lua" data="cid.lua  ${caller_id_name} 
${caller_id_number}" />

However when the program is executed and the caller_id_name has a space 
in it, the number gets lost.
I can't figure out a way to add delimiters that get passed to the 
shell.  None of these work:

     <action application="lua" data="cid.lua \"${caller_id_name}\" 
\"${caller_id_number}\"" />
or
     <action application="lua" data="cid.lua ''${caller_id_name}'' 
''${caller_id_number}''" />
or
     <action application="lua" data="cid.lua \"\"${caller_id_name}\"\" 
\"\"${caller_id_number}\"\"" />

None of those work.  The quotes are all stripped off when running this test

lua file:
tmp_file = "/tmp/cidtest.txt";
local file = assert(io.open(tmp_file, "a"));
local m_name=argv[1];
local m_number=argv[2];
file:write("j cid is ",m_name," number is ",m_number,"\n");

Any suggestions?

Thanks,
Jim.



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