<p>Hi,</p>

<pre><code>route {
   if(!route(NEXT_HOP)) {
      ......
   }
   while(!t_relay("2")) {
      if(!route(NEXT_HOP)) {
         send_reply("500", "Error");
         exit;
      }
   }
}

route[NEXT_HOP] {
   ............
   t_on_branch("branch_changes");
   ............
}
</code></pre>

<p>As you can see, the route block NEXT_HOP computes the next hop and arms a branch route for processing specific to the selected next hop. When t_relay is called, the branch route is executed but may be dropped (using drop() ) if some condition is met. In case the branch is dropped, t_relay returns an error and the next hop is computed again. If no next hop is found, a reply is returned. However, I get the following errors when the reply is returned:</p>

<pre><code>CRITICAL:tm:w_t_reply: unsupported route_type (8)
ERROR:signaling:sig_send_reply_mod: failed to send reply with tm module
</code></pre>

<p>t_reply can't be called from a branch route. I expected the global variable route_type to be set back to REQUEST_ROUTE but it is not the case.</p>

<p>Is it a bug?</p>

<p>Thanks,<br>
Mickael</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/365">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/5479561__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyOTMzMzcxMywiZGF0YSI6eyJpZCI6NDYyMzY0MzJ9fQ==--685994334256e307c166581a3a099bcb1d5ef25e.gif" width="1" /></p>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"View this Issue on GitHub","action":{"@type":"ViewAction","url":"https://github.com/OpenSIPS/opensips/issues/365","name":"View Issue"}}</script>