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