freeswitch 动态加载号码

本文介绍如何通过HTTP接口实现Freeswitch的动态号码加载,避免系统重启。配置步骤包括启用mod_xml_curl模块和设置xml_curl.conf文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

freeswitch安装完成后默认的是用静态配置文件的方式加载号码本
这对于动态注册的用户,无法实时同步
需要系统reloadxml后号码才能呼入

对于商业系统来说这是无法接受的


动态加载
动态方式其实很简单,开发一个http接口给fs调用
fs发去http请求传参数,接口返回http相应
这样就OK了

下面给出具体配置:
第一步 找到 modules.conf.conf 文件 去掉注释
 <load module="mod_xml_curl"/>


第二步 修改 xml_curl.cong.xml
重点是 http://example1.com:80/fsapi 这个http接口

<configuration name="xml_curl.conf" description="cURL XML Gateway">
<bindings>
<!-- Ask example1.com for a dialplan config, if we get a valid response
then don't continue onto example2.com. However if we don't get a valid
response, then continue onto example2.com
-->
<binding name="dialplan">
<param name="gateway-url" value="http://example1.com:80/fsapi" bindings="dialplan"/>
</binding>

<!-- This will only get called if example1.com returns an invalid or
not found response. If this gateway also fails to return a valid
configuration, then FreeSWITCH will look for the static configuration
file on disk
-->
<binding name="dialplan backup">
<param name="gateway-url" value="http://example2.com:80/fsapi" bindings="dialplan"/>
</binding>

<!-- Ask example1.com for a directory config, if not found then revert
to disk
-->
<binding name="directory">
<param name="gateway-url" value="http://example1:80/fsapi" bindings="directory"/>
</binding>

<!-- Ask example1.com for a configuration config, if not found then revert
to disk
-->
<binding name="configuration">
<param name="gateway-url" value="http://example1:80/fsapi" bindings="configuration"/>
</binding>

<!-- Ask example1.com for a phrases config, if not found then revert
to disk
-->
<binding name="phrases">
<param name="gateway-url" value="http://example1:80/fsapi" bindings="phrases"/>
</binding>
</bindings>
</configuration>


接口的详细规范请参考 http://wiki.freeswitch.org/wiki/Mod_xml_curl
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值