[Freeswitch-svn] [commit] r12118 - freeswitch/trunk/scripts/lua

FreeSWITCH SVN brian at freeswitch.org
Tue Feb 17 13:50:50 PST 2009


Author: brian
Date: Tue Feb 17 15:50:50 2009
New Revision: 12118

Log:
update callback.lua to show off the volume option

Modified:
   freeswitch/trunk/scripts/lua/callback.lua

Modified: freeswitch/trunk/scripts/lua/callback.lua
==============================================================================
--- freeswitch/trunk/scripts/lua/callback.lua	(original)
+++ freeswitch/trunk/scripts/lua/callback.lua	Tue Feb 17 15:50:50 2009
@@ -12,39 +12,51 @@
    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 @@
 blah = "args";
 session:setHangupHook("all_done");
 session:setInputCallback("my_cb", "blah");
-session:streamFile("/tmp/swimp.raw");
+session:streamFile("/ram/swimp.raw");



More information about the Freeswitch-svn mailing list