网站开发项目管理文档,该网站暂时无法访问404,百度助手app下载,怎么建设一个国外的网站概述
freeswitch是一款简单好用的VOIP开源软交换平台。
随着fs服务的增多#xff0c;每一台fs都需要在后台单独配置#xff0c;耗时耗力#xff0c;心力憔悴。
如果有一个集中管理配置的配置中心#xff0c;统一管理所有fs的配置#xff0c;并可以实现动态的修改配置就… 概述
freeswitch是一款简单好用的VOIP开源软交换平台。
随着fs服务的增多每一台fs都需要在后台单独配置耗时耗力心力憔悴。
如果有一个集中管理配置的配置中心统一管理所有fs的配置并可以实现动态的修改配置就好了。
于是就发现了mod_xml_curl模块。
环境
centosCentOS release 7.0 (Final)或以上版本
freeswitchv1.10.7
GCC4.8.5
模块介绍
mod_xml_curl模块默认不编译安装。
进入“freeswitch/src/mod/xml_int/mod_xml_curl”目录执行如下命令
sudo make install 检查模块安装情况。
cd /usr/local/freeswitch/mod
ll
-rwxr-xr-x. 1 root root 104456 Jul 28 10:47 mod_xml_curl.so
-rwxr-xr-x. 1 root root 1316 Jul 28 10:47 mod_xml_curl.la 检查conf/autoload_configs/modules.conf.xml文件mod_xml_curl模块要放在配置的顶部。 load modulemod_console/
load modulemod_logfile/
load modulemod_xml_curl/ 检查conf/autoload_configs/xml_curl.conf.xml文件。 mod_xml_curl模块的主要使用场景。
运行多个FreeSWITCH实例而不必维护多个服务器配置。
集中的配置管理。
从连接到数据库的web应用程序动态填充配置。
提供了一种自动化FreeSWITCH配置部署的简单方法例如托管VoIP平台。 mod_xml_curl的工作原理与典型的API一样向web应用程序发送POST请求获取XML格式的响应消息并刷新本地配置。 mod_xml_curl从web接口获取到有效响应则直接加载配置如果收到无效响应或404则尝试从本地磁盘查找配置文件。 mod_xml_curl模块可以分为4个不同的绑定章节基本可以覆盖全部的xml配置项。
configuration配置项比如mod_sofia的配置。
directory用户鉴权目录。
dialplan拨号计划。
phrases语音短语管理。
测试
修改conf/autoload_configs/xml_curl.conf.xml文件。
configuration namexml_curl.conf descriptioncURL XML Gateway bindings binding namedialplan param namegateway-url valuehttp://10.55.55.137:8080/fs/dialplan bindingsdialplan/ /binding /bindings
/configuration 启动fs检查启动日志如下。
…
2023-07-28 11:56:24.029966 [NOTICE] mod_xml_curl.c:543 Binding [dialplan] XML Fetch Function [http://10.55.55.137:8080/fs/dialplan] [dialplan]
2023-07-28 11:56:24.029979 [ERR] mod_xml_curl.c:459 Binding has no url!
2023-07-28 11:56:24.029994 [CONSOLE] switch_loadable_module.c:1540 Successfully Loaded [mod_xml_curl]
2023-07-28 11:56:24.030003 [NOTICE] switch_loadable_module.c:338 Adding API Function xml_curl
… 发起呼叫使用10011呼叫13712345678日志如下。
2023-07-28 15:22:15.918548 [INFO] mod_dialplan_xml.c:637 Processing 10011 10011-13712345678 in context public
2023-07-28 15:22:15.918548 [ERR] mod_xml_curl.c:315 Received HTTP error 403 trying to fetch http://10.55.55.137:8080/fs/dialplan
data: [hostnamelocalhost.localdomainsectiondialplantag_namekey_namekey_valueEvent-NameREQUEST_PARAMSCore-UUID54544416-2d17-11ee-87f0-0d9ab89b9404FreeSWITCH-Hostnamelocalhost.localdomain…
Dialplan: sofia/external/1001110.55.55.138 parsing [public-test] continuefalse
Dialplan: sofia/external/1001110.55.55.138 Regex (PASS) [test] destination_number(13712345678) ~ /^(\d)$/ breakon-false
Dialplan: sofia/external/1001110.55.55.138 Action answer()
从日志可以看出呼叫流程中首先使用“mod_xml_curl”模块获取“http://10.55.55.137:8080/fs/dialplan”的值获取失败则使用本地dialplan继续呼叫流程。 总结
mod_xml_curl模块功能较复杂涉及流程较多同时需要web服务器提供数据接口配合。
后续尝试使用接口返回dialplan数据动态控制呼叫流程。 空空如常
求真得真