<h3>Description</h3>
<p>KEMI onsend_route is not called unless there is a placeholder/dummy routing block.</p>
<pre><code>## without this block, core will never call KEMI->onsend_route
onsend_route {
 ## do nothing
}
</code></pre>
<h3>Troubleshooting</h3>
<h4>Reproduction</h4>
<ol>
<li>
<p>In KEMI create ksr_onsend_route(). Observe that this function is never invoked.</p>
</li>
<li>
<p>Add a route block:</p>
</li>
</ol>
<pre><code>onsend_route {
 ## do nothing
}
</code></pre>
<p>Now observe, that KEMI ksr_onsend_route() is called.</p>
<h4>Debugging Data</h4>
<h4>Log Messages</h4>
<h4>SIP Traffic</h4>
<h3>Possible Solutions</h3>
<p>Not really a problem, just a surprise to the KEMI user. Possibly, document that in order for the KEMI function to be called, the configuration file needs a dummy routing block for onsend_route.</p>
<h3>Additional Information</h3>
<p>The reason is the following logic:<br>
onsend.h:<br>
<code>ret=keng->froute(orig_msg, ONSEND_ROUTE, NULL, NULL);</code></p>
<p>This line is called only if <code>onsend_rt.rlist[DEFAULT_RT]</code> is non-NULL, but this array is initialized only if the <code>onsend_route</code> block exists.</p>
<ul>
<li>
<p><strong>Kamailio Version</strong> - 5.1, master</p>
</li>
<li>
<p><strong>Operating System</strong>:<br>
Linux CentOS 7.4</p>
</li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1474">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZUSVViSIGN3dGanBWW-I8OjPBAG_ks5tb3SugaJpZM4Sf5ed">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZRBXVs-863aMMrqOM3p5mjugB0hdks5tb3SugaJpZM4Sf5ed.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/kamailio/kamailio/issues/1474"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"KEMI onsend_route method is not called (#1474)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1474"}}}</script>