<p>Can you try replacing the IF condition  in the snippet you pasted above with:</p>

<pre><code>if(get_to(msg)->tag_value.s==NULL || get_to(msg)->tag_value.len==0) {
</code></pre>

<p>then re-compile, install and test?</p>

<p>I will look deeper when I get a chance, but for the moment it might be an workaround to get you going.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/issues/276#issuecomment-128692310">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZXKQt9B0veV4McB5NbsP4NLXz-8Zks5olKGEgaJpZM4Fm-Td.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/276#issuecomment-128692310"></link>
    <meta itemprop="name" content="View Issue"></meta>
  </div>
  <meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>