[SR-Users] uac_replace_from in 200 OK of BYE

Grant Bagdasarian grant.bagdasarian at cm.com
Fri Mar 6 10:46:28 CET 2020


Hi Henning,

I've performed the test also with the latest stable 5.3.2, with the same results.
As far as I can tell, Kamailio is failing to alter the URI.
As for debugging mode, I've checked the logs, and I think the dialog variables (storing the original uri) are removed as soon as the BYE is received from the callee. For the BYE received by Kamailio from the callee, I do see the uac module restoring the original uri, but no log lines for the 200 OK being sent back to the callee.
However, I'm not sure, since I'm only human and can never be fast enough to check the output of dlg.list command. The dialog stays alive for some time though (after the BYE).

Below a trimmed version of the flow of messages. Had to replace some values, could have made a mistake somewhere, but I hope you get the picture.

Callee -> Kamailio
BYE
To: <sip:anonymous at anonymous.invalid>;tag=U9etF1ae4rtgQ
From: <sip:1234556789 at 1.1.1.1:5060>;tag=0d608960

Kamailio -> Callee
SIP/2.0 200 OK
From: <sip:123456789 at 1.1.1.1:5060>;tag=0d608960
To: <sip:1111111111 at 1.1.1.2>;tag=U9etF1ae4rtgQ

While writing this mail, I tried to also call the uac_replace_to function right after calling the uac_replace_from function, and now the To header is correctly replaced in the 200OK of the BYE (sent by callee).

I guess since the Callee (UA) switches the From and To header, Kamailio isn't able to replace it correctly when the callee initiates the BYE request, but this seems to fix it.
I'll have to do some more tests to see if the values are replaced/restored correctly during reINVITEs.

uac_replace_from("", "sip:anonymous at anonymous.invalid");
uac_replace_to("", "$tu");

Regards,

Grant

From: Henning Westerholt <hw at skalatan.de>
Sent: vrijdag 6 maart 2020 10:24
To: Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org>
Cc: Grant Bagdasarian <grant.bagdasarian at cm.com>
Subject: RE: uac_replace_from in 200 OK of BYE


[EXTERNAL EMAIL]
Hi Grant,

Are you saying the Kamailio is failing to alter the URI or does the User Agent does something wrong?

Check the Kamailio log files if maybe the dialog module tracking does not work correctly here. Last year I did some work in this area, in my experience it should work ok also with the dialog module support.

If you can easily reproduce it, you can also do a test call in debugging mode, you will get more information about the uac logic in the log files.

Last thing - consider upgrading to a 5.2 or 5.3 based release, as 5.1 branch is end of life.

Cheers,

Henning

--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://gilawa.com<https://gilawa.com/>

From: sr-users <sr-users-bounces at lists.kamailio.org<mailto:sr-users-bounces at lists.kamailio.org>> On Behalf Of Grant Bagdasarian
Sent: Thursday, March 5, 2020 3:13 PM
To: Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org<mailto:sr-users at lists.kamailio.org>>
Subject: [SR-Users] uac_replace_from in 200 OK of BYE

Hello,

We've been using the uac_replace_from function to anonymize the From header to anonymous at anonymous.invalid<mailto:anonymous at anonymous.invalid>. The uac module makes use of the dialog module for restoring the original URI.
Everything works fine, except when the callee sends the BYE request (replaced uri is present in To header): the 200 OK received by the callee of the BYE suddenly contains the original URI in the To header.

We're running Kamailio 5.1.
Is this a known bug or limitation of the uac module?
Any way to have this replaced correctly (preferably automatically by uac module)?

Regards,

Grant
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20200306/b108e749/attachment.html>


More information about the sr-users mailing list