[Freeswitch-users] how to take the result of running lua script on dialplan of freeswitch?
Avi Marcus
avi at avimarcus.net
Thu May 31 10:15:07 MSD 2012
Set a channel variable in Lua:
http://wiki.freeswitch.org/wiki/Lua#session:setVariable
-Avi
On Thu, May 31, 2012 at 7:59 AM, Samira Mh <saami_mh at ymail.com> wrote:
> hi guys,
> <include>
> <extension name="welcome_ivr">
> <condition field="destination_number" expression="^samira$">
> <action application="lua" data="welcome.lua"/>
> </condition>
> </extension>
> </include>
>
> i have created lua script like this:
> /usr/local/freeswitch/script/welcome.lua
>
> #!/usr/bin/lua
>
> local sf = string.format
>
> function binary_op(a, b, callback)
> return callback(a, b);
> end
>
> function plus(a, b) return a + b end
> function minus(a, b) return a - b end
> function times(a, b) return a * b end
>
> print(sf("Plus : %d", binary_op(5, 5, plus)));
> print(sf("Minus: %d", binary_op(5, 5, minus)));
> print(sf("Times: %d", binary_op(5, 5, times)));
>
> the result of running that is 3 number,
> but how can i get the 3 number in dialplan of freeswitch so that use the
> result of this number on it ?
> thanks so much
>
>
> _________________________________________________________________________
> 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
>
> Join Us At ClueCon - Aug 7-9, 2012
>
> 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/20120531/c0febbc9/attachment-0001.html
Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users
mailing list