FreeSWITCH使用mod_amqp模块对接Rabbitmq

1、参考资料

https://freeswitch.org/confluence/display/FREESWITCH/mod_amqp

项目地址:
https://github.com/Atoms-Cat/softswitch-gateway
https://gitee.com/atoms-cat/softswitch-gateway

2、安装

# 安装freeswitch mod_amqp模块,源码目录 src/mod/event_handlers/mod_amqp
make && make install

需要准备好 RabbitMQ 环境

3、加载模块配置

<!-- 添加以下配置在 conf/autoload_configs/modules.conf.xml 文件 -->
<load module="mod_amqp"/>

4、配置mod_amqp模块

修改 /usr/local/freeswitch/conf/autoload_configs/amqp.conf.xml

  • 将交换机名称TAP.EventsTAP.Logging的exchange-type参数修改成 fanout
<connections>
     <connection name="primary">
          <param name="hostname" value="192.168.181.130"/>
          <param name="virtualhost" value="/"/>
          <param name="username" value="guest"/>
          <param name="password" value="guest"/>
          <param name="port" value="5672"/>
          <param name="heartbeat" value="0"/>
     </connection>
</connections>
<params>
    <!-- name="exchange-name"  交换机名称分别是:TAP.Events 、TAP.Logging -->
    <!-- 交换机的模式: topic  -->
    <!-- <param name="exchange-type" value="topic"/> -->
    <!-- 交换机的模式: fanout 广播消息  -->
    <param name="exchange-type" value="fanout"/>
    <!-- 需要在Rabbitmq新建命名为`fs.Events`,`fs.Logging`的queues,分别绑定`TAP.Events` 、`TAP.Logging`交换机 -->
</params>
  • 将交换机名称TAP.Commands=的binding_key参数修改成 fs_node_1,binding_key参数需要是freeswitch集群里的唯一标识
<params>
    <param name="exchange-name" value="TAP.Commands"/>
    <!-- binding_key 是 spring boot amqp convertAndSend 方法中的 routingKey 参数-->
    <!-- 参考https://github.com/Atoms-Cat/softswitch-gateway中freeswitch-esl-spring-boot-starter模块,MqListenerTemplate.class -->
    <param name="binding_key" value="fs_node_1"/>
</params>

5、生效mod_amqp模块

# fs_cli
reloadxml
load mod_amqp
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容