<div>Firstly, how about putting logging in the Loose route section to check for a) when it is entered b) if/when this particular R-URI enters the Loose route section (making sure you print out the R-URI using pseudo-variable just to be sure it is the right one).
</div>
<div>&nbsp;</div>
<div>Secondly, what about other sections of the script. Typically you would have things like <strong>if (uri == myself)</strong> in which case the <strong>if (uri != myself)</strong> might probably be handling other logic for when this condition is not true - perhaps not in this case though since you are using 
<strong>if (is_uri_host_local())</strong>.</div>
<div>&nbsp;</div>
<div>Thirdly,&nbsp;could it be something you are doing&nbsp;the main routing section as is does not appear in the script excerpt provided? (i.e. the bit where you actually t_relay() to the destination.)<br>&nbsp;</div>
<div>Finally is it possible the user has configured their device to use your OpenSER server as an outbound proxy? This may explain if/why the INVITE is being routed through the Loose route section (assuming it is).</div>

<div>&nbsp;</div>
<div><br><br>&nbsp;</div>
<div><span class="gmail_quote">On 15/06/07, <b class="gmail_sendername">Andreas Sikkema</b> &lt;<a href="mailto:andreas.sikkema@bbeyond.nl">andreas.sikkema@bbeyond.nl</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Klaus,<br><br>&gt; Maybe someone sent a SIP message with the local IP address in<br>&gt; the R-URI<br>&gt; to your proxy. According to your config this should not matter as you
<br>&gt; rewrite the domain for every incoming SIP request - except<br>&gt; for loose-route.<br><br>The IP address in the Request-URI is one that for some reason<br>(incorrect configuration?) is being sent by the SIP UA. This IP
<br>address is NOT the same machine as OpenSER...<br><br>The loose_route block could indeed be the culprit here. Is there a<br>way I can see in an INVITE being sent to OpenSER that loose_route() will<br><br>return true?<br>
<br>This is the (sanitized) INVITE that is causing the problems:<br><br>INVITE sip:[NUMBER]@[WRONG_IP_ADDRES] SIP/2.0<br>Call-ID: 6181509477cc0df82db6313a276492d5@[SIP_DOMAIN]<br>From: &lt;sip:[USERNAME]@[IPADDRESS_PROXY]:[PROXYPORT]&gt;;tag=45fa8
<br>To: &quot;[NUMBER]&quot; &lt;sip:[NUMBER]@[SIP_DOMAIN]&gt;;tag=as52bb63c2<br>CSeq: 101 INVITE<br>Via: SIP/2.0/UDP<br><a href="http://10.1.2.71:5060">10.1.2.71:5060</a>;branch=z9hG4bK-45a33f186083645f5232ca79048af818<br>
Contact: &quot;[USERNAME]&quot; &lt;sip:[USERNAME]@<a href="http://10.1.2.71:5060">10.1.2.71:5060</a>&gt;<br>Max-Forwards: 70<br>Route: &lt;sip:[IPADDRESS_PROXY]:[PROXYPORT];lr&gt;<br>User-Agent: [USER_AGENT]<br>Supported: timer
<br>Content-Type: application/sdp<br>Content-Length: 151<br><br>(I&#39;ve removed the body of the message; it&#39;s not very interesting here)<br><br>The problem is that the Request-URI contains [WRONG_IP_ADDRESS]. When<br>
this<br>OpenSER receives an INVITE it should never forward the INVITE to an IP<br>address a SIP UA has added to the Request-URI. OpenSER should be the one<br><br>to decide this.<br><br>So far we&#39;ve never had any issues in this area, so I don&#39;t want to
<br>change<br>too much in the config (like removing the whole loose_route() stuff)<br>unless that is the only way I can solve this problem.<br><br>If the Request-URI would have been correct, [NUMBER] would have been<br>rewritten to something usefull and the call would have succeeded.
<br><br>&gt; For loose-route I would suggest to check for a to-tag too. Then, the<br>&gt; called SIP UA should reject the call. You could also use<br>&gt; dialog module<br>&gt; to see if a dialog exists before forwarding in loose_route.
<br><br>How would checking for a to_tag help? There is no existing Ddialog; this<br><br>is handling the initial INVITE message where it already goes wrong...<br><br>--<br>Andreas Sikkema&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BBeyond<br>
Software Engineer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Planeetbaan 4<br>+31 (0)23 7074342&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2132 HZ Hoofddorp<br><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@openser.org">Users@openser.org
</a><br><a href="http://openser.org/cgi-bin/mailman/listinfo/users">http://openser.org/cgi-bin/mailman/listinfo/users</a><br></blockquote></div><br>