[Freeswitch-users] having problem getting return value from lua script

Vincent Xia gmangudai at gmail.com
Mon Jun 10 04:27:55 MSD 2013


when i was trying to get return value from lua script (with which sql query
was processed),

<action application="set" data="myvar=${expand(luarun GetDataFromDB.lua
${caller_id_number})}"/>
<action application="info" data="myvar=${myvar}"/>

GetDataFromDB.lua
--------------------------------------
callerid = argv[1]

-- DB sql query
...
varout = callerid..'abc'
return varout

the info shows "myvar=+OK.......", then i tried

<action application="set" data="myvar=${expand(lua GetDataFromDB.lua
${caller_id_number})}"/> -- using lua

GetDataFromDB.lua instead of luarun GetDataFromDB.lua
the info shows an empty string, "myvar=".

how to get the return value from lua script?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130610/56d8b7ef/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list