顶顶通呼叫中心中间件(mod_cti基于FreeSWITCH)-sofia(SIP)配置

介绍

配置sofia profile ,这个配置修改后不能实时生效的,需要重启FreeSWITCH,或者通过执行命令相关命令才可以生效。
ops_sip.png

  1. 添加删除sofia profile 需要重启fs,或者执行reload mod_sofia,才生效。
  2. 添加了网关需要执行命令 sofia profile [profilename] rescan
  3. 删除了网关需要执行命令sofia profile [profilename] killgw [gatewayname]
  4. 修改了网关配置需要先执行删除命令sofia profile [profilename] killgw [gatewayname],然后执行 sofia profile [profilename] rescan。
  5. 取消网关注册 sofia profile [profilename] unregister [gatewayname]
  6. 重新注册网关 sofia profile [profilename] register [gatewayname]

通过往redis 通道 config@domain 发送通知,也可以执行命令

{
"type": "cli",
"cmd": "命令",
"arg": "参数,
"response": "执行结果写回的redis通道,如果不需要执行接口,可以设置"
}

配置

cti_sip_profile@domain [哈希表]

  1. key sofia profile 名字
  2. value sofia profole 配置内容
{
"domains": {
"alias": "false",
"parse": "false",
"name": ""
},
"settings": {
"user-agent-string": "ddtswitch",
"debug": "0",
"sip-trace": "no",
"sip-capture": "no",
"dialplan": "XML",
"sip-port": "46729",
"sip-ip": "$${local_ip_v4}",
"rtp-ip": "$${local_ip_v4}",
"ext-sip-ip": "auto-nat",
"ext-rtp-ip": "auto-nat",
"inbound-codec-prefs": "$${global_codec_prefs}",
"outbound-codec-prefs": "$${outbound_codec_prefs}",
"inbound-codec-negotiation": "generous",
"inbound-late-negotiation": "true",
"apply-nat-acl": "nat.auto",
"aggressive-nat-detection": "true",
"NDLB-force-rport": "true",
"rfc2833-pt": "101",
"dtmf-duration": "2000",
"rtp-timer-name": "soft",
"rtp-timeout-sec": "30",
"rtp-hold-timeout-sec": "180",
"challenge-realm": "auto_from",
"auth-calls": "true",
"auth-calls-acl-only": "false",
"log-auth-failures": "true",
"auth-all-packets": "false",
"disable-register": "false",
"inbound-reg-force-matching-username": "true",
"force-register-domain": "$${domain}",
"force-register-db-domain": "$${domain}",
"force-subscription-domain": "$${domain}",
"manage-presence": "false",
"hold-music": "$${hold_music}",
"local-network-acl": "localnet.auto",
"nonce-ttl": "60",
"username": "ddt",
"inbound-zrtp-passthru": "true",
"forward-unsolicited-mwi-notify": "false",
"context": "test",
"outbound-use-uuid-as-callid": "true",
"inbound-use-callid-as-uuid": "true"
},
"gateway": ""
}

这个参数太多了,上面也只列出了部分,就不一一列出,只调几个重要的介绍

  • domains 设置别名和是否解析分机中配置的网关, cti没使用这些特性,直接不配置这个
  • gateway 配置这个sofia 关联的网关,多个网关用逗好隔开
  • settings sofia profile的配置
    • sip-ip 本机SIP IP
    • rtp-ip 本机RTP IP
    • ext-sip-ip 如果通过路由器映射外网可以访问,配置路由器的公网IP
    • ext-rtp-ip 如果通过路由器映射外网可以访问,配置路由器的公网IP
    • sip-port Sip端口
    • inbound-codec-prefs 呼入的声音编码 $${global_codec_prefs} 就是使用vars.xml里面global_codec_prefs 这个的配置
    • outbound-codec-prefs 呼出的的声音编码
    • context 呼入时dialplan的context.
    • outbound-use-uuid-as-callid 呼出时,使用通道的UUID做SIP的callid。
    • inbound-use-callid-as-uuid 呼入时,使用sip的callid做通道的UUID。为了防止通道UUID不是唯一的,可以设置为false。
    • auth-calls 呼入需要认证
    • disable-register 禁止注册
    • log-auth-failures 认证失败信息记录到日志
    • auth-calls-acl-only 只有通过ACL认证的,才可以呼入,分机不能呼入。

建议参考ccadmin程序使用的配置
ccsadmin external的配置 auth-calls:false,disable-register:true,auth-calls-acl-only:false
ccsadmin internal的配置 auth-calls:true,disable-register:false,auth-calls-acl-only:false