Voip-info.org: Asterisk, SIP and NAT
SIP协议,采用5060端口来传递指令,10000-20000传递语音流,所有如果SIP客户端在防火墙或者内网就需要开放相应的端口,来通讯。
From Voip-info.org
On your router NAT/firewall, forward SIP ports 5060 - 5082 and RTP ports 8000 - 20000 to your * server IP address. Then edit the "rtpstart" value in rtp.conf - from rtpstart=10000 to rtpstart=8000 since 8000 is the default RTP port on x-lite phones. Also enter the same externip=xxx.xxx.xxx.xxx and localnet=xxx.xxx.xxx.xxx/xxx.xxx.xxx.xxx info from your sip.conf general settings into sip_nat.conf. Then in sip.conf under the remote extension account authentication settings add nat=yes, canreinvite=no . This should get it working flawlessly, it did it for me after much research and troubleshooting. This should mark the end of NAT/firewall issues with asterisk.
NOTE: Your WAN or externip address from your ISP is usually not permanent so in the case where it changes you will have to edit the "externip=" value in sip.conf general settings and sip_nat.conf to the new value or you can register with dynamic DNS (dyndns) to automaticaly update the value.
IAX2协议指令和媒体流都通过4569端口来传递,穿透能力比较强。
本文详细介绍了SIP协议与IAX2协议在网络电话系统中的应用及配置方法。针对SIP协议,需要设置5060端口用于指令传输,并开放10000-20000端口用于语音流;而IAX2协议则通过单一的4569端口同时传输指令和媒体流。此外,还提供了具体的配置步骤和注意事项。

749

被折叠的 条评论
为什么被折叠?



