<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>
<p style="color: #A0A0A8;">On Thursday, December 11, 2014 at 1:35 PM, Phillip Jones wrote:</p>
<blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
<span><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">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 [+12154791697]</div><div><b>2014-12-11 15:20:21.795274 [NOTICE] switch_cpp.cpp:1328 Result: [2154791697]</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">2154791697@64.158.162.74</a> destroy/unlink session from object</div><div>EXECUTE sofia/Carrier/<a href="mailto:2154791697@64.158.162.74">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">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>Professional FreeSWITCH Consulting Services: </div><div><a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a></div><div><a href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a></div><div><br></div><div>Official FreeSWITCH Sites</div><div><a href="http://www.freeswitch.org">http://www.freeswitch.org</a></div><div><a href="http://confluence.freeswitch.org">http://confluence.freeswitch.org</a></div><div><a href="http://www.cluecon.com">http://www.cluecon.com</a></div><div><br></div><div>FreeSWITCH-users mailing list</div><div><a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a></div><div><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a></div><div>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a></div><div><a href="http://www.freeswitch.org">http://www.freeswitch.org</a></div></div></div></span>
</blockquote>
<div>
<br>
</div>