freeswitch+freeswitch+语音网关拨打电话

说明

架构

语音网关部署在内网环境,在外网环境中的freeswitch-cloud不能直接调用到语音网关。在内网环境中再部署一台freeswitch用于转发

graph LR freeswitch-cloud --> freeswitch-local --> 语音网关

配置描述

  • 1、语音网关开放552241、552242、552243三个电话线路
  • 2、freeswitch-local注册使用这三个电话线路拨打电话
  • 3、后面的配置都在freeswitch-local中

gateway配置

/usr/local/freeswitch/conf/sip_profiles/external分别配置gw1、gw2、gw3

xml 复制代码
<!-- gw2、gw3类似只是username和password不一样 -->
<gateway name="gw1"> 
    <param name="realm" value="123.34.54.233:5060"/>
    <param name="username" value="552241"/>
    <param name="password" value="552241"/>
    <param name="register" value="true" /> 
    <param name="register-transport" value="udp"/>
</gateway>

问题一:三条电话线路只有一条可以注册成功

现象查看

bash 复制代码
# fs_cli控制台执行,只有一个gateway能够成功
sofia status

排查

  • 1、MicroSIP都能同时注册成功
  • 2、通过抓包,发现Via: SIP/2.0/UDP 122.44.22.44:56068存在端口不同

解决

如下图:修改/usr/local/freeswitch/conf/sip_profilesexternal.xml,并另外复制两份对应gw2、gw3

问题二:拨打的电话并非配置的分机号,而是总台号码

排查

  • 1、使用MicroSIP拨打是分机号
  • 2、使用originate命令拨打时,为总台号码
  • 3、使用抓包工具,对比两个的SIP请求的From头。MicroSIP显示为:From: "552241" <sip:552241@123.34.54.233:5060>,使用originate命令拨打显示为:From: "" <sip:552241@123.34.54.233:5060>

解决

如下:修改/usr/local/freeswitch/conf/dialplanpublic.xml,gw2、gw3配置一致

xml 复制代码
<extension name="out_gw1">
    <condition field="destination_number" expression="^(\d+)$">
       <action application="set" data="effective_caller_id_number=552241"/>
       <action application="set" data="effective_caller_id_name=552241"/>
       <action application="set" data="caller_id_number=552241"/>
       <action application="bridge" data="sofia/gateway/gw1/${desttination_number}"/>
    </condition>
</extension>

修改拨号计划的这三个配置,在originate sofia/gateway/gw1/17847331832这种命令中应该如何写?

相关推荐
金銀銅鐵19 小时前
用 Tkinter 实现一个罗马数字转整数的简单工具
后端·python
河阿里19 小时前
Spring Boot:整合Quartz集群部署指南
java·spring boot·后端
Hiter_John19 小时前
Golang的变量常量初始化
开发语言·后端·golang
砍材农夫20 小时前
物联网实战:Spring Boot MQTT | 模拟器Paho客户端拆解高性能
java·javascript·spring boot·后端·物联网·struts
逍遥德21 小时前
Java编程高频的“技术点”-03:“下划线命名”参数,后端用“驼峰命名“接收
java·后端·springboot
copyer_xyf21 小时前
Python 内存分析:从栈和堆理解对象引用
前端·后端·python
金銀銅鐵1 天前
用 Tkinter 实现一个简单的罗马数字转化工具
后端·python
RemainderTime1 天前
Spring Boot脚手架集成 Spring Security实现生产级RBAC鉴权
spring boot·后端·spring
用户2330713074791 天前
对象的一生(上)
后端
爱勇宝1 天前
如何评估 AI 大模型的商业价值?
前端·后端·程序员