สวัสดีครับ วันก่อนผมมีปัญหาเกี่ยวกับ one way audio ซึ่งดูเหมือนว่าเป็นปัญหายอดฮิตเสียจริงๆ และก็พบว่าต้นเหตุนั้นมาจากเรื่อง NAT นั่นเอง
ผมมีข้อสงสัยว่า
ปัจจุบัน Asterisk ยังมีปัญหาเรื่อง NAT อยู่หรือเปล่าครับ?เนื่องจากมีการแนะนำให้ใช้ nat=yes
อ้างอิงจากhttp://www.voip-info.org/wiki-Asterisk+sip+natIf you set nat=yes for a client ( SIP UA ) that is BEHIND a NAT, Network address translator, device, Asterisk will somehow change the behaviour, adressing etc, of communication with the UA to make communication possible. What really happens is not very well documented, except in the source code (maybe...).
http://www.freepbx.org/support/documentation/administration-guide/adding-extensionsnat: yes or never. SIP is a nat-unfriendly protocol in that it specifies the return IP address for the call audio stream deep inside a packet. NAT works by rewriting packet source and destination IP addresses, but doesn't understand SIP (unless a good SIP Application Layer Gateway is installed). NAT is therefore problem if both the phone and the server PBX are separated from the public internet by different NATs (e.g. a home router and and corporate one.) In such a situation, audio won't work, but signaling will (phones will ring but no audio). To support remote home users behind conventional NATs, use yes, and either give the server PBX a public IP address or do a 1:1 IP mapping from a public IP to it's internal, then set IP_nat.conf to the public IP address of the system. NAT=yes instructs Asterisk to send audio to the IP it receives it from, regardless of what the SIP SDP says, and lets you have at least one NAT present and still have effective audio. Note that NATs vary widely as to how long they stay 'open'. Best practice when using Non-STUN phones is to have SIP registration expire every 60 seconds – the re-registration (outbound, by the phone) will keep the NAT open to receive calls. NAT=yes doesn't hurt anything when the client device is on the same LAN.
สรุปได้ว่า ปัญหาเรื่อง NAT เราสามารถแก้ปัญหาโดยเลือกใช้วิธี -
1. กำหนด nat=yes
2. ใช้ STUNผมเข้าใจถูกต้องไหมครับ?ระหว่าง NAT=yes และ STUN แตกต่างกันอย่างไร มีข้อดีข้อเสียอย่างไรครับ?