After some review and search (#1719), it seems that there is "bug" when trying to apply multiple changes at once (at least regarding the display name and URI as well). Since all changes are done in respect to the original message, some consecutive changes mess up the message.

An example is when first changing the URI and then the Display name.

See example config (kamailio master branch)
# kamailio.cfg
request_route {
	xlog("From: $fu and $fn\n");
	xlog("To: $tu and $tn\n");
	$fu = "sip:testing@test.com";
	$fn = "Displayname";
	dbg_sip_msg();
...
}

dbg_sip_msg() applies the changes and produces the following:
From: sip:testing@test.comDisplayname #012 debug line.

The same can be observed if we forward the message to server itself and see the log
ERROR: {1 248 REGISTER al@there.com} <script>: From: sip:testing@test.comDisplayname and <null>

If we apply_msg_changes() though just after URI change, and then continue as normally, it behaves as expected.

With kamailio/kamailio-wiki#57, I added some docs in the PV cookbook intro, about this workaround, as it's currently only in textopsx docs.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <kamailio/kamailio/pull/3935/c2296538182@github.com>