Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-03 Thread Benny Amorsen
bilal ghayyad bilmar...@yahoo.com writes:

 My provider has one IP and one port ONLY, I need to send for him the
 calls from different IP's on the same Asterisk machine, how?

You would have to run two instances of Asterisk to achieve that right
now.

1) You can't distinguish on source port (Asterisk will send all SIP
queries from one port, I believe; the alternative is that it will pick
a random port, and that is worse...)

2) You can't distinguish on destination port (your provider only has
one)

3) You can't distinguish on destination IP (your provider only has
one)

So you're down to code modifications or running two Asterisks. Or
switching provider; it sounds pretty broken to me.


/Benny


___
-- 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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-02 Thread David Gibbons
If your provider has two different IP addresses at its endpoint, you could use 
iproute2 (source based routing) with two local source addresses to make sure 
that there is a one-to-one mapping of source address to destination address. 
Then you could have two peer definitions and an address=declaration in each. As 
I think about it, I believe that with iproute2, you could use one provider 
endpoint address and two local addresses in the same manner, without the 
one-to-one mapping...

This seems like the most elegant solution in my mind. And the only one that 
will work reliably... :)

--Dave

snip
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?
/snip

___
-- 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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-02 Thread bilal ghayyad
My provider has one IP and one port ONLY, I need to send for him the calls from 
different IP's on the same Asterisk machine, how?

Regards
Bilal


--- On Mon, 2/2/09, David Gibbons d...@videon-central.com wrote:

 From: David Gibbons d...@videon-central.com
 Subject: RE: [asterisk-users] Sending Calls via SIP trunk from two different 
 IP addresses from same Asterisk Machine
 To: 'bilmar...@yahoo.com' bilmar...@yahoo.com, 'Asterisk Users Mailing 
 List - Non-Commercial Discussion' asterisk-users@lists.digium.com
 Date: Monday, February 2, 2009, 2:16 PM
 If your provider has two different IP addresses at its
 endpoint, you could use iproute2 (source based routing) with
 two local source addresses to make sure that there is a
 one-to-one mapping of source address to destination address.
 Then you could have two peer definitions and an
 address=declaration in each. As I think about it, I believe
 that with iproute2, you could use one provider endpoint
 address and two local addresses in the same manner, without
 the one-to-one mapping...
 
 This seems like the most elegant solution in my mind. And
 the only one that will work reliably... :)
 
 --Dave
 
 snip
 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?
 /snip


  

___
-- 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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-02 Thread Steve Totaro
On Mon, Feb 2, 2009 at 7:53 AM, Steve Howes st...@geekinter.net wrote:

 On 2 Feb 2009, at 09:46, Benny Amorsen wrote:

 Jeff LaCoursiere j...@jeff.net writes:

 Ah, that makes more sense.  Asterisk binding to another IP is not the
 issue, actually, and even running another instance will not do what
 you
 need.  Your problem is that the OS itself will stamp outbound packets
 with the main source IP of the main interface.  Asterisk could be
 modified
 to send packets with specific IP source, but I don't think that
 would be a
 simple change.

 ip route add default via 1.2.3.4 src 1.2.3.8
 ip route add 9.8.7.6 via 1.2.3.4 src 1.2.3.9

 If the special SIP provider is 9.8.7.6, this should make the packets
 to it comes from 1.2.3.9. This only applies if the application does
 not pick a source address itself, but I believe that is true for
 Asterisk.

 We do that on a box or two, appears to work fine.

 S


Yes, this does work.

-- 
Thanks,
Steve Totaro
+18887771888 (Toll Free)
+12409381212 (Cell)
+12024369784 (Skype)

___
-- 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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-02 Thread Benny Amorsen
Jeff LaCoursiere j...@jeff.net writes:

 Ah, that makes more sense.  Asterisk binding to another IP is not the 
 issue, actually, and even running another instance will not do what you 
 need.  Your problem is that the OS itself will stamp outbound packets 
 with the main source IP of the main interface.  Asterisk could be modified 
 to send packets with specific IP source, but I don't think that would be a 
 simple change.

ip route add default via 1.2.3.4 src 1.2.3.8
ip route add 9.8.7.6 via 1.2.3.4 src 1.2.3.9

If the special SIP provider is 9.8.7.6, this should make the packets
to it comes from 1.2.3.9. This only applies if the application does
not pick a source address itself, but I believe that is true for
Asterisk.


/Benny


___
-- 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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-02 Thread bilal ghayyad
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-boun...@lists.digium.com
 [mailto:asterisk-users-
  boun...@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



  

___
-- 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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-02 Thread Steve Howes

On 2 Feb 2009, at 09:46, Benny Amorsen wrote:

 Jeff LaCoursiere j...@jeff.net writes:

 Ah, that makes more sense.  Asterisk binding to another IP is not the
 issue, actually, and even running another instance will not do what  
 you
 need.  Your problem is that the OS itself will stamp outbound packets
 with the main source IP of the main interface.  Asterisk could be  
 modified
 to send packets with specific IP source, but I don't think that  
 would be a
 simple change.

 ip route add default via 1.2.3.4 src 1.2.3.8
 ip route add 9.8.7.6 via 1.2.3.4 src 1.2.3.9

 If the special SIP provider is 9.8.7.6, this should make the packets
 to it comes from 1.2.3.9. This only applies if the application does
 not pick a source address itself, but I believe that is true for
 Asterisk.

We do that on a box or two, appears to work fine.

S

___
-- 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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-02 Thread Tilghman Lesher
On Monday 02 February 2009 12:44:05 pm bilal ghayyad wrote:
 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?

Yes, that is precisely what is intended by this code.  You merely need set
'udpbindaddr' in each PEER definition (not the GENERAL section), and Asterisk
should select the right outgoing IP for each peer.

-- 
Tilghman

___
-- 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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-02 Thread Tilghman Lesher
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

___
-- 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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-02 Thread David Gibbons
Have you tried configuring two peer config files and setting the externip 
parameter in each of them differently to your two public ips?

Dave

-Original Message-
From: bilal ghayyad [mailto:bilmar...@yahoo.com]
Sent: Monday, February 02, 2009 2:32 PM
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'; David Gibbons
Subject: RE: [asterisk-users] Sending Calls via SIP trunk from two different IP 
addresses from same Asterisk Machine

My provider has one IP and one port ONLY, I need to send for him the calls from 
different IP's on the same Asterisk machine, how?

Regards
Bilal


--- On Mon, 2/2/09, David Gibbons d...@videon-central.com wrote:

 From: David Gibbons d...@videon-central.com
 Subject: RE: [asterisk-users] Sending Calls via SIP trunk from two different 
 IP addresses from same Asterisk Machine
 To: 'bilmar...@yahoo.com' bilmar...@yahoo.com, 'Asterisk Users Mailing 
 List - Non-Commercial Discussion' asterisk-users@lists.digium.com
 Date: Monday, February 2, 2009, 2:16 PM
 If your provider has two different IP addresses at its
 endpoint, you could use iproute2 (source based routing) with
 two local source addresses to make sure that there is a
 one-to-one mapping of source address to destination address.
 Then you could have two peer definitions and an
 address=declaration in each. As I think about it, I believe
 that with iproute2, you could use one provider endpoint
 address and two local addresses in the same manner, without
 the one-to-one mapping...

 This seems like the most elegant solution in my mind. And
 the only one that will work reliably... :)

 --Dave

 snip
 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?
 /snip




___
-- 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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-02 Thread bilal ghayyad
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
 tilgh...@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@lists.digium.com
 Message-ID:
 200902021726.32879.tilgh...@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



  

___
-- 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


[asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-01 Thread bilal ghayyad
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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-01 Thread Jeff LaCoursiere

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


___
-- 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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-01 Thread Mike
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.

From their end I get calls to xxx.yyy.zzz.xxx and .xxy and I have no trouble
getting calls, but I can only send calls from my main machine IP address so
I can't control where I am sending calls to.

I am hoping to have this developped somehow (a per SIP peer bindaddr and
bindport), even if it means some bounty.  I can't imagine this being this
difficult, so a few of us who need this putting a couple hundred dollar
would probably do it.

Mike



 -Original Message-
 From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-
 boun...@lists.digium.com] On Behalf Of Jeff LaCoursiere
 Sent: Sunday, February 01, 2009 12:45
 To: bilmar...@yahoo.com; 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
 
 
 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
 
 
 ___
 -- 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


___
-- 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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-01 Thread Tilghman Lesher
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

___
-- 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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-01 Thread bilal ghayyad
OK, if I send for my provider (the destination), it will authenticate based on 
the IP ONLY, this is the provider system. And once authenticated me based on 
that IP, it will give me all the schema related to this account. Sometimes I 
need to use another schema for some calls, I am not able until send for the 
provider from another IP.

Did u get what I need?
Regards
Bilal


--- On Sun, 2/1/09, Jeff LaCoursiere j...@jeff.net wrote:

 From: Jeff LaCoursiere j...@jeff.net
 Subject: Re: [asterisk-users] Sending Calls via SIP trunk from two different 
 IP addresses from same Asterisk Machine
 To: bilmar...@yahoo.com, Asterisk Users Mailing List - Non-Commercial 
 Discussion asterisk-users@lists.digium.com
 Date: Sunday, February 1, 2009, 12:44 PM
 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
 


  

___
-- 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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-01 Thread Mike
Apologies, I tend to give the impression that I am sure changes are easy: I
was merely giving an educated guess as a programmer but not specifically as
an Asterisk or even Linux programmer.  I definitely could be way off in my
evaluation of the work involved.

Regards,

Mike

 -Original Message-
 From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-
 boun...@lists.digium.com] On Behalf Of Tilghman Lesher
 Sent: Sunday, February 01, 2009 14:25
 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 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
 
 ___
 -- 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


___
-- 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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-01 Thread Jeff LaCoursiere

Ah, that makes more sense.  Asterisk binding to another IP is not the 
issue, actually, and even running another instance will not do what you 
need.  Your problem is that the OS itself will stamp outbound packets 
with the main source IP of the main interface.  Asterisk could be modified 
to send packets with specific IP source, but I don't think that would be a 
simple change.

j

On Sun, 1 Feb 2009, bilal ghayyad wrote:

 OK, if I send for my provider (the destination), it will authenticate based 
 on the IP ONLY, this is the provider system. And once authenticated me based 
 on that IP, it will give me all the schema related to this account. Sometimes 
 I need to use another schema for some calls, I am not able until send for the 
 provider from another IP.

 Did u get what I need?
 Regards
 Bilal


 --- On Sun, 2/1/09, Jeff LaCoursiere j...@jeff.net wrote:

 From: Jeff LaCoursiere j...@jeff.net
 Subject: Re: [asterisk-users] Sending Calls via SIP trunk from two different 
 IP addresses from same Asterisk Machine
 To: bilmar...@yahoo.com, Asterisk Users Mailing List - Non-Commercial 
 Discussion asterisk-users@lists.digium.com
 Date: Sunday, February 1, 2009, 12:44 PM
 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






___
-- 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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-01 Thread Mike
At the risk of seeming impolite (I really am not), why not? Isn't Asterisk
able to send packets using another interface using bindaddr?  The problem,
for the two of us, is that bindaddr is Asterisk-wide, and not per-peer.

Mike

 -Original Message-
 From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-
 boun...@lists.digium.com] On Behalf Of Jeff LaCoursiere
 Sent: Sunday, February 01, 2009 14:56
 To: bilal ghayyad
 Cc: 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
 
 
 Ah, that makes more sense.  Asterisk binding to another IP is not the
 issue, actually, and even running another instance will not do what you
 need.  Your problem is that the OS itself will stamp outbound packets
 with the main source IP of the main interface.  Asterisk could be modified
 to send packets with specific IP source, but I don't think that would be a
 simple change.
 
 j
 
 On Sun, 1 Feb 2009, bilal ghayyad wrote:
 
  OK, if I send for my provider (the destination), it will authenticate
 based on the IP ONLY, this is the provider system. And once authenticated
 me based on that IP, it will give me all the schema related to this
 account. Sometimes I need to use another schema for some calls, I am not
 able until send for the provider from another IP.
 
  Did u get what I need?
  Regards
  Bilal
 
 
  --- On Sun, 2/1/09, Jeff LaCoursiere j...@jeff.net wrote:
 
  From: Jeff LaCoursiere j...@jeff.net
  Subject: Re: [asterisk-users] Sending Calls via SIP trunk from two
 different IP addresses from same Asterisk Machine
  To: bilmar...@yahoo.com, Asterisk Users Mailing List - Non-Commercial
 Discussion asterisk-users@lists.digium.com
  Date: Sunday, February 1, 2009, 12:44 PM
  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
 
 
 
 
 
 
 ___
 -- 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


___
-- 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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-01 Thread Geraint Lee
Could you not use some iptables to do this? I don't know the exact command
you'd need but it could work something like...

If the destination port is 5060 and destination ip is xxx then route via the
default ip (so do nothing)
If the destination port is 5061 and destination ip is xxx change the
destination port back to 5060 and set secondary ip as the source?

Just a thought... i'm guessing this would be able to do the job.. not sure
what issues you might run in to by changing 5060 to 5061... but if it came
to it you could try it by using an alternate ip and changing it back.  Who
knows... not sure if i've even read enough to understand the problem :)

Cheers

Geraint

2009/2/1 Mike l...@virtutel.ca

 At the risk of seeming impolite (I really am not), why not? Isn't Asterisk
 able to send packets using another interface using bindaddr?  The problem,
 for the two of us, is that bindaddr is Asterisk-wide, and not per-peer.

 Mike

  -Original Message-
  From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-
  boun...@lists.digium.com] On Behalf Of Jeff LaCoursiere
  Sent: Sunday, February 01, 2009 14:56
  To: bilal ghayyad
  Cc: 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
 
 
  Ah, that makes more sense.  Asterisk binding to another IP is not the
  issue, actually, and even running another instance will not do what you
  need.  Your problem is that the OS itself will stamp outbound packets
  with the main source IP of the main interface.  Asterisk could be
 modified
  to send packets with specific IP source, but I don't think that would be
 a
  simple change.
 
  j
 
  On Sun, 1 Feb 2009, bilal ghayyad wrote:
 
   OK, if I send for my provider (the destination), it will authenticate
  based on the IP ONLY, this is the provider system. And once authenticated
  me based on that IP, it will give me all the schema related to this
  account. Sometimes I need to use another schema for some calls, I am not
  able until send for the provider from another IP.
  
   Did u get what I need?
   Regards
   Bilal
  
  
   --- On Sun, 2/1/09, Jeff LaCoursiere j...@jeff.net wrote:
  
   From: Jeff LaCoursiere j...@jeff.net
   Subject: Re: [asterisk-users] Sending Calls via SIP trunk from two
  different IP addresses from same Asterisk Machine
   To: bilmar...@yahoo.com, Asterisk Users Mailing List -
 Non-Commercial
  Discussion asterisk-users@lists.digium.com
   Date: Sunday, February 1, 2009, 12:44 PM
   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
  
  
  
  
  
 
  ___
  -- Bandwidth and Colocation Provided by http://www.api-digital.com

Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-01 Thread Jeff LaCoursiere

I briefly glanced at the code before responding, and it does seem that if 
you specify a bind address it will use that address when responding.  I 
stick by my comment that the change you want is not exactly simple - 
unless you are very familiar with the 18,000 line chan_sip.c :)  It also 
appears that the bind address is a global in this implementation... so 
some thought would have to go into efficiently representing all the 
possible peer bind addresses in a thread safe manner... and if the change 
is made to this channel it really out to be for all of them.

So a hack is probably possible without too much trouble.  For it to be 
done right is not a simple change.  Sorry for the rambling.

j

On Sun, 1 Feb 2009, Mike wrote:

 At the risk of seeming impolite (I really am not), why not? Isn't Asterisk
 able to send packets using another interface using bindaddr?  The problem,
 for the two of us, is that bindaddr is Asterisk-wide, and not per-peer.

 Mike

 -Original Message-
 From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-
 boun...@lists.digium.com] On Behalf Of Jeff LaCoursiere
 Sent: Sunday, February 01, 2009 14:56
 To: bilal ghayyad
 Cc: 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


 Ah, that makes more sense.  Asterisk binding to another IP is not the
 issue, actually, and even running another instance will not do what you
 need.  Your problem is that the OS itself will stamp outbound packets
 with the main source IP of the main interface.  Asterisk could be modified
 to send packets with specific IP source, but I don't think that would be a
 simple change.

 j

 On Sun, 1 Feb 2009, bilal ghayyad wrote:

 OK, if I send for my provider (the destination), it will authenticate
 based on the IP ONLY, this is the provider system. And once authenticated
 me based on that IP, it will give me all the schema related to this
 account. Sometimes I need to use another schema for some calls, I am not
 able until send for the provider from another IP.

 Did u get what I need?
 Regards
 Bilal


 --- On Sun, 2/1/09, Jeff LaCoursiere j...@jeff.net wrote:

 From: Jeff LaCoursiere j...@jeff.net
 Subject: Re: [asterisk-users] Sending Calls via SIP trunk from two
 different IP addresses from same Asterisk Machine
 To: bilmar...@yahoo.com, Asterisk Users Mailing List - Non-Commercial
 Discussion asterisk-users@lists.digium.com
 Date: Sunday, February 1, 2009, 12:44 PM
 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






 ___
 -- 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

Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-01 Thread Jeff LaCoursiere

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.

j

On Sun, 1 Feb 2009, Geraint Lee wrote:

 Could you not use some iptables to do this? I don't know the exact command
 you'd need but it could work something like...

 If the destination port is 5060 and destination ip is xxx then route via the
 default ip (so do nothing)
 If the destination port is 5061 and destination ip is xxx change the
 destination port back to 5060 and set secondary ip as the source?

 Just a thought... i'm guessing this would be able to do the job.. not sure
 what issues you might run in to by changing 5060 to 5061... but if it came
 to it you could try it by using an alternate ip and changing it back.  Who
 knows... not sure if i've even read enough to understand the problem :)

 Cheers

 Geraint

 2009/2/1 Mike l...@virtutel.ca

 At the risk of seeming impolite (I really am not), why not? Isn't Asterisk
 able to send packets using another interface using bindaddr?  The problem,
 for the two of us, is that bindaddr is Asterisk-wide, and not per-peer.

 Mike

 -Original Message-
 From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-
 boun...@lists.digium.com] On Behalf Of Jeff LaCoursiere
 Sent: Sunday, February 01, 2009 14:56
 To: bilal ghayyad
 Cc: 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


 Ah, that makes more sense.  Asterisk binding to another IP is not the
 issue, actually, and even running another instance will not do what you
 need.  Your problem is that the OS itself will stamp outbound packets
 with the main source IP of the main interface.  Asterisk could be
 modified
 to send packets with specific IP source, but I don't think that would be
 a
 simple change.

 j

 On Sun, 1 Feb 2009, bilal ghayyad wrote:

 OK, if I send for my provider (the destination), it will authenticate
 based on the IP ONLY, this is the provider system. And once authenticated
 me based on that IP, it will give me all the schema related to this
 account. Sometimes I need to use another schema for some calls, I am not
 able until send for the provider from another IP.

 Did u get what I need?
 Regards
 Bilal


 --- On Sun, 2/1/09, Jeff LaCoursiere j...@jeff.net wrote:

 From: Jeff LaCoursiere j...@jeff.net
 Subject: Re: [asterisk-users] Sending Calls via SIP trunk from two
 different IP addresses from same Asterisk Machine
 To: bilmar...@yahoo.com, Asterisk Users Mailing List -
 Non-Commercial
 Discussion asterisk-users@lists.digium.com
 Date: Sunday, February 1, 2009, 12:44 PM
 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

Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-01 Thread Tilghman Lesher
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.

-- 
Tilghman

___
-- 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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-01 Thread Tilghman Lesher
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

___
-- 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


Re: [asterisk-users] Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine

2009-02-01 Thread Mike
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-boun...@lists.digium.com [mailto:asterisk-users-
 boun...@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
 
 ___
 -- 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


___
-- 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