Difference between revisions of "Two SIP listening ports for single Asterisk"

From Kolmisoft Wiki
Jump to navigationJump to search
m
Line 7: Line 7:
This example redirects UPD port 5062 to port 5060, which effectively allows Asterisk to listen on both of them.
This example redirects UPD port 5062 to port 5060, which effectively allows Asterisk to listen on both of them.


Remember to save the rule so that it survives a reboot:
Remember to save the rule so that it would survive a reboot:


  /etc/init.d/iptables save
  /etc/init.d/iptables save


From: http://lists.digium.com/pipermail/asterisk-users/2008-November/221970.html
From: http://lists.digium.com/pipermail/asterisk-users/2008-November/221970.html

Revision as of 06:44, 17 October 2011

There is no way to make a single instance of Asterisk listen on multiple ports. However, you can use an iptables REDIRECT to achieve the same functionality.

To redirect a single port with iptables:

 iptables -t nat -A PREROUTING -i eth0 -p udp --dport 5062 -j REDIRECT --to-ports 5060

This example redirects UPD port 5062 to port 5060, which effectively allows Asterisk to listen on both of them.

Remember to save the rule so that it would survive a reboot:

/etc/init.d/iptables save

From: http://lists.digium.com/pipermail/asterisk-users/2008-November/221970.html