Well hold on a sec..<br><br>First of all, the TO field is irrelevant. So whatever RURI you have (that's the top line INVITE URI), that's where we're sending the call to next. If the below invite hits asterisk it should be delivered to 111610. If that's not right, you need to set your $rU to whatever you want it to be delivered to.<br>
<br>Per the docs, the function you are using updates the RURI:<br><a href="http://www.opensips.org/html/docs/modules/1.7.x/alias_db.html#id250076">http://www.opensips.org/html/docs/modules/1.7.x/alias_db.html#id250076</a><br>
<br>Are you suggesting asterisk is routing on the TO header? This happens with some buggy SIP clients from time to time, but I wouldn't expect this in Asterisk. <br><br>The "To" Header really shouldn't be considered for routing. That being said, there are a handful of UAs out there that insist on doing so. I think they are pre-3261 typically but this isn't confirmed.<br>
-Brett<br><br><br><div class="gmail_quote">On Tue, Oct 16, 2012 at 11:05 PM, Mike O'Connor <span dir="ltr"><<a href="mailto:mike@oeg.com.au" target="_blank">mike@oeg.com.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hi All<br>
<br>
I've had a system setup for a long time, but one issue has always
been there and its come to a head.<br>
<br>
I've always has problems with Asterisk not correctly selecting the
call route for inbound DID's because the INVITE sent to it via my
core (openSIPs) has the 'service number' not the DID in the INVITE.<br>
<br>
As per below<br>
<pre style="line-height:normal;text-indent:0px;letter-spacing:normal;text-align:start;font-variant:normal;text-transform:none;font-style:normal;font-size:13px;font-weight:normal;word-spacing:0px">INVITE <a>sip:111610@150.10.10.10:49640</a> SIP/2.0
Record-Route: <a><sip:202.11.11.11;lr=on;ftag=1ca96a43-co774-INS001;did=781.c6890334></a>
Via: SIP/2.0/UDP 202.11.11.11;branch=z9hG4bK2ad4.58ca31d3.0
Via: SIP/2.0/UDP 202.13.13.13:5060;branch=z9hG4bK1ca53b72111cfdd3INV1ca96a43306
Max-Forwards: 34
Contact: <a><sip:0882229300@202.13.13.13:5060></a>
To: <a><sip:0883622272@202.11.11.11;user=phone></a>
From: "0882229300"<a><sip:0882229300@202.13.13.13;user=phone;noa=national></a>;tag=1ca96a43-co774-INS001
Call-ID: 6f75-572-026197035530-IMG01-0-27.34.224.68
CSeq: 77401 INVITE
Allow: INVITE,ACK,CANCEL,BYE,REFER,OPTIONS,NOTIFY,SUBSCRIBE,PRACK,INFO
Content-Type: application/sdp
Date: Wed, 17 Oct 2012 03:09:42 GMT
User-Agent: ENSR3.0.66.21-IS1-RMRG109-RG2100-CPO46
Content-Length: 309
On an inbound call from our wholesale supplier I run a command alias_db_lookup which I think changes the DID the service number.
if (is_method("INVITE")) {
...
...
...
if(alias_db_lookup("dbaliases","d")) {
...
...
}
</pre>
I'm moved to supplying a commercially support Asterisk install for
our customers and they (the commercial asterisk company) are saying
that this rewrite is not correct and the INVITE should look like
this.<br>
<br>
<pre style="line-height:normal;text-indent:0px;letter-spacing:normal;text-align:start;font-variant:normal;text-transform:none;font-style:normal;font-size:13px;font-weight:normal;word-spacing:0px">INVITE <a>sip:0883622272@150.10.10.10:49640</a> SIP/2.0
Any idea on how I might correct this ?
What should the above INVITE really look like ?
Thanks
Mike
</pre>
</div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br>