<p>Happened with 1.11.3, but the relevant code seems to be the same even in the master branch.</p>

<p>According to the docs of loose_route:</p>

<ol>
<li>If the request in inside a dialog ( has a to-tag ), loose-routing was used ($ru is end-point) and Route contains only the local proxy, the function returns FALSE.</li>
</ol>

<p>But it returns true in this case. The suspicious code is in loose.c/after_loose(), which contains:</p>

<pre><code>    LM_DBG("No next URI found!\n");
    status = (preloaded ? NOT_RR_DRIVEN : RR_DRIVEN);
</code></pre>

<p>Within a dialog "preloaded" is false, so this sets the return status to RR_DRIVEN, which is true. The expected return value is false, since the forwarding in this case is not based on Route-s, but on the RURI.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/issues/550">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOciRwpzrCsKW2NurixyPlGDSLtC_rGks5oSFWzgaJpZM4E-lVK.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/OpenSIPS/opensips/issues/550"></link>
    <meta itemprop="name" content="View Issue"></meta>
  </div>
  <meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>