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

Geraint Lee geraint at gmail.com
Sun Feb 1 14:24:04 CST 2009


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 <list at 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-bounces at lists.digium.com [mailto:asterisk-users-
> > bounces at 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 <jeff at jeff.net> wrote:
> > >
> > >> From: Jeff LaCoursiere <jeff at jeff.net>
> > >> Subject: Re: [asterisk-users] Sending Calls via SIP trunk from two
> > different IP addresses from same Asterisk Machine
> > >> To: bilmar_gh at yahoo.com, "Asterisk Users Mailing List -
> Non-Commercial
> > Discussion" <asterisk-users at 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090201/80e4c969/attachment.htm 


More information about the asterisk-users mailing list