i try save the original contact, remove it and append to new one in the kamailio.cfg.
$var(orig_contact) = $(hdr(Contact)[*]);
xlog("L_INFO", "Before removing Contact: $hdr(Contact)\n");
remove_hf("Contact");
xlog("L_INFO", "After removing Contact: $hdr(Contact)\n");
$var(new_contact) = $var(contact) + ";param=value";
append_hf("Contact: $var(new_contact)\r\n");
the kamailio log show the Contact Before/After removing is the same, that means the it not work. Could anyone tell me how to make it?
Official kamailio answer that this is against RFC.
You can change it. But if you are using RTPPROXY or RTPENGINE you have change it AFTER rtpproxy/rtpengine loop, because it takes contact from original message.
So,
fix_nated_contact/add_contact_alias
Will just put it back.
Try without NAT to see that.