<div dir="ltr">change<div>return result</div><div>to</div><div>io.write(result)</div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-12-12 0:32 GMT+03:00 Phillip Jones <span dir="ltr"><<a href="mailto:pjintheusa@gmail.com" target="_blank">pjintheusa@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yeah - thanks - I realize I can do that - but it just drives me crazy I can not get in-line expansion to work. I can't see what I am missing.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 11, 2014 at 3:46 PM, Chad Phillips <span dir="ltr"><<a href="mailto:chad@apartmentlines.com" target="_blank">chad@apartmentlines.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
how about setting the channel var directly in the script?
</div><div><br></div><div>session:setVariable("VUM_SAY_CID", result);</div><div><br></div><div>although for what you’re doing, i really think there’s a cleaner way to do it straight from the dialplan XML...</div><div><div>
<div></div>
<p style="color:#a0a0a8">On Thursday, December 11, 2014 at 1:35 PM, Phillip Jones wrote:</p>
</div></div><blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px">
<span><div><div><div><div><div dir="ltr">I am going crazy - please tell me what I am missing:<div><br></div><div>I have a dialplan:</div><div><br></div><div><action application="set" data="VUM_SAY_CID=${lua(util_get10digits.lua ${VUM_Outgoing_CallerID_Number})}" inline="true"/><br></div><div><br></div><div><br></div><div>I have a lua script:</div><div><br></div><div><br></div><div><div>freeswitch.consoleLog("NOTICE","util_get10digits.lua \n")</div><div>freeswitch.consoleLog("NOTICE","Argument passed [" .. argv[1] .."]\n")</div><div>local result = "none"<br></div><div><b>result = string.sub(argv[1], -10)</b><br></div><div>freeswitch.consoleLog("NOTICE", "Result: [" .. result .."]\n")<br></div><div><b>return result</b><br></div></div><div><br></div><div><br></div><div>I run the dialplan:</div><div><br></div><div><div>Dialplan: sofia/Carrier/<a href="mailto:2154791697@64.158.162.74" target="_blank">2154791697@64.158.162.74</a> Action set(VUM_SAY_CID=${lua(util_get10digits.lua ${VUM_Outgoing_CallerID_Number})}) I</div><div>2014-12-11 15:20:21.795274 [NOTICE] switch_cpp.cpp:1328 util_get10digits.lua</div><div>2014-12-11 15:20:21.795274 [NOTICE] switch_cpp.cpp:1328 Argument passed <a href="tel:%5B%2B12154791697" value="+12154791697" target="_blank">[+12154791697</a>]</div><div><b>2014-12-11 15:20:21.795274 [NOTICE] switch_cpp.cpp:1328 Result: <a href="tel:%5B2154791697" value="+12154791697" target="_blank">[2154791697</a>]</b></div><div>2014-12-11 15:20:21.795274 [DEBUG] switch_cpp.cpp:1075 sofia/Carrier/<a href="mailto:2154791697@64.158.162.74" target="_blank">2154791697@64.158.162.74</a> destroy/unlink session from object</div><div>EXECUTE sofia/Carrier/<a href="mailto:2154791697@64.158.162.74" target="_blank">2154791697@64.158.162.74</a> set(VUM_SAY_CID=)</div><div><b>2014-12-11 15:20:21.795274 [DEBUG] mod_dptools.c:1435 sofia/Carrier/<a href="mailto:2154791697@64.158.162.74" target="_blank">2154791697@64.158.162.74</a> SET [VUM_SAY_CID]=[UNDEF]</b></div></div><div><br></div><div><br></div><div>The lua script runs correctly - how ever the result is not returned the VUM_SAY_CID variable in the dialplan</div><div><br></div><div><br></div><div>The work around is to set the session variable in the script. But I wondering what I am missing. Is "return result" not how you return a result from Lua?</div><div><br></div><div><br></div><div>Thanks for any help.</div><div><br></div><div><br></div><div>Phil</div></div>
</div></div></div><div><div>_________________________________________________________________________</div><div>Professional FreeSWITCH Consulting Services: </div><div><a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a></div><div><a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a></div><div><br></div><div>Official FreeSWITCH Sites</div><div><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></div><div><a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a></div><div><a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a></div><div><br></div><div>FreeSWITCH-users mailing list</div><div><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a></div><div><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a></div><div>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a></div><div><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></div></div></div></span>
</blockquote>
<div>
<br>
</div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div>
</div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>with best regards,</div><div>Dmitriy Borisov</div></div></div></div></div></div></div></div></div></div></div>
</div>