FreeSwitch Lua Welcome IVR
2016-07-12 16:48
1746 查看
IVR(Interactive Voice Response),交互式语音应答系统
预备知识:
mod_lua
mod_flite ,也可以是 mod_cepstral
步骤一:配置拨号计划
在拨号计划(dialplan)中配置extensions调用LUA脚本——welecome.lua
welcome.xml(freeswitch/conf/dialplan/default/welcome.xml)
步骤二:LUA脚本
welcome.lua(freeswitch/scripts/welcome.lua)
1.需要取消激活枚举,即将99999XX.xml改成9999XX.xml.noload或者其他不同于原名字即可
(官网上信息可能有误,仅在源码中找到相关文件,编译后的文件未找到)
2.不要同时加载mod_flite和mod_cepstral
翻译出处:https://freeswitch.org/confluence/display/FREESWITCH/Lua+Welcome+IVR+example
预备知识:
mod_lua
mod_flite ,也可以是 mod_cepstral
步骤一:配置拨号计划
在拨号计划(dialplan)中配置extensions调用LUA脚本——welecome.lua
welcome.xml(freeswitch/conf/dialplan/default/welcome.xml)
<include> <extension name="welcome_ivr"> <condition field="destination_number" expression="^2910$"> <action application="lua" data="welcome.lua"/> </condition> </extension> </include>
步骤二:LUA脚本
welcome.lua(freeswitch/scripts/welcome.lua)
session:answer(); while (session:ready() == true) do session:setAutoHangup(false); session:set_tts_params("flite", "kal"); session:speak("Welcome. Welcome to the VoIp World!. this is a Blind Users Programing Community. powered by Freeswitch, the free ultimate PBX. thank to toni!"); session:sleep(100); session:speak("please select an Action."); session:sleep(100); session:speak("to call the conference, press 1"); session:sleep(100); session:speak("to call Freeswitch IVR, press 2"); session:sleep(100); session:speak("to call Voice Mail, press 3"); session:sleep(100); session:speak("for Music on hold, press 4"); session:sleep(100); session:speak("to call me, press 0"); session:sleep(3000); digits = session:getDigits(1, "", 3000); if (digits == "1") then session:execute("transfer","9888"); end if (digits == "2") then session:execute("transfer","5000"); end if (digits == "3") then session:execute("transfer","4000"); end if (digits == "4") then session:execute("transfer","9999"); end if (digits == "0") then session:execute("transfer","voipaware@sip.voipuser.org"); end end注意:
1.需要取消激活枚举,即将99999XX.xml改成9999XX.xml.noload或者其他不同于原名字即可
(官网上信息可能有误,仅在源码中找到相关文件,编译后的文件未找到)
2.不要同时加载mod_flite和mod_cepstral
翻译出处:https://freeswitch.org/confluence/display/FREESWITCH/Lua+Welcome+IVR+example
相关文章推荐
- Android Manifest 用法
- 什么是 GraphQL?
- Spark RDD API详解(一) Map和Reduce
- Spring Boot 开发微服务
- lwn拾遗:[sn3218 led drivers]-api解释-1
- 页面元素查找之Selectors API
- Linux C函数参考手册(PDF版)
- 一个小型js框架myJSFrame附API使用帮助
- 详解Lua中的表的概念及其相关操作方法
- C# partial关键字说明
- Lua编程示例(二):面向对象、metatable对表进行扩展
- 详细分析交换机、路由器、集线器的区别和联系
- PowerShell打开或关闭光驱
- 把Lua编译进nginx步骤方法
- 批处理的api WMIC学习体会有感第1/2页
- 批处理 API实现文件下载的代码第1/2页
- Lua脚本自动生成APK包
- Lua中的元表(metatable)、元方法(metamethod)详解
- Lua中的metatable介绍