[asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine
Tilghman Lesher
tilghman at mail.jeffandtilghman.com
Sun Feb 1 17:35:55 CST 2009
On Sunday 01 February 2009 15:40:29 Tilghman Lesher wrote:
> On Sunday 01 February 2009 14:39:11 Jeff LaCoursiere wrote:
> > Actually I think that is a good idea. In sip.conf setup the two remote
> > ends on different IPs (one of which is actually bogus). Outbound NAT
> > based on the destination, where you change the source IP to the one
> > expected by the provider, and change the bogus destination to the real
> > one. Inbound NAT back to the base address based on the destination in
> > the reply.
> >
> > Now THAT is a hack.
>
> And it probably won't work. SIP is a known protocol which violates layer
> separation, encoding IP addresses directly into the application layer.
> Unless your firewall were able to DPI and modify the addresses within the
> application layer (which may or may not work, depending on whether Asterisk
> encodes the message with IP addresses or hostnames), then the whole
> exercise is doomed to fail.
>
> One way which does occur to me that will work, if the OP only needed
> exactly 2 different addresses, would be to set the bindaddr and tcpbindaddr
> to different addresses, and send TCP signalling for one peer and UDP
> signalling for the other. Again, this would only work for exactly 2 peers,
> not for more.
>
> The current code uses a separate socket for each of TCP, TLS, and UDP
> connections, so this would be the maximum possible without any code
> changes. One could probably use multiple TCP descriptors without a lot of
> work.
Something like this might work, though:
http://asterisk.drunkcoder.com/patches/20090201__multi_ip_chan_sip_bind.diff.txt
Disclaimer: untested code. Written for trunk. Will definitely not work on
1.4 and may or may not cleanly apply to 1.6.0. However, based upon my
understanding of the code, it's probably very close to what would be needed
to support this.
--
Tilghman
More information about the asterisk-users
mailing list