[SR-Users] [Dialog] Removing entries from dialog memory

Henning Westerholt hw at skalatan.de
Mon Oct 21 15:16:13 CEST 2019


Hi julien,

Sounds interesting. Another approach (which also helps regarding the lost BYE at the other user agent side) would be to use something like SIP Session timer and a short dialog timeout. But this is of course a more heavy-weight solution.

Your implementation would probably need some extensions (as you mentioned as well, e.g. regarding to accounting, end routes etc..) before it could be integrated into the code base

But if you (or somebody else) would be interested to work on it in this direction, it could be certainly be integrated to module.

Cheers,

Henning

--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://skalatan.de/services

From: Julien Klingenmeyer <julien.klingenmeyer at corp.ovh.com>
Sent: Monday, October 21, 2019 2:59 PM
To: Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org>; Henning Westerholt <hw at skalatan.de>
Subject: Re: [SR-Users] [Dialog] Removing entries from dialog memory

Hi,

Just a follow-up about my issue.
As I was not able to remove the dialog as I wanted, I preferred to create a new small RPC command to handle it.
This new command forces a dialog (identified by call-id and tags) to be removed “silently” (i.e. without taking care of accounting, dialog end routes… and all the other stuff: I did not need to because the goal of the command is to deal with “ghost calls”).

It just updates state of an active dialog (in state 4) to the “deleted” state and updates the stats.
It only handles dialog in state 4 because I have no issues with others (dialogs in state 3 are regularly removed from memory after the corresponding timeout).

After executing this new command: dialog is completely killed a few minutes later when the timer function dlg_clean_run is executed.
(and we can see in the logs the below line:)
NOTICE: dialog [dlg_hash.c:257]: dlg_clean_run(): dialog in delete state is too old

Command can be executed from script using the Jsonrpc server module.
I am not sure it could interest other users (could be “dangerous” and scope is limited) but if you think it could then I would be happy to make a PR on git.

Cheers,
--
Julien

De : sr-users <sr-users-bounces at lists.kamailio.org<mailto:sr-users-bounces at lists.kamailio.org>> au nom de Julien Klingenmeyer <julien.klingenmeyer at corp.ovh.com<mailto:julien.klingenmeyer at corp.ovh.com>>
Répondre à : "Kamailio (SER) - Users Mailing List" <sr-users at lists.kamailio.org<mailto:sr-users at lists.kamailio.org>>
Date : jeudi 17 octobre 2019 à 17:22
À : Henning Westerholt <hw at skalatan.de<mailto:hw at skalatan.de>>, "Kamailio (SER) - Users Mailing List" <sr-users at lists.kamailio.org<mailto:sr-users at lists.kamailio.org>>
Objet : Re: [SR-Users] [Dialog] Removing entries from dialog memory

Hi Henning,

Thanks for your reply. There is no particular errors in logs at dlg_bye() time.
The dialog is not removed until the original timeout is reached (i.e. some hours later). Of that I can be sure because of the log below printed at that time:

WARNING: dialog [dlg_handlers.c:1616]: dlg_ontimeout(): timeout for dlg with CallID '___' and tags '___' '___'

During some attempts I managed to get a working scenario (with timeout triggered right after BYE request and dialog no more present in memory).
But for now to be honest I do not understand why it worked at these times and not most of the time…
I wonder if dlg state stored in memory and/or in DB could have an impact regarding this behavior (the routing script indeed uses the real-time db mode and the dlg_db_load features).
My first impression is that depending on how the ACK request was handled within the dialog, the behavior is different. But I will check it further when I find some time.

Thanks again!

Regards,
--
Julien

De : Henning Westerholt <hw at skalatan.de<mailto:hw at skalatan.de>>
Date : jeudi 17 octobre 2019 à 11:09
À : "Kamailio (SER) - Users Mailing List" <sr-users at lists.kamailio.org<mailto:sr-users at lists.kamailio.org>>
Cc : Julien Klingenmeyer <julien.klingenmeyer at corp.ovh.com<mailto:julien.klingenmeyer at corp.ovh.com>>
Objet : RE: [SR-Users] [Dialog] Removing entries from dialog memory

Hi Julien,

do you get an error from the dlg_bye() execution in the logs? Can you check if the dialog maybe only sitting there for some more seconds until the delete timer will delete it after the cmd execution?

Cheers,

Henning

--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://skalatan.de/services

From: sr-users <sr-users-bounces at lists.kamailio.org<mailto:sr-users-bounces at lists.kamailio.org>> On Behalf Of Julien Klingenmeyer
Sent: Friday, October 11, 2019 7:14 PM
To: Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org<mailto:sr-users at lists.kamailio.org>>
Subject: Re: [SR-Users] [Dialog] Removing entries from dialog memory

I make it receive a 4xx reply (Call does not exist)



Le 11 oct. 2019 à 18:32, Sergiu Pojoga <pojogas at gmail.com<mailto:pojogas at gmail.com>> a écrit :
Does it receive a 200 OK reply to the BYE?

On Fri, Oct 11, 2019, 10:55 AM Julien Klingenmeyer, <julien.klingenmeyer at corp.ovh.com<mailto:julien.klingenmeyer at corp.ovh.com>> wrote:
I tried the end_dlg rpc command but result is the same as the dlg_bye function (mistake in my original message, I said send_bye but I meant dlg_bye()): BYE requests are sent but dialog is still present when I execute the command dlg.list. It does not look to be removed from the active dialog list.

Would it be because Kamailio does not get any replies to the Bye requests?

Regards,
--
Julien

De : sr-users <sr-users-bounces at lists.kamailio.org<mailto:sr-users-bounces at lists.kamailio.org>> au nom de Sergiu Pojoga <pojogas at gmail.com<mailto:pojogas at gmail.com>>
Répondre à : "Kamailio (SER) - Users Mailing List" <sr-users at lists.kamailio.org<mailto:sr-users at lists.kamailio.org>>
Date : vendredi 11 octobre 2019 à 16:42
À : "Kamailio (SER) - Users Mailing List" <sr-users at lists.kamailio.org<mailto:sr-users at lists.kamailio.org>>
Objet : Re: [SR-Users] [Dialog] Removing entries from dialog memory

In simple works, you want to terminate a certain call?

If so: https://kamailio.org/docs/modules/5.1.x/modules/dialog.html#idm1195

Like for example via RPC: kamctl rpc dlg.end_dlg 1686 10139

Regards,
--Sergiu

On Fri, Oct 11, 2019 at 9:12 AM Julien Klingenmeyer <julien.klingenmeyer at corp.ovh.com<mailto:julien.klingenmeyer at corp.ovh.com>> wrote:
Hi,

I am wondering if there is any way to remove an entry from the active dialog list?
I mean, assuming that Kamailio did not get any BYE related to a call for some reason and that I want that call to be “killed” from dialog memory before reaching the lifetime timeout.

What I already tried with no success: sending a request to Kamailio catched by a dedicated route of the script then:

·         using the dlg_get function (with the target call as parameter) then send_bye function (then dropping the BYE request generated by the dialog module in the onsend_route with the drop function): no success. Dialog module correctly generates BYE requests but dialog related to the call is kept in memory until its lifetime timeout (and BYE requests are not dropped in the onsend_route either).

·         using the dlg_get function then dlg_set_timeout to set a very low timeout value for that particular call. No successs: Trying to update a bogus dlg as critical error.

Could some RPC commands or whatever help me to accomplish what I try to do?
Thanks

Julien
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users at lists.kamailio.org<mailto:sr-users at lists.kamailio.org>
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users at lists.kamailio.org<mailto:sr-users at lists.kamailio.org>
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users at lists.kamailio.org<mailto:sr-users at lists.kamailio.org>
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20191021/f9a06d3a/attachment.html>


More information about the sr-users mailing list