I am going crazy - please tell me what I am missing:
I have a dialplan:
<action application="set" data="VUM_SAY_CID=${lua(util_get10digits.lua ${VUM_Outgoing_CallerID_Number})}" inline="true"/>
I have a lua script:
freeswitch.consoleLog("NOTICE","util_get10digits.lua \n")
freeswitch.consoleLog("NOTICE","Argument passed [" .. argv[1] .."]\n")
local result = "none"
result = string.sub(argv[1], -10)
freeswitch.consoleLog("NOTICE", "Result: [" .. result .."]\n")
return result
I run the dialplan:
Dialplan: sofia/Carrier/
2154791697@64.158.162.74 Action set(VUM_SAY_CID=${lua(util_get10digits.lua ${VUM_Outgoing_CallerID_Number})}) I
2014-12-11 15:20:21.795274 [NOTICE] switch_cpp.cpp:1328 util_get10digits.lua
2014-12-11 15:20:21.795274 [NOTICE] switch_cpp.cpp:1328 Argument passed [+12154791697]
2014-12-11 15:20:21.795274 [NOTICE] switch_cpp.cpp:1328 Result: [2154791697]
2014-12-11 15:20:21.795274 [DEBUG] switch_cpp.cpp:1075 sofia/Carrier/
2154791697@64.158.162.74 destroy/unlink session from object
The lua script runs correctly - how ever the result is not returned the VUM_SAY_CID variable in the dialplan
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?
Thanks for any help.
Phil