专注三网融合之接入网/核心网等技术,音视频信令和媒体传输相关协议,关注前沿技术 专家前辈入驻,谈笑有鸿儒,往来无白丁,共同学习探讨IMS/IPPBX相关技术
欢迎同行加入IMS/IPPBX/VoIP/SIP QQ交流群:255404741(猛戳直接加群)
查看freeswitch 默认sip trunk配置,即所谓的default_provider
freeswitch@internal> sofia status profile
Profile::Gateway-Name Data State IB Calls(F/T) OB Calls(F/T)
=================================================================================================
external::example.com sip:joeuser@example.com NOREG 0/0 0/0
=================================================================================================
1 gateway: Inbound(Failed/Total): 0/0,Outbound(Failed/Total):0/0
freeswitch@internal>
[root@localhost conf]# find . ! -wholename "*.svn*" | xargs grep -n --color=auto "example.com"
./dialplan/default/01_example.com.xml:3: <extension name="local.example.com">
./dialplan/default/01_example.com.xml:12: <extension name="domestic.example.com">
./dialplan/default/01_example.com.xml:21: <extension name="international.example.com">
./dialplan/default.xml:336: This extension is used by mod_portaudio so you can pa call sip:someone@example.com
./autoload_configs/erlang_event.conf.xml:8: eg. freeswitch@example or freeswitch@example.com.
./vars.xml:262: These are for conf/directory/default/example.com.xml
./vars.xml:264: <X-PRE-PROCESS cmd="set" data="default_provider=example.com"/>
./vars.xml:267: <X-PRE-PROCESS cmd="set" data="default_provider_from_domain=example.com"/>
[root@localhost conf]#
注册到freeswitch的internal内部终端之间显然可以互相拨打,比如公司内部话机可以互相通话。但公司内部话机要想主动跟外部话机通话怎么办?这是就需要进过公司软交换中心跟external外部建立通信链路,而软交换中心跟external外部建立得通信链路可以是SIP或者PSTN的运营商网络链接。Freeswitch引入所谓网关概念来处理与外部链接问题,这种链路一般称之为Trunk,故对应的有SIP Trunk和PSTN Trunk。
在Freeswitch中配置在系统启动时注册到另一个sip服务器(即配置文件中所谓的gateway),此时Freeswitch作为一个sip client,跟其下面SIP终端注册到freeswitch是一样的。跟SIP终端一样,配置注册到网关需要用户名,密码,以及要注册到的sip服务器ip地址和端口等参数。
注册到网关的相关配置保存在目录/conf/sofia_profiles/external,/usr/local/freeswitch/conf/sip_profiles/external.xml为freeswitch作为客户端注册到另一个网关的全局配置,/usr/local/freeswitch/conf/sip_profiles/external/目录下可以添加多个网关。
sip trunk注册配置
添加注册到imclub.com的sip server上,增加imsclub.com_sip_trunk.xml内容
/usr/local/freeswitch/conf/sip_profiles/external/imsclub.com_sip_trunk.xml
Reload XML [Success]
restarting: external
2014-05-25 18:12:36.992758 [INFO] mod_enum.c:876 ENUM Reloaded
2014-05-25 18:12:36.992758 [INFO] switch_time.c:1191 Timezone reloaded 530 definitions
2014-05-25 18:12:37.192751 [NOTICE] sofia_reg.c:135 UN-Registering imsclub.com
2014-05-25 18:12:38.192755 [NOTICE] sofia.c:2682 Waiting for worker thread
2014-05-25 18:12:38.192755 [INFO] switch_core_sqldb.c:1495 sofia:external Destroying SQL queue.
2014-05-25 18:12:38.392750 [INFO] switch_core_sqldb.c:1439 sofia:external Stopping SQL thread.
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:2737 Write lock external
2014-05-25 18:12:38.392750 [NOTICE] sofia_glue.c:6034 deleted gateway example.com from profile external
2014-05-25 18:12:38.392750 [NOTICE] sofia_glue.c:6034 deleted gateway imsclub.com from profile external
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:2749 Write unlock external
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:3725 debug [0]
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:3725 sip-trace [no]
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:3725 sip-capture [no]
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:3725 rfc2833-pt [101]
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:3725 sip-port [5080]
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:3725 dialplan [XML]
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:3725 context [public]
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:3725 dtmf-duration [2000]
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:3725 inbound-codec-prefs [G722,PCMU,PCMA,GSM]
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:3725 outbound-codec-prefs [PCMU,PCMA,GSM]
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:3725 hold-music [local_stream://moh]
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:3725 rtp-timer-name [soft]
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:3725 local-network-acl [localnet.auto]
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:3725 manage-presence [false]
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:3725 inbound-codec-negotiation [generous]
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:3725 nonce-ttl [60]
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:3725 auth-calls [false]
2014-05-25 18:12:38.392750 [DEBUG] sofia.c:3725 inbound-late-negotiation [true]
2014-05-25 1