freeswitch 连接外部 SIP Provider
来源:互联网 发布:网络机房 编辑:程序博客网 时间:2024/05/16 03:31
1, 新增 SIP Provider,在 conf/sip_profiles/external 里面增加该配置文件
<!-- sipprovider.xml -->
<include>
<gateway name="sipprovider">
<param name="username" value="user"/>
<param name="password" value="pass"/>
<param name="realm" value="*"/>
<param name="proxy" value="sipprovider_ip_addr"/>
<param name="register" value="true"/>
<param name="expire-seconds" value="600"/>
<param name="ping" value="30" />
<param name="sip-trace" value="true" />
</gateway>
</include>
这个 SIP Provider 要求 REGISTER,另外因为 freeswitch 是透过 NAT 访问,因此设置 30 秒发送 ping。
2, 将这个 SIP Provider 提供的 DID 映射到相应的 extension 上
SIP Profile external.xml 设定了 context 默认为 public,因此我们需要编辑 conf/dialplan/public.xml
<extension name="sipprovider"> <!-- your provider or any name you'd like to call it -->
<condition field="destination_number" expression="xxxxxxx"> <!-- your DID for this gateway-->
<action application="transfer" data="1001 XML default"/>
</condition>
</extension>
备注:
也可以在 directory 里面配置这个 gateway,两种配置的区别可以看看这个连接
http://wiki.freeswitch.org/wiki/Clarification:gateways
<anthm> if you put them in a user tag in your directory you can then tell
#
sofia to manage the whole domain and it will iterate all the users
#
in that domain and reg the gateways
#
<anthm> if you don't need that you can just put them in the sofia conf
What I gather from this is that if you only want certain extensions to be registered with your voip provider when a specific user registers with freeswitch you should define gateways in the directory section rather than in the sofia configuration. Conversely, if you always want an extension registered with a provider you would define the gateway as part of the sip profile.
3, 设定 extensions 可以通过这个 SIP Provider 拨打 PSTN 电话
conf/dialplan/default.xml
<extension name="Long Distance">
<condition field="destination_number" expression="^00(/d+)$">
<action application="set" data="effective_caller_id_number=xxxxxxxx"/>
<!-- If your provider does not provide ringback (180 or 183) you may simulate
ringback by uncommenting the following line. -->
<!-- action application="ringback" /-->
<action application="bridge" data="sofia/gateway/sipprovider/1550$1"/>
</condition>
</extension>
注意:应该将新增的配置放置在下面信息以前
<!--
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
Anything you put below this line will usually get ignored due to the file in
default/99999_enum.xml as it will transfer the call to the enum dialplan.
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
-->
- freeswitch 连接外部 SIP Provider
- freeswitch 连接外部 SIP Provider
- Freeswitch连接SIP电话
- FreeSwitch Sip
- FreeSwitch Sip
- FreeSWITCH sip
- freeswitch sip 用户
- SIP 与 freeSwitch
- FreeSwitch sip 基本原理
- freeswitch sip trunk
- FreeSWITCH SIP 模块
- SIP Provider Examples
- freeswitch 内核之sip 模块
- FreeSwitch SIP基本原理和流程
- freeswitch 内核之sip 模块
- freeswitch通过sip对接28181
- 《FreeSWITCH: VoIP实战》:SIP 协议
- 《FreeSWITCH: VoIP实战》:SIP 模块
- Integrating Jersey and Spring
- jQuery 之 选择器总结(下篇)
- TCC7901中断占用总结
- 选择语句
- OpenGL VBO顶点缓冲的使用
- freeswitch 连接外部 SIP Provider
- 买你们天眼2代算倒霉了。下个文件多哪
- 几种常用排序算法总结
- lighttpd 再体验
- dll和ocx的区别
- PHP扩展C++
- CuteEditor配置
- 回来了
- directShow的安装