…interface commands You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/246
-- Commit Summary --
* dialog: run event_route[dialog:end] in case of dialog termination by interface commands
-- File Changes --
M modules/dialog/dlg_req_within.c (6)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/246.patch https://github.com/kamailio/kamailio/pull/246.diff
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/246
Thanks for the patch.
At quick look, it seems that the event route will be called twice in case of a dialog lifetime timeout. At line 1408 in dlg_handlers.c, the event route code is executed again after dlg_bye_all() and dlg_bye_all() executes inside the event route code. Might be an option to remove it from that place.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/246#issuecomment-121721788
Thanks for this deep review. Amended that commit, it should be in this pull request now (9ccc3f510ce2d97dbe1efb690ef1d4e8f18885d5).
What about that double dlg_unref() at dlg_handlers.c near 1408 after dlg_bye_all() in case of non-zero return? Is it ok?
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/246#issuecomment-121737781
The unrefs should be ok. One is done in case bye was not sent out, to destroy dialog faster, otherwise it will wait for the reply of the bye to unref and destroy dialog.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/246#issuecomment-121981196
Merged #246.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/246#event-357602837
The unrefs should be ok. One is done in case bye was not sent out, to destroy dialog faster, otherwise it will wait for the reply of the bye to unref and destroy dialog.
I meant that the new code is this: ``` if(dlg_bye_all(dlg, NULL)<0) dlg_unref(dlg, 1); dlg_unref(dlg, 1); ```
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/246#issuecomment-121982915
Yes, that's the code.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/246#issuecomment-122027717
Hi i am using kamailio 4.4.3 but still I am facing the same issue, **event_route[dialog:end] is not exec'd on dialog terminated by dlg.end_dlg,** ,so the CDR's are not generating properly.