freeswitch与各种设备对接的成功配置,需要的请参考,有错误的地方请指导。
1、对接华为softco
中继配置
\sip_profiles\external\
<include> <gateway name="softco5816"> <param name="proxy" value="172.16.100.248:5060"/> <param name="realm" value="172.16.100.248"/> <param name="register" value="false"/> <param name="rtp-autofix-timing" value="false"/> <param name="caller-id-in-from" value="true"/> <param name="from-domain" value="huawei"/> </gateway> </include>
拨号规则
出局
\conf\dialplan\default\
<include> <extension name="to5816"> <condition field="destination_number" expression="^9(\d+)$"> --加拨9至softco <action application="bridge" data="sofia/gateway/softco5816/$1"/> </condition> </extension> </include>
softco侧配置对端SIP端口为5080
2、对接网络电话提供商
中继配置
\sip_profiles\external\
<include> <gateway name="sip_isp"> <param name="username" value="username"/> <param name="password" value="password"/> <param name="realm" value="sip.isp.com"/> <param name="from-domain" value="sip.isp.com"/> </gateway> </include>
拨号规则
\conf\dialplan\default\
<include> <extension name="sip_isp_outbound"> <condition field="destination_number" expression="^(1\d{10})$"> <action application="bridge" data="sofia/gateway/sip_isp/$1"/> </condition> </extension> </include>
3、深圳电信IMS对接
中继配置
\sip_profiles\external\
<include> <gateway name="gd_ims"> <param name="username" value="+8675512345678"/> <param name="from-user" value="+8675512345678"/> <param name="realm" value="116.31.226.17"/> <param name="auth-username" value="[email protected]cims.cn"/> <param name="proxy" value="gd.ctcims.cn"/> <param name="from-domain" value="gd.ctcims.cn"/> <param name="register-proxy" value="116.31.226.17"/> <param name="outbound-proxy" value="bac01.sz.gd.ctcims.cn"/> <param name="password" value="password"/> <param name="register" value="true"/> <param name="expire-seconds" value="3600"/> <param name="retry-seconds" value="30"/> <param name="ping" value="25"/> <param name="context" value="public"/> <param name="sip-ip" value="$${local_ip_v4}"/> </gateway> </include>
<!-- realm:域名 --> <!-- username:认证的用户名 --> <!-- password:认证的密码 --> <!-- from-user:指定在SIP消息中的源用户信息,没有配置则默认和username相同 --> <!-- from-domain:是指定域,它们会影响SIP中的“From”头域。 --> <!-- regitster-proxy:表示注册的地址 --> <!-- outbound-proxy:表示呼出时指向的地址,这里其实和注册地址是一致的 --> <!-- register:是否注册 --> <!-- expire-seconds:注册的间隔时间 -->
拨号规则
出局
\conf\dialplan\default\
<include> <extension name="gd_ims_out"> <condition field="destination_number" expression="^9(\d+)$"> <!-- 加9出局 --> <action application="export" data="nolocal:execute_on_answer=start_dtmf"/> <!-- 解决不能二次拨号 ,在openwrt可能导致不能呼出--> <action application="set" data="effective_caller_id_number=+8675512345678"/><!-- 主叫号码 --> <action application="set" data="effective_caller_id_name=eSpace7950"/> <!-- 主叫设备名 --> <action application="bridge" data="sofia/gateway/gd_ims/[email protected]"/> <!-- 在openwrt需要添加“@目的IP(域名可能不行)”--> </condition> </extension> </include>
拨号规则
入局
\conf\dialplan\public\
<include> <extension name="ims_in_1"> <!-- 转接不成功转语音信箱 --> <condition field="destination_number" expression="8675512345678$"> <action application="set" data="call_timeout=30"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="continue_on_fail=true"/> <action application="transfer" data="1002 XML default"/> <action application="answer"/> <action application="sleep" data="1000"/> <action application="bridge" data="loopback/app=voicemail:default ${domain_name} 1002"/> </condition> </extension> </include>
4、对接华为UAP6600
中继配置
\sip_profiles\external\
<include> <gateway name="TO_UAP6600_trunk"> <param name="username" value="sf-tech"/> <param name="realm" value="10.202.57.1"/> <param name="proxy" value="10.202.57.1:5060"/> <param name="from-domain" value="10.202.90.18"/> <!--本地IP/域 --> <param name="register" value="false"/> <param name="expire-seconds" value="3600"/> <param name="retry-seconds" value="30"/> <param name="context" value="public"/> </gateway> </include>
拨号规则
出局
\conf\dialplan\default\
<include> <extension name="TO_UAP6600_trunk_OUT"> <condition field="destination_number" expression="^9(\d+)$"> <!-- 加9出局 --> <action application="set" data="sip_h_X-accountcode=${accountcode}"/> <action application="set" data="call_direction=outbound"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="effective_caller_id_name=${caller_id_name}"/> <!-- 主叫设备名 --> <action application="set" data="effective_caller_id_number=${caller_id_number}"/> <!-- 主叫号码 --> <action application="set" data="inherit_codec=true"/> <action application="set" data="ignore_display_updates=true"/> <action application="set" data="callee_id_number=$1"/> <action application="set" data="continue_on_fail=true"/> <action application="set" data="dtmf_type=info"/> <!-- 解决不能二次拨号--> <action application="export" data="nolocal:execute_on_answer=start_dtmf"/> <!-- 解决不能二次拨号--> <action application="bridge" data="sofia/gateway/TO_UAP6600_trunk/$1"/> <!-- --> </condition> </extension> </include>
时间: 2024-11-08 18:54:44