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...<br><br>If the destination port is 5060 and destination ip is xxx then route via the default ip (so do nothing)<br>
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?<br><br>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 :)<br>
<br>Cheers<br><br>Geraint<br><br><div class="gmail_quote">2009/2/1 Mike <span dir="ltr"><<a href="mailto:list@virtutel.ca">list@virtutel.ca</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
At the risk of seeming impolite (I really am not), why not? Isn't Asterisk<br>
able to send packets using another interface using bindaddr? The problem,<br>
for the two of us, is that bindaddr is Asterisk-wide, and not per-peer.<br>
<div class="Ih2E3d"><br>
Mike<br>
<br>
> -----Original Message-----<br>
> From: <a href="mailto:asterisk-users-bounces@lists.digium.com">asterisk-users-bounces@lists.digium.com</a> [mailto:<a href="mailto:asterisk-users-">asterisk-users-</a><br>
</div><div><div></div><div class="Wj3C7c">> <a href="mailto:bounces@lists.digium.com">bounces@lists.digium.com</a>] On Behalf Of Jeff LaCoursiere<br>
> Sent: Sunday, February 01, 2009 14:56<br>
> To: bilal ghayyad<br>
> Cc: Asterisk Users Mailing List - Non-Commercial Discussion<br>
> Subject: Re: [asterisk-users] Sending Calls via SIP trunk from two<br>
> different IP addresses from same Asterisk Machine<br>
><br>
><br>
> Ah, that makes more sense. Asterisk binding to another IP is not the<br>
> issue, actually, and even running another instance will not do what you<br>
> need. Your problem is that the OS itself will stamp outbound packets<br>
> with the main source IP of the main interface. Asterisk could be modified<br>
> to send packets with specific IP source, but I don't think that would be a<br>
> simple change.<br>
><br>
> j<br>
><br>
> On Sun, 1 Feb 2009, bilal ghayyad wrote:<br>
><br>
> > OK, if I send for my provider (the destination), it will authenticate<br>
> based on the IP ONLY, this is the provider system. And once authenticated<br>
> me based on that IP, it will give me all the schema related to this<br>
> account. Sometimes I need to use another schema for some calls, I am not<br>
> able until send for the provider from another IP.<br>
> ><br>
> > Did u get what I need?<br>
> > Regards<br>
> > Bilal<br>
> ><br>
> ><br>
> > --- On Sun, 2/1/09, Jeff LaCoursiere <<a href="mailto:jeff@jeff.net">jeff@jeff.net</a>> wrote:<br>
> ><br>
> >> From: Jeff LaCoursiere <<a href="mailto:jeff@jeff.net">jeff@jeff.net</a>><br>
> >> Subject: Re: [asterisk-users] Sending Calls via SIP trunk from two<br>
> different IP addresses from same Asterisk Machine<br>
> >> To: <a href="mailto:bilmar_gh@yahoo.com">bilmar_gh@yahoo.com</a>, "Asterisk Users Mailing List - Non-Commercial<br>
> Discussion" <<a href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a>><br>
> >> Date: Sunday, February 1, 2009, 12:44 PM<br>
> >> I am confused as to what you are trying to accomplish. Can<br>
> >> you be more specific? It seems that you are making this too<br>
> >> complicated. You say that the remote end is providing you<br>
> >> two SIP trunks that will come from the same IP address. To<br>
> >> distinguish them simply have them authenticate with two<br>
> >> different usernames.<br>
> >><br>
> >> This does beg the question, though, if the endpoint is the<br>
> >> same, why have a separate trunk? How about routing the<br>
> >> calls based on differing CID?<br>
> >><br>
> >> If you can explain the situation more distinctly perhaps an<br>
> >> alternate method will present itself. Hard to imagine a<br>
> >> real need for binding to multiple local IP addresses on the<br>
> >> asterisk side.<br>
> >><br>
> >> If you are REALLY stuck on doing it that way, however, how<br>
> >> about simply running a second instance of asterisk? You<br>
> >> would have to recompile the source to read config from a<br>
> >> second tree, but then your second instance could bind to<br>
> >> your aliased address. I suppose you could even trunk the<br>
> >> two together if the two instances must pass traffic between<br>
> >> each other.<br>
> >><br>
> >> How odd :)<br>
> >><br>
> >> j<br>
> >><br>
> >><br>
> >><br>
> >> On Sun, 1 Feb 2009, bilal ghayyad wrote:<br>
> >><br>
> >>> Hi All;<br>
> >>><br>
> >>> I can assign for my Asterisk Machine a two IP<br>
> >> addresses (xxx.xxx.xxx.yyy and xxx.xxx.xxx.yyz), how can I<br>
> >> use these two IP's so I can let one call sent with a<br>
> >> source IP address xxx.xxx.xxx.yyy and another call to be<br>
> >> sent with another source IP address xxx.xxx.xxx.yyz, I need<br>
> >> this because I need the side to authorize my calls by the IP<br>
> >> address, and some calls to be authorized with the first IP<br>
> >> address and other calls to be authorized with another IP<br>
> >> address, ofcourse I have some reason for this.<br>
> >>><br>
> >>> The idea is: how to control the source IP address that<br>
> >> I am sending from it to the other side?<br>
> >>><br>
> >>> Can I determine the source IP address of the SIP trunk<br>
> >> while I am configuing my SIP section for that connection?<br>
> >> What about the bindaddress?<br>
> >>><br>
> >>> Any help?<br>
> >>> Regards<br>
> >>> Bilal<br>
> >>><br>
> >>><br>
> >>><br>
> >>><br>
> >>> _______________________________________________<br>
> >>> -- Bandwidth and Colocation Provided by<br>
> >> <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
> >>><br>
> >>> asterisk-users mailing list<br>
> >>> To UNSUBSCRIBE or update options visit:<br>
> >>><br>
> >> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
> >>><br>
> ><br>
> ><br>
> ><br>
> ><br>
><br>
> _______________________________________________<br>
> -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
><br>
> asterisk-users mailing list<br>
> To UNSUBSCRIBE or update options visit:<br>
> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
<br>
<br>
_______________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</div></div></blockquote></div><br>