我运行的是 Asterisk 16 安装和基于 SIP.js 的 WebPhone。不幸的是,我经常在呼叫某人的前几秒钟听不到声音。但来电时一切正常。
Asterisk 位于数据中心,浏览器/客户端位于 NAT 后面。
日志(查看第 11 秒至第 13 秒之间的延迟)
[Nov 2 17:58:11] VERBOSE[15217][C-00000002] app_dial.c: PJSIP/hativ-voip-00000003 answered PJSIP/hativ-00000002
[Nov 2 17:58:11] VERBOSE[15226][C-00000002] bridge_channel.c: Channel PJSIP/hativ-voip-00000003 joined 'simple_bridge' basic-bridge <80f71862-7910-4363-97e4-8d8a9e98765f>
[Nov 2 17:58:11] VERBOSE[15217][C-00000002] bridge_channel.c: Channel PJSIP/hativ-00000002 joined 'simple_bridge' basic-bridge <80f71862-7910-4363-97e4-8d8a9e98765f>
[Nov 2 17:58:13] VERBOSE[15217][C-00000002] res_rtp_asterisk.c: 0x7f05cc0773a0 -- Strict RTP qualifying stream type: audio
[Nov 2 17:58:13] VERBOSE[15217][C-00000002] res_rtp_asterisk.c: 0x7f05cc0773a0 -- Strict RTP switching source address to 91.67.195.16:58920
[Nov 2 17:58:13] VERBOSE[15217][C-00000002] res_rtp_asterisk.c: 0x7f05cc0773a0 -- Strict RTP learning complete - Locking on source address 91.67.195.16:58920
[Nov 2 17:58:13] VERBOSE[15226][C-00000002] res_rtp_asterisk.c: 0x7f05cc0860d0 -- Strict RTP switching to RTP target address 212.117.203.158:32406 as source
[Nov 2 17:58:13] VERBOSE[15226][C-00000002] res_rtp_asterisk.c: 0x7f05cc0860d0 -- Strict RTP learning complete - Locking on source address 212.117.203.158:32406
Asterisk 账户的端点配置(用于连接 Asterisk):
type=endpoint
dtls_ca_file=/etc/asterisk/certificates/chain.pem
dtls_cert_file=/etc/asterisk/certificates/cert.pem
dtls_private_key=/etc/asterisk/certificates/privkey.pem
direct_media=no
force_rport=yes
rtp_ipv6=yes
rtp_symmetric=yes
; Sets dtls_setup=actpass, dtls_verify=fingerprint, ice_support=yes, media_encryption=dtls, media_use_received_transport=yes, rtcp_mux=yes, use_avpf=yes
webrtc=yes
disallow=all
allow=opus
allow=alaw
allow=ulaw
SIP 帐户的端点配置(用于连接 SIP 提供商):
type=endpoint
context=incoming
dtmf_mode=rfc4733
force_rport=yes
language=de
rewrite_contact=yes
rtp_symmetric=yes
timers=yes
from_domain=example.com
disallow=all
allow=alaw
有人知道是什么原因导致了延迟吗?
答案1
尝试删除带内进展sip.conf 上的 Asterisks 端点上的 183:
进度条=从不
这将不会发送 183 并避免没有证书交换的 RTP 环。