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