[SR-Users] uac replace PRACK trouble

Алексей Якимкин ayakimkin at gmail.com
Fri Jul 22 17:15:05 CEST 2022


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 at provider.com");
                uac_replace_to("sip:$tU at 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 at provider.comsip:0987656789 at provider.com>;tag=.....
To: <sip:0987656789 at provider.comsip:0987656789 at provider.com>
From: <sip:provider_login at provider.comsip:provider_login at provider.com
>;tag=.....
From: <sip:provider_login at provider.comsip:provider_login at 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 at provider.com>\r\n", "To");
} else {
         insert_hf("From: <sip:provider_login at provider.com>;tag=$ft\r\n",
"To");
}

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

-- 
Regards,
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220722/90ab4d5e/attachment.htm>


More information about the sr-users mailing list