<div dir="ltr"><div>Thanks.</div>
<div>I read option 2 and i agree on 1 :-)</div>
<div>Didnt use any &quot;branch stuff&quot; yet :-(... it seems very logical to do so when i send the call to the NP server.</div>
<div>Will hit the docs...</div>
<div> </div>
<div> </div>
<div>Hi,<br><br>when you are adding the new Contact-Header in Failure-Route (after you<br>received the 3xx reply), you are working on the original message<br>again. So the old Contact is still removed and the new Contact is<br>
added (as for the initial request).<br><br>There are two options for you:<br>1) Move your remove_hf/append_hf into a branch route (so the changes<br>are only for the current branch)<br>2) Use &quot;msg_apply_changes()&quot; before removing and adding the header<br>
again (see <a href="http://kamailio.org/docs/modules/devel/modules/textopsx.html#textopsx.msg_apply_changes">http://kamailio.org/docs/modules/devel/modules/textopsx.html#textopsx.msg_apply_changes</a>)<br><br>I i were you, i&#39;d choose option 1, since for Option 2 the message and<br>
the headers need to be parsed again.... (performance penalty).<br><br>Good luck,<br>Carsten<br><br>2012/3/27 Uri Shacked &lt;<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">ushacked at gmail.com</a>&gt;:<br>
&gt;<i> Hi,<br></i>&gt;<i><br></i>&gt;<i><br></i>&gt;<i><br></i>&gt;<i> In the scenario i am using, the flow is as followed:<br></i>&gt;<i><br></i>&gt;<i> 1. Getting the INVITE from the user<br></i>&gt;<i><br></i>&gt;<i> 2. Sending an INVITE with RURI changes to the NP server (sip NP server)<br>
</i>&gt;<i><br></i>&gt;<i> 3. Getting a 301 reply (using the reply for the NP code)<br></i>&gt;<i><br></i>&gt;<i> 4. Sending the call to the destination.<br></i>&gt;<i><br></i>&gt;<i><br></i>&gt;<i><br></i>&gt;<i> My problem is that the NP server needs some parameters in the contact<br>
</i>&gt;<i> header.<br></i>&gt;<i><br></i>&gt;<i> So, here is what i do :<br></i>&gt;<i><br></i>&gt;<i><br></i>&gt;<i><br></i>&gt;<i> First, before sending the invite to the NP:<br></i>&gt;<i><br></i>&gt;<i><br></i>&gt;<i><br>
</i>&gt;<i> remove_hf(&quot;Contact&quot;);<br></i>&gt;<i><br></i>&gt;<i> append_hf(&quot;Contact<br></i>&gt;<i> :&lt;sip:<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">XXX at server_ip</a>:port;param1=p1;param2=p2&gt;\r\n&quot;,&quot;Contact&quot;);<br>
</i>&gt;<i><br></i>&gt;<i><br></i>&gt;<i><br></i>&gt;<i> (The invite is sent perfectly and works great)<br></i>&gt;<i><br></i>&gt;<i><br></i>&gt;<i><br></i>&gt;<i> After the NP reply i do:<br></i>&gt;<i><br></i>&gt;<i><br>
</i>&gt;<i><br></i>&gt;<i> remove_hf(&quot;Contact&quot;);<br></i>&gt;<i><br></i>&gt;<i> append_hf(&quot;Contact :$ct&quot;,&quot;Contact&quot;);<br></i>&gt;<i><br></i>&gt;<i><br></i>&gt;<i><br></i>&gt;<i> Now I notice there are two contact headers. It seems that the remove_hf<br>
</i>&gt;<i> didn’t work this time.<br></i>&gt;<i><br></i>&gt;<i> Any ideas?<br></i>&gt;<i><br></i>&gt;<i><br></i>&gt;<i><br></i>&gt;<i> Thanks,<br></i>&gt;<i><br></i>&gt;<i> Uri<br></i></div></div>