<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");&nbsp;</div><div><br></div><div>and pass it to some variable or you can take help from following snippet of code from&nbsp;</div><div><br></div><div>&nbsp;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>&nbsp;I have taken it from</div><div>&nbsp;<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>&gt; Date: Sun, 31 May 2015 00:41:06 +0200<br>&gt; From: dragic.dusan@gmail.com<br>&gt; To: freeswitch-users@lists.freeswitch.org<br>&gt; Subject: Re: [Freeswitch-users] Need help with lua called from dial plan - How to delimit arguments?<br>&gt; <br>&gt; Use single quotes (but Giovanni's suggestion is the way to go).<br>&gt; <br>&gt; On 30 May 2015 at 22:21, Jim Lynch &lt;jim@k4gvo.com&gt; wrote:<br>&gt; &gt; I have a line in my dialplan that looks like this:<br>&gt; &gt;      &lt;action application="lua" data="cid.lua  ${caller_id_name}<br>&gt; &gt; ${caller_id_number}" /&gt;<br>&gt; &gt;<br>&gt; &gt; However when the program is executed and the caller_id_name has a space<br>&gt; &gt; in it, the number gets lost.<br>&gt; &gt; I can't figure out a way to add delimiters that get passed to the<br>&gt; &gt; shell.  None of these work:<br>&gt; &gt;<br>&gt; &gt;      &lt;action application="lua" data="cid.lua \"${caller_id_name}\"<br>&gt; &gt; \"${caller_id_number}\"" /&gt;<br>&gt; &gt; or<br>&gt; &gt;      &lt;action application="lua" data="cid.lua ''${caller_id_name}''<br>&gt; &gt; ''${caller_id_number}''" /&gt;<br>&gt; &gt; or<br>&gt; &gt;      &lt;action application="lua" data="cid.lua \"\"${caller_id_name}\"\"<br>&gt; &gt; \"\"${caller_id_number}\"\"" /&gt;<br>&gt; &gt;<br>&gt; &gt; None of those work.  The quotes are all stripped off when running this test<br>&gt; &gt;<br>&gt; &gt; lua file:<br>&gt; &gt; tmp_file = "/tmp/cidtest.txt";<br>&gt; &gt; local file = assert(io.open(tmp_file, "a"));<br>&gt; &gt; local m_name=argv[1];<br>&gt; &gt; local m_number=argv[2];<br>&gt; &gt; file:write("j cid is ",m_name," number is ",m_number,"\n");<br>&gt; &gt;<br>&gt; &gt; Any suggestions?<br>&gt; &gt;<br>&gt; &gt; Thanks,<br>&gt; &gt; Jim.<br>&gt; &gt;<br>&gt; &gt; _________________________________________________________________________<br>&gt; &gt; Professional FreeSWITCH Consulting Services:<br>&gt; &gt; consulting@freeswitch.org<br>&gt; &gt; http://www.freeswitchsolutions.com<br>&gt; &gt;<br>&gt; &gt; Official FreeSWITCH Sites<br>&gt; &gt; http://www.freeswitch.org<br>&gt; &gt; http://confluence.freeswitch.org<br>&gt; &gt; http://www.cluecon.com<br>&gt; &gt;<br>&gt; &gt; FreeSWITCH-users mailing list<br>&gt; &gt; FreeSWITCH-users@lists.freeswitch.org<br>&gt; &gt; http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br>&gt; &gt; UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br>&gt; &gt; http://www.freeswitch.org<br>&gt; <br>&gt; <br>&gt; <br>&gt; -- <br>&gt; Dušan Dragić<br>&gt; <br>&gt; _________________________________________________________________________<br>&gt; Professional FreeSWITCH Consulting Services: <br>&gt; consulting@freeswitch.org<br>&gt; http://www.freeswitchsolutions.com<br>&gt; <br>&gt; Official FreeSWITCH Sites<br>&gt; http://www.freeswitch.org<br>&gt; http://confluence.freeswitch.org<br>&gt; http://www.cluecon.com<br>&gt; <br>&gt; FreeSWITCH-users mailing list<br>&gt; FreeSWITCH-users@lists.freeswitch.org<br>&gt; http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br>&gt; UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br>&gt; http://www.freeswitch.org<br></div></div>                                               </div></body>
</html>