freeswitch与外部网关链接
我建了一个 Freeswitch 内核研究 交流群, 45211986, 欢迎加入, 另外,提供基于SIP的通信服务器及客户端解决方案,
承接 sip/ims 视频客户端开发,支持接入sip软交换,ims核心网,支持 语音,视频,即时通信功能,视频格式支持 h263,h264,mpeg4 软编软解,提供硬件编解码接口对接,提供服务器,有兴趣请联系我。
注册到freeswitch的客户端可以互相拨打,但是当客户端想通过freeswitch呼叫那些并没有注册到freeswitch上的客户端怎么办?这就需要freeswitch与外部网关链接,比如与另一个sip server或者pstn测的运营商网络链接。Freeswitch引入网关概念来处理与外部链接问题。
Freeswitch中配置的网关在系统启动时注册到另一个sip服务器,类似于sip客户端注册到freeswitch。
配置网关通常需要用户名,密码,以及要注册到的sip服务器ip地址。
网关相关配置保存在目录/conf/sofia_profiles/external
/usr/local/freeswitch/conf/sip_profiles/external.xml为freeswitch作为客户端注册到另一个网关的全局配置,
/usr/local/freeswitch/conf/sip_profiles/external/目录下可以添加网关。
比如添加注册到asterisk得网关,/usr/local/freeswitch/conf/sip_profiles/external/reg_to_asterisk.xml
reg_to_asterisk.xml内容:
<include>
<gatewayname="asterisk">
<paramname="username" value="freeswitch"/>
<paramname="password" value="freeswitch"/>
<paramname="realm" value="demo.asterisk.org"/>
<paramname="proxy" value="demo.asterisk.org"/>
</gateway>
</include>
~
保存,控制台重启 sipprofile
freeswitch@openser-dev>sofia profile external restart
2012-08-18 20:21:47.254868[INFO] mod_enum.c:871 ENUM Reloaded
2012-08-18 20:21:47.254868[INFO] switch_time.c:1163 Timezone reloaded 530 definitions
Reload XML [Success]
restarting: external
freeswitch@openser-dev>2012-08-18 20:21:47.295211 [NOTICE] sofia.c:2500 Waiting for worker thread
2012-08-18 20:21:47.956692[NOTICE] sofia_glue.c:5707 deleted gateway example.com from profile external
2012-08-18 20:21:47.956692[NOTICE] sofia.c:5202 Started Profile external [sofia_reg_external]
2012-08-18 20:21:47.984023[NOTICE] sofia_reg.c:2944 Added gateway 'asterisk' to profile 'external'
2012-08-18 20:21:47.984023[NOTICE] sofia_reg.c:2944 Added gateway 'example.com' to profile 'external'
2012-08-18 20:21:49.975233[NOTICE] sofia_reg.c:415 Registering asterisk
freeswitch@openser-dev>
freeswitch@openser-dev>
查看注册状态
freeswitch@internal> sofiastatus
Name Type Data State
=================================================================================================
internal-ipv6 profile sip:mod_sofia@[::1]:5060 RUNNING (0)
internal profile sip:mod_sofia@192.168.16.111:5060 RUNNING (0)
external profile sip:mod_sofia@192.168.16.111:5080 RUNNING (0)
external::example.com gateway sip:joeuser@example.com NOREG
external::asterisk gateway sip:freeswitch@demo.asterisk.org TRYING (retry: NEVER)
192.168.16.111 alias internal ALIASED
=================================================================================================
3 profiles 1 alias
a.通过网关呼出去
需要修改dialplan,在conf/dialplan/default/目录下添加 route_to_asterisk.xml
<include>
<extension name="Dial Out asteriskGateway">
<condition field="destination_number"expression="^9(11)$">
<actionapplication="bridge"data="sofia/gateway/asterisk/$1"/>
</condition>
</extension>
</include>
Fs_cli 执行 reloadxml,客户端呼叫 911,呼叫会路由到asterisk网关上。
b.接收网关送过来的呼叫
通常,对于那些未经认证的呼叫,freeswitch认为是不安全的,包括网关送过来的呼叫,freeswitch会把这类呼叫路由到publicdialplan context中。
/usr/local/freeswitch/conf/dialplan/public.xml为此类呼叫的dialplan,可以在
/usr/local/freeswitch/conf/dialplan/public/目录添加对应网关送过来的dialplan
如:
Vim /usr/local/freeswitch/conf/dialplan/public/asterisk.xml
<include>
<extensionname="asterisk-inbound">
<condition field="destination_number"
expression="^(freeswitch)$">
<actionapplication="set" data="domain_name=$${domain}"/>
<actionapplication="transfer" data="1000 XML default"/>
</condition>
</extension>
</include>
当asterisk送过来的被叫号码为freeswitch注册到asterisk上的用户号时,freeswitch转移到其用户1000。
(3)不需要手动配置网关,但与外部链接
如果外部网关需要diguest认证,则需要在freeswitch上配置网关,如果外部网关并不需要digesut认证,则不需要再freeswitch上手动配置(2)中的过程,有一些网关通过ip验证,这种方式相对更简单,但不如(2)中的安全。
比如default.xmldialplan中的
<actionapplication="bridge"data="sofia/${use_profile}/$1@conference.freeswitch.org"/>
即通过 internalsip profile送到freeswitch.org的网关上。
freeswitch与外部网关链接的更多相关文章
- Excel中如何查找并列出所有链接(外部数据链接)?
在 Excel 中,有时会需要创建外部链接来引用其他工作簿的单元格内容,但是如果想要找出所有链接并且还要将这些外部数据链接列在一个工作簿当中是有点难度的.下面我会介绍一些快捷方法,不仅能够快速帮你找出 ...
- 在Vue文件中引入外部URL链接
前言:最近做一个vueNuxt的项,没有index.html 也没有main.js项目需要引入一些外部的包,没什么技术含量只是一种思路 在vue生命钩子函数中动态创建JavaScript标签追加到HT ...
- OpenERP在product中增加外部网络链接图片
最近的一个项目要求在Product_Template中增加类似与HTML中<img src=”" />的形式的图片 product_img_extra.py from osv i ...
- Excel中外部数据链接无法删除的解决方法【转】
[摘要] 当Excel中公式引用了外部数据,每次打开时,总是自动弹出自动更新链接的对话框.如何找到这些链接?有没有办法实现断开原有链接,而保持数值不变? 有客户反应,当Excel无法链接到外部数据后, ...
- freeswitch 获取当前网关通道数
1.使用show xmlstatus可以获取网关实时负载. 无session 有session
- redis 安装成功后外部服务器链接不上
1.reids服务器的6379端口telnet不通 2. 查看reids进程和端口,都是存在的.只是ip地址是127.0.0.1而不是0.0.0.0,只是本机能使用 3.查找redis的配置文件red ...
- 小程序之web-view打开外部链接
小程序之web-view - 传送门 web-view 组件是一个可以用来承载网页的容器,会自动铺满整个小程序页面.个人类型与海外类型的小程序暂不支持使用. 一:小程序使用web-view打开链接的前 ...
- 个人永久性免费-Excel催化剂功能第70波-工作薄外部链接维护管理
Excel在数据领域万物互联的特性,其中一个使用场景是连接非本工作薄的外部性文件内容,如其他Excel工作薄文件里的内容或直接用OLE对象的方式嵌入一个文件链接,使其在不离开Excel环境,也可提供类 ...
- API 网关
使用 API 网关 链接:https://github.com/oopsguy/microservices-from-design-to-deployment-chinese译者:Oopsguy ...
随机推荐
- Codeforces Gym 100269B Ballot Analyzing Device 模拟题
Ballot Analyzing Device 题目连接: http://codeforces.com/gym/100269/attachments Description Election comm ...
- Codeforces Round #114 (Div. 1) C. Wizards and Numbers 博弈论
C. Wizards and Numbers 题目连接: http://codeforces.com/problemset/problem/167/C Description In some coun ...
- nand flash坏块管理OOB,BBT,ECC
转:http://www.cnblogs.com/elect-fans/archive/2012/05/14/2500643.html 0.NAND的操作管理方式 NAND FLASH的管理方式:以三 ...
- python对于0x01的处理
对于python脚本,可以使用: .replace('\x01', '') 对于vim工具,可以使用: :%s/\%x01/ /g
- Tomcat之内存、并发、缓存方面优化方法
一.Tomcat内存优化 Tomcat内存优化主要是对 tomcat 启动参数优化,我们可以在 tomcat 的启动脚本 catalina.sh 中设置 java_OPTS 参数. JAVA_OPTS ...
- 30分钟LINQ教程【转】
千万别被这个页面的滚动条吓到!!! 我相信你一定能在30分钟之内看完它!!! 在说LINQ之前必须先说说几个重要的C#语言特性 一:与LINQ有关的语言特性 1.隐式类型 (1)源起 在隐式类型出现之 ...
- BS中保存参数
开发中经常需要将值存起来,当点击某一项时以便知道点击了哪一项. 一:应用JS页面跳转(牛腩中讲到) HTML: <td class="txt c"><a href ...
- IE测试CSS兼容性测试
我们知道IE6~8是现在浏览器的主流.但是由IE6开始,我们已经知道IE并不是完全执行W3C标准.我们在编程的时候往往遇到只兼容某一种浏览器. 我们以前经常使用IE Test进行IE的兼容性测试.但是 ...
- zabbix_zatree第三方插件
1.下载zatree第三方插件https://github.com/spide4k/zatree.git 2.检查PHP环境需要支持php-xml.php-gd.php-mysql 3.先备份当前za ...
- Android jni GetFieldID 和 GetMethodID 函数的说明
Android jni GetFieldID 和 GetMethodID 函数的说明 GetFieldID是得到java类中的参数ID,GetMethodID得到java类中方法的ID,它们只能调用类 ...