Re: [EXT] Possible bug introduced in 5.8.5

Ihor Olkhovskyi via sr-users <[email protected]>
Newsgroups gmane.comp.voip.ser
Message-ID <CAJTkRNskMO9di_On+SAOiUv3zGzn3O8FnNQoCT+Tpj8E1bC2Mg@mail.gmail.com>
Andreas,

This is the commit:
https://github.com/kamailio/kamailio/commit/6367a41f64ed165792ffe71ea310fd917947ccba

But are you sure you're not calling uac_replace_... twice per packet
processing? And for test - can you explicitly call msg_apply_changes()
after uac_replace_...() and check?

Le mer. 4 févr. 2026 à 11:45, Andreas Heil via sr-users <
[email protected]> a écrit :

> Hi Daniel,
>
> At first, thanks for looking into it.
>
> I first tried 5.8.7, then walked through all the versions (inkl. 5.7.x and
> 6.0.x) until I identified 5.8.5 as the beginning.
>
> If it’s not a bug, why does it only appear if there are no brackets in the
> to-header of the incoming SIP message and
> only from 5.8.5 upwards (even 6.0.x).
>
> We don’t use the $t.. variables for _setting_  headers.
> We use uac_replace_to more than once though, but only once per `path`.
>
> I’ll check the uac_replace_to again and if there are other functions in
> use (assign_hf_value, insert_hf, and the like).
>
> My first thought was that someone could have a look into the code (someone
> who knows the kamailio source code ecosystem). ;-)
>
> Thanks,
> Andreas
>
> Am 03.02.2026 um 17:55 schrieb Daniel-Constantin Mierla <[email protected]
> >:
>
> I just tried to simulate using 5.8 and 6.1 and it doesn't seem to append:
>
>     remove_hf("To");
>     insert_hf("To: sip:[email protected]:5060\r\n
> <sip:[email protected]:5060%5Cr%5Cn>");
>     msg_apply_changes();
>     xinfo("====== mb: [$mb]\n");
>     uac_replace_to("", "sip:[email protected];user=phone"
> <sip:[email protected];user=phone>);
>     msg_apply_changes();
>     xinfo("====== mb: [$mb]\n");
>     exit;
>
> After the first msg_apply_changes(), the header is:
>
> To: sip:[email protected]:5060
>
> After the second:
>
> To: sip:[email protected];user=phone
>
> Can you check to be sure there are no two or more operations over the the
> To header?
>
> Cheers,
> Daniel
> On 03.02.26 17:30, Daniel-Constantin Mierla wrote:
>
> Hello,
>
> have you tried with the latest 5.8.7? Or just with 5.8.5?
>
> Cheers,
> Daniel
> On 03.02.26 16:26, Andreas Heil via sr-users wrote:
>
> Hi all,
>
> I’m currently testing a migration from version 5.6.x to 5.8.x.
>
> The problem:
> 1. INVITE comes in with a To-header like this:
>
>   To: sip:[email protected]:5060
>
> 2. uac_replace_to in a branch_route:
>
>   uac_replace_to("", "sip:+$(avp(newDAD){s.replace,CC,})@$var(carrierDomain);user=phone“);
>
> Note: It does not matter if we try to change the To in different ways like:
>   uac_replace_to("", "sip:[email protected];user=phone“);
> Or:
>   $td = „some.carrier.net" <sip:[email protected];user=phone%E2%80%9C);Or:$td=%E2%80%9Esome.carrier.net>;
>
> 3. What gets on the line is:
>
>   To:  <sip:[email protected]:5060> <sip:[email protected]:5060>sip:[email protected];user=phone
>
> Or in case of ($td):
>
>   To:  <sip:[email protected]:5060> <sip:[email protected]:5060>some.carrier.net
>
> Note: the INVITE received has 1 space between „To:" and Content, The INVITE send has 2 spaces.
>
> The bug only appears if the initial to-header is NOT enclosed in < >.
>
> I could track it down to version 5.8.5 in which it appeared first.
> Everything before (including 5.8.4) behaves normally.
>
> I think it’s introduced by commit 6367a41f64ed165792ffe71ea310fd917947ccba
> There is a comment beneath it, that reports something similar with the From header, too.
>
> How can I fix that in the config, or is it a bug?
>
> Greetings,
> Andreas
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected]
> To unsubscribe send an email to [email protected]
> Important: keep the mailing list in the recipients, do not reply only to the sender!
>
> --
> Daniel-Constantin Mierla (@ asipto.com)twitter.com/miconda -- linkedin.com/in/miconda
> Kamailio Consultancy, Training and Development Services -- asipto.com
> Kamailio World Conference, May 7-8, 2026 - Berlin, Germany -- kamailioworld.com
>
> --
> Daniel-Constantin Mierla (@ asipto.com)twitter.com/miconda -- linkedin.com/in/miconda
> Kamailio Consultancy, Training and Development Services -- asipto.com
> Kamailio World Conference, May 7-8, 2026 - Berlin, Germany -- kamailioworld.com
>
>
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions --
> [email protected]
> To unsubscribe send an email to [email protected]
> Important: keep the mailing list in the recipients, do not reply only to
> the sender!
>


-- 
Best regards,
Ihor (Igor)

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the sender!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.