<p>You need msg_apply_changes() for each operation that alters a SIP header, if you do another operation that is going to alter same part. Changes to headers are not applied immediately:</p>

<ul>
<li><a href="http://www.kamailio.org/wiki/tutorials/faq/main#why_changes_made_to_headers_or">http://www.kamailio.org/wiki/tutorials/faq/main#why_changes_made_to_headers_or</a></li>
</ul>

<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/428#issuecomment-162013783">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZRfCHbqLpxwD9IlUOvkuUdqfxAXSks5pMbgxgaJpZM4Gusuw.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/428#issuecomment-162013783"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>