…-request
Set the dialog context before calling dlg_bye_all. In this way the dialog context is the correct one in the event route tm:local-request; otherwise it could happen that, in the timer process, the context is invalid due to some previous timed-out transactions which set (and not reset) the dialog context in the dlg_onreply function (locally generated replies). You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/291
-- Commit Summary --
* modules/dialog: make dialog context available in event route tm:local-request
-- File Changes --
M modules/dialog/dlg_handlers.c (6)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/291.patch https://github.com/kamailio/kamailio/pull/291.diff
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/291
I see that an dlg_unref is removed and not re-added -- from the patch:
``` if(dlg_bye_all(dlg, NULL)<0) - dlg_unref(dlg, 1); ```
Any reason for that? If BYE failed to be be sent, then the dialog will hang around forever.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/291#issuecomment-134070601
I thought that the dlg_unref below was enough both for successful and unsuccessful case. Am I missing something?
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/291#issuecomment-134072501
At that stage, dialog needs to be unref'ed two times in order to be destroyed. If BYE is sent ok, then one unref is done when processing the response of the BYE. If BYE is not sent, then the dialog is unref'ed by that IF condition, because there is no expected response.
Removing one unref is not ok and it is not 'fixed' by a next unref. This manages a reference counter, not a mutex.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/291#issuecomment-134073572
Thank you for the explanation Daniel. I'll fix the patch.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/291#issuecomment-134076389
I'm going to close this request and open a new one with a clean patch.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/291#issuecomment-134481792
Closed #291.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/291#event-391330649
FTR: no need to, If you can use push with --force on the PR branch
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/291#issuecomment-134516403
I'll do next time :)
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/291#issuecomment-134518641