[asterisk-tech] IAX2 source ports

Garth van Sittert garth at bitco.co.za
Mon Oct 29 12:42:35 SAST 2007

I have 3 extenal Asterisk servers linked via IAX2 trunks to a single 
Asterisk server behind a netgear DG834 ADSL router with port forwarding 
UDP 4569 to the internal server.  When the external servers register 
with the internal server everything is ok for a good few hours.  After 
this period, some of the trunks go down and doing a tcpdump shows that 
the ADSL router is rewriting the source ports on the UDP packets which 
is standard for nat but the external Asterisk servers don't register 
with the internal server.  When the trunks are good, there is no 
rewriting of source ports done on the IAX packets... ie  4569 <=>  4569.

Whether the DG834 does full cone NAT, Restricted cone NAT, Port 
restricted cone NAT or Symmetric NAT I cannot confirm. Anyone else 
know?  The IAX2 trunking is fine if you have only one site registered at 
a time.  I have also checked the UDP NAT on the DG834 only expires after 
60 minutes.

The reason that softphones don't have this issue (as far as I can see) 
is that they use a random source port to connect to asterisk on 4569.

My other option is to have each site listening on a different port and 
specify the destination port on the register line and trunk definition 
in iax.conf, but this deviates from standard and seems messy.

I have tried without registrations, with registrations, with an IAX 
entry for each way a call initiation is made, a single shared definition 
but without success.

Anyone come across this before?  I can't see how the DG834 could simply 
become confused so easily.


Garth van Sittert
BSc (Physics & Computer Science)
Main:	08600 BITCO
Phone:  +27 (0)11 875 6900
Fax:	+27 (0)11 875 6901
Mobile: +27 (0)83 791 6662
Email:  garth at bitco.co.za
MSN:	garthvs at hotmail.com
Web:    www.bitco.co.za

Peter Retief wrote:
> Garth
> In iax.conf, you can set:
> bindport=4569
> This is the port that Asterisk will listen to, and should not generally be
> changed.
> Unless you have two Asterisk servers behind the NAT router (so that you
> cannot forward all incoming IAX traffic to one server), I don't see why you
> should change this.
> Asterisk can simultaneously set up trunks to many different destinations
> from the single IAX 4569 port, as the destination IP addresses all differ.
> Does the issue arise when you have multiple IAX connections between the same
> two endpoint IP addresses (i.e. two Natted routers)?  Can you not avoid this
> by grouping them in a trunk?
> Peter
> -----Original Message-----
> From: Garth van Sittert [mailto:garth at bitco.co.za] 
> Sent: Monday, 29 October, 2007 10:44
> To: Asterisk Tech
> Subject: [asterisk-tech] IAX2 source ports
> Hi All
> Does anyone know if you can set the source port that Asterisk uses to 
> initiate IAX2 channels / trunks.  I know by default it uses 4569 for 
> it's source and destination ports.  I am having an issue at a site that 
> has multiple IAX2 trunks into it via ADSL. The ADSL router natting seems 
> to get a bit confused after a while trying to match up all the ports.
> Garth
> _______________________________________________
> asterisk tech mailing list
> tech at asterisk.org.za http://www.asterisk.org.za/mailman/listinfo/tech
> _______________________________________________
> asterisk tech mailing list
> tech at asterisk.org.za
> http://www.asterisk.org.za/mailman/listinfo/tech

More information about the tech mailing list