From: Brian West Date: Tue, 17 Feb 2009 21:50:50 +0000 (+0000) Subject: update callback.lua to show off the volume option X-Git-Tag: v1.0.3~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37e20b86c8fe35d63df88b1c303cc599fb602e4d;p=thirdparty%2Ffreeswitch.git update callback.lua to show off the volume option git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12118 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/scripts/lua/callback.lua b/scripts/lua/callback.lua index 6e46699e14..84fd56aa87 100644 --- a/scripts/lua/callback.lua +++ b/scripts/lua/callback.lua @@ -12,39 +12,51 @@ function my_cb(s, type, obj, arg) if (type == "dtmf") then io.write("digit: [" .. obj['digit'] .. "]\nduration: [" .. obj['duration'] .. "]\n"); - if (obj['digit'] == "1") then - return "pause"; - end - if (obj['digit'] == "2") then - return "seek:+3000"; + if (obj['digit'] == "1") then + return "seek:-3000"; end if (obj['digit'] == "3") then - return "seek:-3000"; + return "seek:+3000"; end if (obj['digit'] == "4") then - return "seek:+3000"; + return "speed:+1"; end if (obj['digit'] == "5") then - return "speed:+1"; + return "speed:0"; end + if (obj['digit'] == "6") then - return "speed:0"; + return "speed:-1"; end + if (obj['digit'] == "7") then - return "speed:-1"; + return "volume:+1"; end if (obj['digit'] == "8") then - return "stop"; + return "volume:0"; end if (obj['digit'] == "9") then + return "volume:-1"; + end + + if (obj['digit'] == "*") then + return "stop"; + end + + if (obj['digit'] == "0") then + return "pause"; + end + + if (obj['digit'] == "#") then return "break"; end + else io.write(obj:serialize("xml")); @@ -54,4 +66,4 @@ end blah = "args"; session:setHangupHook("all_done"); session:setInputCallback("my_cb", "blah"); -session:streamFile("/tmp/swimp.raw"); +session:streamFile("/ram/swimp.raw");