Hello,

pbx -> kamailio -> provider
kamailio registers (uacreg) on provider.

When I call through my provider I need to change headers To From and PAI. I tried with uac_replace_from and uac_replace_to.
$tU for example 0987656789
if($fU=~"1234567") {
                uac_replace_from("sip:provider_login@provider.com");
                uac_replace_to("sip:$tU@provider.com");
}

My provider answers on Invite with 183 progress, so pbx answers with PRACK.

Kamailio change To and from like this:
To: <sip:0987656789@provider.comsip:0987656789@provider.com>;tag=.....
To: <sip:0987656789@provider.comsip:0987656789@provider.com>
From: <sip:provider_login@provider.comsip:provider_login@provider.com>;tag=.....
From: <sip:provider_login@provider.comsip:provider_login@provider.com>

Is it a bug?

I tried to disable this modification for PRACK u REQINIT ($csb != "2 PRACK") It haven't worked for me.
 
I solved this issue with this code.
remove_hf("From");
if ($ft == $null) {
         insert_hf("From: <sip:provider_login@provider.com>\r\n", "To");
} else {
         insert_hf("From: <sip:provider_login@provider.com>;tag=$ft\r\n", "To");
}

version: kamailio 5.7.0-dev0 (x86_64/linux)
Ubuntu 18

--
Regards,
Alex