bilal ghayyad
2009-Feb-01 17:32 UTC
[asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine
Hi All; I can assign for my Asterisk Machine a two IP addresses (xxx.xxx.xxx.yyy and xxx.xxx.xxx.yyz), how can I use these two IP's so I can let one call sent with a source IP address xxx.xxx.xxx.yyy and another call to be sent with another source IP address xxx.xxx.xxx.yyz, I need this because I need the side to authorize my calls by the IP address, and some calls to be authorized with the first IP address and other calls to be authorized with another IP address, ofcourse I have some reason for this. The idea is: how to control the source IP address that I am sending from it to the other side? Can I determine the source IP address of the SIP trunk while I am configuing my SIP section for that connection? What about the bindaddress? Any help? Regards Bilal
Jeff LaCoursiere
2009-Feb-01 17:44 UTC
[asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine
I am confused as to what you are trying to accomplish. Can you be more specific? It seems that you are making this too complicated. You say that the remote end is providing you two SIP trunks that will come from the same IP address. To distinguish them simply have them authenticate with two different usernames. This does beg the question, though, if the endpoint is the same, why have a separate trunk? How about routing the calls based on differing CID? If you can explain the situation more distinctly perhaps an alternate method will present itself. Hard to imagine a real need for binding to multiple local IP addresses on the asterisk side. If you are REALLY stuck on doing it that way, however, how about simply running a second instance of asterisk? You would have to recompile the source to read config from a second tree, but then your second instance could bind to your aliased address. I suppose you could even trunk the two together if the two instances must pass traffic between each other. How odd :) j On Sun, 1 Feb 2009, bilal ghayyad wrote:> Hi All; > > I can assign for my Asterisk Machine a two IP addresses (xxx.xxx.xxx.yyy and xxx.xxx.xxx.yyz), how can I use these two IP's so I can let one call sent with a source IP address xxx.xxx.xxx.yyy and another call to be sent with another source IP address xxx.xxx.xxx.yyz, I need this because I need the side to authorize my calls by the IP address, and some calls to be authorized with the first IP address and other calls to be authorized with another IP address, ofcourse I have some reason for this. > > The idea is: how to control the source IP address that I am sending from it to the other side? > > Can I determine the source IP address of the SIP trunk while I am configuing my SIP section for that connection? What about the bindaddress? > > Any help? > Regards > Bilal > > > > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
Mike
2009-Feb-01 18:26 UTC
[asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine
I have the same issue, I was just asking about that. My main SIP PRI provider identifies me from my IP address, but I have two separate PRIs (different rate centers) with them.
Tilghman Lesher
2009-Feb-01 19:24 UTC
[asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine
On Sunday 01 February 2009 11:32:51 bilal ghayyad wrote:> I can assign for my Asterisk Machine a two IP addresses (xxx.xxx.xxx.yyy > and xxx.xxx.xxx.yyz), how can I use these two IP's so I can let one call > sent with a source IP address xxx.xxx.xxx.yyy and another call to be sent > with another source IP address xxx.xxx.xxx.yyz, I need this because I need > the side to authorize my calls by the IP address, and some calls to be > authorized with the first IP address and other calls to be authorized with > another IP address, ofcourse I have some reason for this. > > The idea is: how to control the source IP address that I am sending from it > to the other side? > > Can I determine the source IP address of the SIP trunk while I am > configuing my SIP section for that connection? What about the bindaddress?You cannot. This behavior is not supported, even in trunk. What is currently supported in 1.6.0 and above, however, is responding back on the same IP, if the opposing SIP server started the request. This was necessary to support TCP. It may no longer be that difficult to support specifying a source IP per peer, given the changes necessary to support TCP, but as I have not attempted it, I'll hold off on pronouncing that an easy change. -- Tilghman
bilal ghayyad
2009-Feb-02 18:44 UTC
[asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine
If that code in the below link worked, will I be able to have two SIP (IP Trunk), both send for same destination IP:Port, but from different source IP's? So the destination will authorize me in my two different IP's? Or that code will give me a chance to send from different ports to the destination? Because this does not resolve my problem as my SIP provider is asking to send for fixed IP and fixed port, the can not be changed. Any advise? Regards Bilal ----------------------------> What are the chances that this can get eventually wrapped > in the Asterisk > source? > > If this works, I will definitely consider upgrading to 1.6 > before I > originally planned to. > > Regards, > > Mike > > > -----Original Message----- > > From: asterisk-users-bounces at lists.digium.com > [mailto:asterisk-users- > > bounces at lists.digium.com] On Behalf Of Tilghman Lesher > > Sent: Sunday, February 01, 2009 18:36 > > To: Asterisk Users Mailing List - Non-Commercial > Discussion > > Subject: Re: [asterisk-users] Sending Calls via SIP > trunk from two > > different IP addresses from same Asterisk Machine > > > > 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.dif > > f.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
bilal ghayyad
2009-Feb-03 07:28 UTC
[asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine
This is from one side and from another side really I was interested to know how to configure two peer config files? What there names and how to let asterisk dealing with these two files? ------------------------------> > Message: 19 > Date: Mon, 2 Feb 2009 17:26:32 -0600 > From: Tilghman Lesher > <tilghman at mail.jeffandtilghman.com> > Subject: Re: [asterisk-users] Sending Calls via SIP trunk > from two > different IP addresses from same Asterisk Machine > To: "Asterisk Users Mailing List - Non-Commercial > Discussion" > <asterisk-users at lists.digium.com> > Message-ID: > <200902021726.32879.tilghman at mail.jeffandtilghman.com> > Content-Type: text/plain; charset="iso-8859-1" > > On Monday 02 February 2009 01:39:09 pm David Gibbons wrote: > > Have you tried configuring two peer config files and > setting the externip > > parameter in each of them differently to your two > public ips? > > What's continually shocking to me are people who make > suggestions on a > list when it's clear they have not tried it. The > 'externip' parameter only > applies to the [general] section. It MAY NOT be set per > peer. > > -- > Tilghman