<div dir="ltr">I'm using chan_sip, I experimented with adding a 'Route' header in the originate command and used the Dial command like 'SIP/peer/exten', but problem<div>is that Request-URI isn't populated correctly.</div><div>I'm using Asterisk 13.</div><div><br></div><div>Thanks,</div><div>Nitesh</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 13, 2016 at 10:09 PM, Joshua Colp <span dir="ltr"><<a href="mailto:jcolp@digium.com" target="_blank">jcolp@digium.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Nitesh Bansal wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
I want to use Asterisk to use Kamailio as an outbound proxy for routing<br>
calls to remote SIP end points, one option could be to use a default<br>
peer, but in my case, my outbound proxy can change<br>
based on the remote end point, so this option doesn't work.<br>
And another problem is that I don't know how to configure Asterisk to<br>
prepare the Request-URI<br>
based on the remote end point and not based on the outbound proxy address?<br>
<br>
What is the best way to do it?<br>
</blockquote>
<br></span>
You'll have to be specific with the channel driver in use. Speaking from chan_pjsip it does not have a mechanism to set the outbound proxy on a per-call basis, it's strictly controlled by the endpoint. You'd need multiple or construct endpoints dynamically (for example using the ARI push configuration). As for not rewriting the request URI you need to use loose routing by specifying ;lr in the outbound proxy URI.<br>
<br>
Example:<br>
<br>
sip:<a href="http://example.com" rel="noreferrer" target="_blank">example.com</a>;lr<br>
<br>
If used in a configuration file:<br>
<br>
sip:<a href="http://example.com" rel="noreferrer" target="_blank">example.com</a>\;lr<br>
<br>
The '\' is so the configuration parser does not treat it as a comment.<br>
<br>
Cheers,<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Joshua Colp<br>
Digium, Inc. | Senior Software Developer<br>
445 Jan Davis Drive NW - Huntsville, AL 35806 - US<br>
Check us out at: <a href="http://www.digium.com" rel="noreferrer" target="_blank">www.digium.com</a> & <a href="http://www.asterisk.org" rel="noreferrer" target="_blank">www.asterisk.org</a><br>
<br>
-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" rel="noreferrer" target="_blank">http://www.asterisk.org/hello</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" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</font></span></blockquote></div><br></div>