<p>Hey <a href="https://github.com/miconda" class="user-mention">@miconda</a>,</p>

<p>Yes, calling it in CANCEL block. More complete script would be like this:</p>

<pre><code>if (is_method("CANCEL")) {
                if($hdr(Reason)=="SIP;cause=487;text=ORIGINATOR_CANCEL") t_set_no_e2e_cancel_reason(1);
                if (t_check_trans()) route(RELAY);
                exit;
        }
</code></pre>

<p>Putting a xlog there shows that the CANCEL matches properly there but no change in reason (cannot be deactivated).</p>

<p>Ta,<br>
DanB</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/261#issuecomment-125491931">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZQDbU8WiS9NXKM2qvzSb5jvmz9Ljks5ohy7TgaJpZM4FeeF3.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/261#issuecomment-125491931"></link>
    <meta itemprop="name" content="View Issue"></meta>
  </div>
  <meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>