1、参考
https://freeswitch.org/confluence/display/FREESWITCH/mod_xml_curl
- 参考项目地址:
https://github.com/Atoms-Cat/softswitch-gateway
https://gitee.com/atoms-cat/softswitch-gateway
2、依赖模块
# 主要依赖
mod_xml_curl
安装模块
# 源码目录 src/mod/xml_int/mod_xml_curl
make && make install
加载模块配置
<!-- 添加以下配置在 conf/autoload_configs/modules.conf.xml 文件 -->
<load module="mod_xml_curl"/>
重启 FreeSWITCH
3、修改mod_xml_curl配置
<!-- conf/autoload_configs/xml_curl.conf.xml -->
<configuration name="xml_curl.conf" description="cURL XML Gateway">
<bindings>
<binding name="all configs">
<!-- 请求地址:http://127.0.0.1/fsapi,是远程提供动态xml 配置的HTTP服务地址 -->
<param name="gateway-url" value="http://127.0.0.1/fsapi" bindings="dialplan|configuration|directory|phrases"/>
<!-- HTTP服务验证的`账号:密码` -->
<param name="gateway-credentials" value="muser:mypass"/>
<param name="method" value="GET"/>
<!-- HTTP服务验证的类型,FreeSWITCH提供`basic, digest, NTLM, GSS-NEGOTIATE` 四种类型 ,可以参考https://github.com/Atoms-Cat/softswitch-gateway的freeswitch-xml-curl模块 -->
<param name="auth-scheme" value="digest"/>
</binding>
</bindings>
</configuration>
请求参数
section: directory、dialplan、configuration
key_value: 配置文件名称
4、动态配置sofia.conf.xml
# 需要fs_cli执行
load mod_sofia