Set your variable as a channel_variable.

session:setVariable('myvar', 'myvalue');

- BDF

On Jun 9, 2013 8:35 PM, "Vincent Xia" <gmangudai@gmail.com> wrote:
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?


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org