After some review and search 
(https://github.com/kamailio/kamailio/issues/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.

<details>

<summary> See example config (kamailio master branch) </summary>

```
# kamailio.cfg
request_route {
        xlog("From: $fu and $fn\n");
        xlog("To: $tu and $tn\n");
        $fu = "sip:test...@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 a...@there.com} <script>: From: 
sip:testing@test.comDisplayname and <null>`
</details>

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

With https://github.com/kamailio/kamailio-wiki/pull/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 or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3935#issuecomment-2296538182
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/pull/3935/c2296538...@github.com>
_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to