[asterisk-users] Multiple Asterisk Sessions on same machine
Alex Balashov
abalashov at evaristesys.com
Tue Jul 19 13:30:30 CDT 2011
On 07/19/2011 02:25 PM, Jeremy Kister wrote:
> On 7/19/2011 2:07 PM, Michael wrote:
>> We would like Asterisk to listen on port 5060 and on an additional
>> port.
>> From what we read online, it's not really possible, so is it
>> possible to
>
> if you're running iptables, you can set up a pretty simple rule to
> forward your additional port to 5060.
>
> http://www.cyberciti.biz/faq/linux-port-redirection-with-iptables/
>
> remember UDP vs TCP.
I don't think that's going to work, for two reasons:
1) REDIRECT targets are stateless, aren't they?
That would mean that Asterisk would behave as if the request were sent
to 5060, and would, of course, respond from 5060 regardless.
If the redirecting entity were a separate host, an additional SNAT
rule could be applied to fix it in the other direction, too. But
since it's the same host, that would cause all outgoing traffic sent
by Asterisk from 5060 to be mangled, which is not the intended effect.
2) SIP, as a protocol, has the somewhat dubious distinction of
incorporating network and transport-layer reachability information
straight into the message. Since your iptables rule is not SIP-aware,
it would cause any references to IPs and ports used for URI targeting,
etc. to stay constant, and thus sabotage your purpose.
So, for instance, if Asterisk provides a final reply to an INVITE
request with a Contact URI of <sip:abc123 at xxx.xxx.xxx.xxx:5060>, that
is where the external UAC would send sequential requests, not 5061 or
whatever. That's clearly not what you want.
--
Alex Balashov - Principal
Evariste Systems LLC
260 Peachtree Street NW
Suite 2200
Atlanta, GA 30303
Tel: +1-678-954-0670
Fax: +1-404-961-1892
Web: http://www.evaristesys.com/
More information about the asterisk-users
mailing list