<p>The headers parsed after cloning can be detected and cleaned up, the code should be like:</p>

<pre><code>       for( hdr=req->headers ; hdr ; hdr=hdr->next ) {
               if ( hdr->parsed && hdr_allocs_parse(hdr) &&
               (hdr->parsed<(void*)t->uas.request ||
               hdr->parsed>=(void*)t->uas.end_request)) {
                       /* header parsed filed doesn't point inside uas.request 
                        * chunck -> it was added by resolving acc attributes ->
                       DBG("removing hdr->parsed %d\n", hdr->type);
                       clean_hdr_field(hdr);
                       hdr->parsed = 0;
               }
       }
</code></pre>

<p>Something similar is done in tm after running failure_route.</p>

<p>I think From is cloned if parsed before cloning.</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/pull/59#issuecomment-72197919">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZX0ForPTnC83CwxueI-5ewQGdtpRks5nm3lwgaJpZM4DY1s8.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/pull/59#issuecomment-72197919"></link>
    <meta itemprop="name" content="View Pull Request"></meta>
  </div>
  <meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>