如果用外网注册到sip时,能外呼但是没有声音时的解决方法

如果用外网注册到sip时,能外呼但是没有声音时的解决办法

出现这种办法的原因一般是由于rtp造成的.

可以查看/etc/asterisk/rtp.conf

;
; RTP Configuration
;
[general]
;
; RTP start and RTP end configure start and end addresses
;
; Defaults are rtpstart=5000 and rtpend=31000
;
rtpstart=10000
rtpend=20000
;
; Whether to enable or disable UDP checksums on RTP traffic
;
;rtpchecksums=no
;
; The amount of time a DTMF digit with no 'end' marker should be
; allowed to continue (in 'samples', 1/8000 of a second)
;
;dtmftimeout=3000
; rtcpinterval = 5000   ; Milliseconds between rtcp reports
                        ;(min 500, max 60000, default 5000)

 

可以看到这里的rtp设置了10000至20000的udp端口,所以要将这些端口开放一下.

 

直接编辑 /etc/sysconfig/system-config-securitylevel

然后加入:--port=10000-20000:udp
再执行一下:system-config-securitylevel-tui 以便让其生效,

 

然后再重启一下iptables服务:service iptables restart

问题就可以解决了.