If dialog was deleted while running the event route, update statistics for early and active dialogs.
<!-- Kamailio Pull Request Template -->
<!-- IMPORTANT: - for detailed contributing guidelines, read: https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md - pull requests must be done to master branch, unless they are backports of fixes from master branch to a stable branch - backports to stable branches must be done with 'git cherry-pick -x ...' - code is contributed under BSD for core and main components (tm, sl, auth, tls) - code is contributed GPLv2 or a compatible license for the other components - GPL code is contributed with OpenSSL licensing exception -->
#### Pre-Submission Checklist <!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply --> <!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above--> <!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list --> - [X] Commit message has the format required by CONTRIBUTING guide - [X] Commits are split per component (core, individual modules, libs, utils, ...) - [X] Each component has a single commit (if not, squash them into one commit) - [X] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change - [X] Small bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist: <!-- Go over all points below, and after creating the PR, tick the checkboxes that apply --> - [X] PR should be backported to stable branches - [X] Tested changes locally - [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description <!-- Describe your changes in detail -->
Please let me know if I can backport it to 5.3 You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2243
-- Commit Summary --
* dialog: update event route statistics
-- File Changes --
M src/modules/dialog/dlg_handlers.c (6)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2243.patch https://github.com/kamailio/kamailio/pull/2243.diff
Hi Stefan, thanks for the pull request. Can you elaborate a bit on the failure condition that this patch solves? Shouldn't be the dialog statistics updated by the "normal" code e.g. in dlg_handlers.c? Or are you refering to conditions when a dialog is deleted _by_ the event route?
Indeed, this needs a bit more explanation.
Check out this function flow: ``` dlg_onreply() -> dlg_run_event_route() -> dlg_lookup() -> if (dlg0 == 0)
``` When dlg_run_event_route() fails (returns -1) then dlg_onreply() just returns.
Now, in the same dlg_onreply() at line 571, the statistics are updated in case of new_state==DLG_STATE_DELETED. However, because of the above, this code is not called if dlg_run_event_route() fails.
Most probably I should update this pull request to increment also the failed dialogs, as done in dlg_onreply() at line 585.
Let me know if this clarifies your questions.
@smititelu pushed 1 commit.
6c2195911918dc1b7f2f45a7178371d16ad7cf18 dialog: update event route statistics
I've updated the "if" conditions for updating statistics in case of dlg_lookup() failure.
Ok, thanks for the clarification. You can merge and also backport, its a bugfix.
Cool. Thanks for review.
Merged #2243 into master.