Why Iax2 is better than SIP when connecting two Asterisk srever?

what’s the difference between these protocols when establishing the connection between two Asterisk PBX behind NAT?




IAX2 (pronounced eeeeks)is a ‘native’ Asterisk protocol and is more efficient then SIP.

]Signalling and Bearer traffic in same traffic stream
[]Single UDP port (4569), easy to manage security footprint
]Easy NAT traversal, works in almost all NAT environments
[]Simpler configuration
]No interoperability issues

thank you very much! I want to know more about why IAX outweigh SIP when working in the NAT environment.

thank you very much! I want to know more about why IAX outweigh SIP when working in the NAT environment. could you please tell me that?

IAX2 uses a single port for both signaling and voice traffic whereas SIP uses a port for control traffic and a different range of ports for voice traffic.

In a NAT environment and traversing firewalls having to open up only one port is better than having to make sure multiple ports stay open.

Thanks! This is really helpful. Could you please give me some detail information about the thing you mentioned, i could not find the detail process of establishing connection between PBXs with these two protocols. thank you!!

When you say you could not find information. I am curious, where did you look?


Keep in mind with this example, if you want to use g.729 CODEC you need a license.

When I set the dial pattern to be 2xxx, the phones calls could be make successfully. But when I set the dial pattern to be 9|2xxx it will play “all circuits are bussiness now please try again later”. What is the problem?

This is your thread on IAX trunking, not sure what you are talking about.,

Dial pattern on what?

Do you seriously want to change the subject on your own thread?

Sorry, I think i didn’t express myself clearly. At first, I asked how the SIP protocol and Iax protocol establihsh the connection between the two PBXs behind nat. I still want to know the detail process of that. Additionally ,as you send me a link teaching how to use Freepbx to configure the connection, I want to ask you another question: I have use a Iax trunk connected two PBXs and users could make phone calls through them. However, now, I want to add a prefix 9 to distinguish the calls mdae to outside with inside ones. When i change the dial pattern in outbound route using freepbx, from 2xxx to 9|2xxx it cannot work. I want to know why this happens. Thank you!

First, I am not going to teach you in a forum how SIP NAT traversal works. It is quite complicated. It’s just that complication that makes IAX a better protocol.

As I mentioned in previously, IAX uses a single session on a single port to handle signalling and bearer traffic. Essentially it encapsulates it making NAT traversal a non-issue.

I have no idea why your dial plan does not work. If you want to post some log output. What version is FreePBX?

my freepbx version is’m a rookie,please allow me ask a low level question where can i get the log? there seems no error ouucrs. it just says that all circuit is business now, please try again later.

You really need to read up a bit and understand Asterisk architecture. I am going to answer your question, but I don’t think it is going to help you much with background.

Do you know how to navigate directories and such in Linux?

The log is in /var/log/asterisk/full

What is written to the log is set in the Asterisk CLI. In this case we only need dial plan debug. So from Asterisk CLI ‘asterisk -r’ set dialplan verbosity at 10 ‘core set verbose 10’…Then you can tail the file ‘exit’ this will leave CLI and ‘tail -f /var/log/asterisk/full’ this will scroll log on screen.