chan_sip

  • 是什么?
    • pjsip 之前的 sip 通道实现
    • 功能满足 VoIP
    • 不支持现代化通讯 - WebRTC, Websocket 等

modules.conf

# 自动加载
autoload => yes
# 排除 pjsip
noload => res_pjsip.so
noload => res_pjsip_pubsub.so
noload => res_pjsip_session.so
noload => chan_pjsip.so
noload => res_pjsip_exten_state.so
noload => res_pjsip_log_forwarder.so

命令#

clidesc
sip notifySend a notify packet to a SIP peer
`sip prune realtime [peer [< name >all
sip qualify peerSend an OPTIONS packet to a peer
sip reloadReload SIP configuration
`sip set debug {onoff
`sip set history {onoff}`
`sip show {channelssubscriptions}`
sip show bridgedList all SIP bridges
sip show channelstatsList statistics for active SIP channels
sip show channelShow detailed SIP channel info
sip show domainsList our local SIP domains
sip show historyShow SIP dialog history
sip show inuseList all inuse/limits
sip show mwiShow MWI subscriptions
sip show objectsList all SIP object allocations
sip show peersList defined SIP peers
sip show peerShow details on specific SIP peer
sip show registryList SIP registration status
sip show schedPresent a report on the status of the scheduler queue
sip show settingsShow SIP global settings
sip show tcpList TCP Connections
sip show usersList defined SIP users
sip show userShow details on specific SIP user
sip unregisterUnregister (force expiration) a SIP peer from the registry

sip.conf#

  • configs/samples/sip.conf.sample
  • type=peer
    • 处理呼入呼出, ip/port 匹配
  • type=user
    • 处理呼入 - user 能呼叫 asterisk, asterisk 不能呼叫 user
    • 通过注册信息匹配 - authname, secret
    • 不依赖 IP 信息,不关心 host 设置
  • type=friend
    • 会创建 friend 和 user
  • remotesecret 呼出认证, secret 呼入认证

nat#

confdesc
nat配置 NAT 处理逻辑
qualify=yes保持 NAT 会话开启

Asterisk 不同版本 nat 的选项

asterisknat
>= 1.8no, force_rport, comedia, auto_force_rport, auto_comedia
< 1.8no, yes, never, route

chan_sip nat vs chan_pjsip#

chan_sip/natchan_pjsip/rtp_symmetricchan_pjsip/force_rportchan_pjsip/rewrite_contact
nat=yesrtp_symmetric=yesforce_rport=yesrewrite_contact=yes
nat=nortp_symmetric=noforce_rport=norewrite_contact=no
nat=neverrtp_symmetric=noforce_rport=norewrite_contact=no
nat=routertp_symmetric=noforce_rport=yesrewrite_contact=yes