bilal ghayyad
2008-Jul-25 10:53 UTC
[asterisk-users] IAX to work on two ports: 4569 and 4570
Hi All; How to let my Asterisk work able to deal with two kind of IAX channels, one work on 4569 and one work on 4570 and able to receive and send calls on these two UDP ports, depends on the destination. Any advise? Regards Bilal
Tilghman Lesher
2008-Jul-25 13:39 UTC
[asterisk-users] IAX to work on two ports: 4569 and 4570
On Friday 25 July 2008 05:53:38 bilal ghayyad wrote:> How to let my Asterisk work able to deal with two kind of IAX channels, one > work on 4569 and one work on 4570 and able to receive and send calls on > these two UDP ports, depends on the destination.There really isn't any good way. The IAX2 channel will only bind to a single port. You could start a secondary Asterisk server on the same machine and pass traffic through, or you could use firewalling rules to divert from port 4570 to 4569. -- Tilghman
bilal ghayyad
2008-Jul-25 15:58 UTC
[asterisk-users] IAX to work on two ports: 4569 and 4570
The reason that I need to do this is: I will have two Asterisk PBX's, and I need both of them to use same Internet (so both of them will be behind NAT under same DSL router), in that case, how I will distinguish on the router the calls that need to be send for box A and the calls that need to send for box B? Asterisk C will be in remote side, and will communicate with Asterisk A and B, so I was look to have two ports on for IAX to be running on Asterisk C, for example: 4569 and 4570, so when box C need to talk with box A, then it sends via 4569 and when it needs to talk with box B then it sends via 4570 port, and DSL router does the routing based on these ports. Is there any other solution? I do not need to use VPN :) - Regards Bilal ----------------------- Why would you need to to that anyway? Just set them to one port, but use different contexts to handle the inbound traffic differently. Adrian On Friday 25 July 2008 05:53:38 bilal ghayyad wrote:> How to let my Asterisk work able to deal with two kind of IAXchannels, one> work on 4569 and one work on 4570 and able to receive and send callson> these two UDP ports, depends on the destination.There really isn't any good way. The IAX2 channel will only bind to a single port. You could start a secondary Asterisk server on the same machine and pass traffic through, or you could use firewalling rules to divert from port 4570 to 4569. -- Tilghman
bilal ghayyad
2008-Jul-25 22:15 UTC
[asterisk-users] IAX to work on two ports: 4569 and 4570
Again, I did not understand. How the router will know if the call that came from Asterisk Box C need to be routed for Asterisk Box A or Asterisk Box B? Note: Asterisk A and B both behind DSL router, while Asterisk C in remote side, both sides are connected via Internet. Regards Bilal ------------------------------ On Friday 25 July 2008 10:58:28 bilal ghayyad wrote:> The reason that I need to do this is: > > I will have two Asterisk PBX's, and I need both of them to use same > Internet (so both of them will be behind NAT under same DSL router), in > that case, how I will distinguish on the router the calls that need to be > send for box A and the calls that need to send for box B? > > Asterisk C will be in remote side, and will communicate with Asterisk A and > B, so I was look to have two ports on for IAX to be running on Asterisk C, > for example: 4569 and 4570, so when box C need to talk with box A, then it > sends via 4569 and when it needs to talk with box B then it sends via 4570 > port, and DSL router does the routing based on these ports. > > Is there any other solution?Oh, for outbound traffic, you don't need to define other ports. Simply forward port 4570 on your router to port 4569 on Asterisk B. Remember that unlike SIP, IAX2 does not encode the port number into the protocol, so it'll work perfectly fine this way. If you're bound and determined to listen to port 4570 on Asterisk B, you still don't need to listen on two ports on Asterisk C. Just leave off the port number in iax.conf the specification for Asterisk C on box B. Likewise on Asterisk C, define the specification for Asterisk B to use port=4570. There is no need for port numbers to be the same on both machines when talking IAX. -- Tilghman ------------------------------ bilal ghayyad wrote:> The reason that I need to do this is: > > I will have two Asterisk PBX's, and I need both of them to use same Internet (so both of them will be behind NAT under same DSL router), in that case, how I will distinguish on the router the calls that need to be send for box A and the calls that need to send for box B?The calls will be handled based on auth info and/or SOURCE port, which your NAT router would handle just fine. It's similar to how two computers on your network can go to the same web site at the same time. With SIP it CAN be a little more complicated.
Kai-Uwe Jensen
2008-Jul-26 01:32 UTC
[asterisk-users] IAX to work on two ports: 4569 and 4570
On Box C, you define your IAX peers A and B in iax.conf. For your peer "Box A", no special config is needed, it will use the default port 4569. For the configuration entry for Box B, you add a line to the peer definition that reads "port=4570". Box C will then try to reach Box B via port 4570. On your DSL router, any traffic arriving on port 4569 is destined for Box A, anything arriving on port 4570 is for Box B. You will therefore need to set up port forwarding on the router. Incoming traffic on port 4569 (UDP) gets forwarded to Box A, port 4569. Anything arriving on port 4570 you can forward to Box B, port 4569. That will do the trick. On Fri, Jul 25, 2008 at 4:15 PM, bilal ghayyad <bilmar_gh at yahoo.com> wrote:> Again, I did not understand. > > How the router will know if the call that came from Asterisk Box C need to > be routed for Asterisk Box A or Asterisk Box B? > > Note: Asterisk A and B both behind DSL router, while Asterisk C in remote > side, both sides are connected via Internet. >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080725/3c8d3caf/attachment.htm