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

Giovanni Maruzzelli gmaruzz at gmail.com
Sun May 31 01:21:02 MSD 2015


Hi Jim,

get the variables from the session:

https://freeswitch.org/confluence/display/FREESWITCH/Lua+API+Reference#LuaAPIReference-session:getVariable



On Sat, May 30, 2015 at 10:21 PM, Jim Lynch <jim at k4gvo.com> wrote:

> 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.
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.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
>



-- 
Sincerely,

Giovanni Maruzzelli
Cell : +39-347-2665618
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20150530/2023d68e/attachment.html 


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