You need msg_apply_changes() for each operation that alters a SIP header, if you do another operation that is going to alter same part. Changes to headers are not applied immediately:
* http://www.kamailio.org/wiki/tutorials/faq/main#why_changes_made_to_headers_...
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/428#issuecomment-162013783