<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>why not access it as global variable like<div><br></div><div>session:getVariable("caller_id_name"); </div><div><br></div><div>and pass it to some variable or you can take help from following snippet of code from </div><div><br></div><div> function randomize()<div><span class="Apple-tab-span" style="white-space:pre">        </span>api = freeswitch.API();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>seed = tonumber(api:execute("<b>global_getvar</b>", "randomseed"));</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>if seed == 12345678 or seed == "" or seed == nil then</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>seed = os.time();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>end</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>math.randomseed(seed);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>seed = math.random(1,999999)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>api:execute("<b>global_setvar</b>", "randomseed=" .. seed)</div><div>end</div><div><br></div> I have taken it from</div><div> <a href="https://wiki.freeswitch.org/wiki/Fakecall_responder" target="_blank" style="font-size: 12pt;">https://wiki.freeswitch.org/wiki/Fakecall_responder</a></div><div><br></div><div><br><div>> Date: Sun, 31 May 2015 00:41:06 +0200<br>> From: dragic.dusan@gmail.com<br>> To: freeswitch-users@lists.freeswitch.org<br>> Subject: Re: [Freeswitch-users] Need help with lua called from dial plan - How to delimit arguments?<br>> <br>> Use single quotes (but Giovanni's suggestion is the way to go).<br>> <br>> On 30 May 2015 at 22:21, Jim Lynch <jim@k4gvo.com> wrote:<br>> > I have a line in my dialplan that looks like this:<br>> > <action application="lua" data="cid.lua ${caller_id_name}<br>> > ${caller_id_number}" /><br>> ><br>> > However when the program is executed and the caller_id_name has a space<br>> > in it, the number gets lost.<br>> > I can't figure out a way to add delimiters that get passed to the<br>> > shell. None of these work:<br>> ><br>> > <action application="lua" data="cid.lua \"${caller_id_name}\"<br>> > \"${caller_id_number}\"" /><br>> > or<br>> > <action application="lua" data="cid.lua ''${caller_id_name}''<br>> > ''${caller_id_number}''" /><br>> > or<br>> > <action application="lua" data="cid.lua \"\"${caller_id_name}\"\"<br>> > \"\"${caller_id_number}\"\"" /><br>> ><br>> > None of those work. The quotes are all stripped off when running this test<br>> ><br>> > lua file:<br>> > tmp_file = "/tmp/cidtest.txt";<br>> > local file = assert(io.open(tmp_file, "a"));<br>> > local m_name=argv[1];<br>> > local m_number=argv[2];<br>> > file:write("j cid is ",m_name," number is ",m_number,"\n");<br>> ><br>> > Any suggestions?<br>> ><br>> > Thanks,<br>> > Jim.<br>> ><br>> > _________________________________________________________________________<br>> > Professional FreeSWITCH Consulting Services:<br>> > consulting@freeswitch.org<br>> > http://www.freeswitchsolutions.com<br>> ><br>> > Official FreeSWITCH Sites<br>> > http://www.freeswitch.org<br>> > http://confluence.freeswitch.org<br>> > http://www.cluecon.com<br>> ><br>> > FreeSWITCH-users mailing list<br>> > FreeSWITCH-users@lists.freeswitch.org<br>> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br>> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br>> > http://www.freeswitch.org<br>> <br>> <br>> <br>> -- <br>> Dušan Dragić<br>> <br>> _________________________________________________________________________<br>> Professional FreeSWITCH Consulting Services: <br>> consulting@freeswitch.org<br>> http://www.freeswitchsolutions.com<br>> <br>> Official FreeSWITCH Sites<br>> http://www.freeswitch.org<br>> http://confluence.freeswitch.org<br>> http://www.cluecon.com<br>> <br>> FreeSWITCH-users mailing list<br>> FreeSWITCH-users@lists.freeswitch.org<br>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br>> http://www.freeswitch.org<br></div></div>                                            </div></body>
</html>