[Asterisk-Dev] IAX2 Native Transfer + NAT

Rich Adamson radamson at routers.com
Mon Feb 9 07:56:33 MST 2004

> Over the weekend I discovered that IAX2 calls are not able to establish
> native audio bridging when two clients are behind the same NAT screen.  It
> seems that my Linksys router is not smart enough to "pinwheel" packets
> between two clients behind the screen, so all traffic has to go out through
> the router, to the cable provider's router, back to the Asterisk box (on a
> separate routable IP address but on the same cable modem) then back the same
> path to the router and to the destination client.

If I understood your comments correctly, that would be "port address translation"
(or PAT) that got you. Part of the reason for that is IAX uses the exact same 
port number for both source and destination udp ports, therefore the firewall 
can only handle one iax session in its nat/pat tables.

> Would it be possible for chan_iax2 to discern that both parties to a call
> are behind the same NAT screen and using inside IP addresses 192.168.1.X and
> 192.168.1.Y, then direct the clients to communicate on the appropriate ports
> on their "inside" addresses?  Or to try (TXCNT/TXREJ) before forcing the
> conversation to pass through several additional switching/routing points
> (most of which are not TOS-aware)?

That "should" be just a IP routing issue, but I'd have to guess the NAT code 
within asterisk is getting in the way as well. Don't think you can have it
both ways.

More information about the asterisk-dev mailing list