<p>I'm currently trying to use the B2B refer scenario (from the tutorial) for inbound calls. After advice from <a href="https://github.com/bogdan-iancu" class="user-mention">@bogdan-iancu</a> on the user mailing list I fixed the natted SDP issue I was having, but now I've broken the ability to send calls to voicemail.</p>

<p>Previously I was using the same method as in the residential script under menuconfig: changing the destination and relaying in the <code>failure_route</code> if status was 486 or 408.</p>

<p>This however does not work in the B2B reply route when set. Two issues I've found.</p>

<p>1) Can't use <code>ds_select_domain</code> due to an error about the URI being wrong (it's using the status code for some reason)</p>

<pre><code>Sep 23 12:08:06 [42508] DBG:dispatcher:w_ds_select: ds_select: 2 4 1000 1 1
Sep 23 12:08:06 [42508] DBG:dispatcher:ds_select_dst: set [2], using alg [4], size [1], used size [1], active size [1]
Sep 23 12:08:06 [42508] DBG:dispatcher:ds_select_dst: hash [0], candidate [0], weight sum [100]
Sep 23 12:08:06 [42508] DBG:dispatcher:ds_select_dst: candidate is [0]
Sep 23 12:08:06 [42508] DBG:dispatcher:ds_select_dst: using destination [0]
Sep 23 12:08:06 [42508] ERROR:core:parse_uri: uri too short: &lt;486&gt; (3)
Sep 23 12:08:06 [42508] ERROR:core:do_action: bad uri &lt;486&gt;, dropping packet
Sep 23 12:08:06 [42508] ERROR:dispatcher:ds_update_dst: error while setting host
Sep 23 12:08:06 [42508] ERROR:dispatcher:ds_select_dst: cannot set dst addr
</code></pre>

<p>2) If the address is manually provided instead, the <code>t_relay</code> fails next:</p>

<pre><code>Sep 23 12:46:17 [43981] CRITICAL:tm:w_t_relay: unsupported route type: 4
</code></pre>

<p>Route type 4 being an <code>onreply_route</code>.</p>

<p>I have a sneaking suspicion that the first problem is also due to using <code>ds_select_dst</code> in an <code>onreply_route</code>, as it's not listed as a supported route type.</p>

<p>Would it be difficult to add a <code>script_failure_route</code> parameter to <code>b2b_entities</code> to handle this situation? I don't see how voicemail could work with a B2B scenario otherwise.</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/647">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOcibkQY7hCvjAfMCFjCbkmhO9sKvKnks5o0vx1gaJpZM4GCo3v.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/647"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>