<div dir="ltr">Hello,<br><div class="gmail_quote"><div dir="ltr"><div><br><div>Regarding this problem I mentioned in the user list, I found the cause of the problem but I&#39;m not sure about the correct fix.</div><div>Probably this is not the best way to report the problem and correction but right now it is the easiest one for me. Let me know if I need to create a Githu user and open an issue there.</div>

<div><br></div><div>The problem of not being able to remove the Via fields happened because of commit <a href="https://github.com/OpenSIPS/opensips/commit/609c81c8713dd94ab45dbef76599a54dcbee5361" target="_blank">https://github.com/OpenSIPS/opensips/commit/609c81c8713dd94ab45dbef76599a54dcbee5361</a> that inserted:</div>

<div>l=del_lump(msg, hf-&gt;name.s-msg-&gt;buf, hf-&gt;len, <b>hf-&gt;type</b>);<br></div><div>in the place of:</div><div>l=del_lump(msg, hf-&gt;name.s-msg-&gt;buf, hf-&gt;len, <b>0</b>);</div><div>in remove_hf_f() function.</div>

<div><br></div><div>This caused the function free_via_clen_lump() of the TM engine to delete this lump since now it has the type HDR_VIA_T, when previously it had type 0.<br></div><div><br></div><div>It is possible to add a test in free_via_clen_lump to allow the LUMP_DEL operation, so the deletion of Via will work, or to keep the old call to del_lump in the remove_hf functions.</div>

<div>So what&#39;s the best choice? Or I will not be allowed to remove the Via header in any case?</div><div>I think the best solution would be to add a LUMP_DEL test in the free_via_clen_lump(), something like this:</div>

<div><div>                if (lump-&gt;op!=LUMP_DEL &amp;&amp;</div><div>                    (lump-&gt;type==HDR_VIA_T||lump-&gt;type==HDR_CONTENTLENGTH_T)) {</div></div><div><br></div><div>Thanks,<br></div><div><br></div>

<div>Patrick</div><div><div class="h5"><div><br></div><div><br></div><div><br></div><div><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Patrick Wakano</b> <span dir="ltr">&lt;<a href="mailto:pwakano@gmail.com" target="_blank">pwakano@gmail.com</a>&gt;</span><br>

Date: Wed, Jun 18, 2014 at 12:40 PM<br>Subject: Remove_hf not working for Via<br>To: OpenSIPS users mailling list &lt;<a href="mailto:users@lists.opensips.org" target="_blank">users@lists.opensips.org</a>&gt;<br><br><br>
<div dir="ltr">Hello All,<div>
<br></div><div>I am making some tests regarding topology hide for non-invite requests and noticed that since version 1.11.1 the remove_hf function is not working for Via headers. It was working in version 1.10.1, and from what I could track this patch <a href="https://github.com/OpenSIPS/opensips/issues/219" target="_blank">https://github.com/OpenSIPS/opensips/issues/219</a> is causing this problem. So far I haven&#39;t noticed this problem in any other field but Via....</div>


<div>I know I&#39;m not supposed to remove and insert Via headers on my on since it may cause problems, but is this a resctriction the patch was meant to do or a side effect (bug?) of the patch?</div><div><br></div><div>

Thanks,</div>
<div>Patrick</div></div>
</div><br></div></div></div></div></div>
</div><br></div>