提交 37e20b86 authored 作者: Brian West's avatar Brian West

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
上级 2cb9db8c
...@@ -12,39 +12,51 @@ function my_cb(s, type, obj, arg) ...@@ -12,39 +12,51 @@ function my_cb(s, type, obj, arg)
if (type == "dtmf") then if (type == "dtmf") then
io.write("digit: [" .. obj['digit'] .. "]\nduration: [" .. obj['duration'] .. "]\n"); io.write("digit: [" .. obj['digit'] .. "]\nduration: [" .. obj['duration'] .. "]\n");
if (obj['digit'] == "1") then
return "pause";
end
if (obj['digit'] == "2") then if (obj['digit'] == "1") then
return "seek:+3000"; return "seek:-3000";
end end
if (obj['digit'] == "3") then if (obj['digit'] == "3") then
return "seek:-3000"; return "seek:+3000";
end end
if (obj['digit'] == "4") then if (obj['digit'] == "4") then
return "seek:+3000"; return "speed:+1";
end end
if (obj['digit'] == "5") then if (obj['digit'] == "5") then
return "speed:+1"; return "speed:0";
end end
if (obj['digit'] == "6") then if (obj['digit'] == "6") then
return "speed:0"; return "speed:-1";
end end
if (obj['digit'] == "7") then if (obj['digit'] == "7") then
return "speed:-1"; return "volume:+1";
end end
if (obj['digit'] == "8") then if (obj['digit'] == "8") then
return "stop"; return "volume:0";
end end
if (obj['digit'] == "9") then 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"; return "break";
end end
else else
io.write(obj:serialize("xml")); io.write(obj:serialize("xml"));
...@@ -54,4 +66,4 @@ end ...@@ -54,4 +66,4 @@ end
blah = "args"; blah = "args";
session:setHangupHook("all_done"); session:setHangupHook("all_done");
session:setInputCallback("my_cb", "blah"); session:setInputCallback("my_cb", "blah");
session:streamFile("/tmp/swimp.raw"); session:streamFile("/ram/swimp.raw");
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论