[Asterisk-Dev] Multiple ports for SIP listener + minor bug

John Todd jtodd at loligo.com
Fri Jun 6 00:24:44 MST 2003

>On Thu, Jun 05, 2003 at 12:43:45PM -0700, John Todd wrote:
>>  That's not quite what I'm looking for, and I know that I can get the
>>  whole Asterisk process to listen on a different port. I need Asterisk
>>  to listen on multiple ports at the same time.
>>  port=5060,5061,9060
>How about this for a hack:
>get your OS to do port redirection from ports 5061 and 9060 to port 5060.
>You don't need to distinguish between the ports, so asterisk doesn't need
>to know which port they are trying to connect to.

I'm not certain if this is true.  The NAT code within Asterisk will 
look at the source port and the destination port of an inbound SIP 
packet, and send replies out with exactly the opposite information. 
The remote NAT gateways keep state based on outbound/inbound ports of 
packets.  If I used a port redirector on the Asterisk server, would 
Asterisk reply with packets stamped (outbound) with the "real" 
destination port on the Asterisk server, or would they reply with 
5060?   I don't know enough about Linux port mapping tools, but my 
gut instinct is that Asterisk would not know that data, and would 
reply with the wrong port in the outbound packet.  The NAT box would 
reject it, since it would not match it's state table.

My understanding of port redirection is admittedly incomplete, and 
I'm interested to hear about why I'm wrong.  Also, what package would 
you suggest for this redirection?


More information about the asterisk-dev mailing list