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@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@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

Join Us At ClueCon - Aug 7-9, 2012

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