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

Brian Foster bdfoster at davri.com
Mon Jun 10 08:45:33 MSD 2013


Set your variable as a channel_variable.

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

- BDF
On Jun 9, 2013 8:35 PM, "Vincent Xia" <gmangudai at 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 at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130610/023b98ed/attachment.html 


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