<div dir="ltr"><div>Thanks.</div>
<div>I read option 2 and i agree on 1 :-)</div>
<div>Didnt use any "branch stuff" 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 "msg_apply_changes()" 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'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 <<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">ushacked at gmail.com</a>>:<br>
><i> Hi,<br></i>><i><br></i>><i><br></i>><i><br></i>><i> In the scenario i am using, the flow is as followed:<br></i>><i><br></i>><i> 1. Getting the INVITE from the user<br></i>><i><br></i>><i> 2. Sending an INVITE with RURI changes to the NP server (sip NP server)<br>
</i>><i><br></i>><i> 3. Getting a 301 reply (using the reply for the NP code)<br></i>><i><br></i>><i> 4. Sending the call to the destination.<br></i>><i><br></i>><i><br></i>><i><br></i>><i> My problem is that the NP server needs some parameters in the contact<br>
</i>><i> header.<br></i>><i><br></i>><i> So, here is what i do :<br></i>><i><br></i>><i><br></i>><i><br></i>><i> First, before sending the invite to the NP:<br></i>><i><br></i>><i><br></i>><i><br>
</i>><i> remove_hf("Contact");<br></i>><i><br></i>><i> append_hf("Contact<br></i>><i> :<sip:<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">XXX at server_ip</a>:port;param1=p1;param2=p2>\r\n","Contact");<br>
</i>><i><br></i>><i><br></i>><i><br></i>><i> (The invite is sent perfectly and works great)<br></i>><i><br></i>><i><br></i>><i><br></i>><i> After the NP reply i do:<br></i>><i><br></i>><i><br>
</i>><i><br></i>><i> remove_hf("Contact");<br></i>><i><br></i>><i> append_hf("Contact :$ct","Contact");<br></i>><i><br></i>><i><br></i>><i><br></i>><i> Now I notice there are two contact headers. It seems that the remove_hf<br>
</i>><i> didn’t work this time.<br></i>><i><br></i>><i> Any ideas?<br></i>><i><br></i>><i><br></i>><i><br></i>><i> Thanks,<br></i>><i><br></i>><i> Uri<br></i></div></div>