<!-- 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 --> - [ ] PR should be backported to stable branches - [x] Tested changes locally - [x] Related to issue #3064 (replace XXXX with an open issue number)
#### Description <!-- Describe your changes in detail -->
This PR fixes #3064.
It resets the check variable back to 0 after sending a tm:local-response reply.
As of currently, event_route[tm:local-response] will be called only max `children` times (one for each) and then won't process any more. You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3687
-- Commit Summary --
* tm: Reset local_response_sent_lookup
-- File Changes --
M src/modules/tm/t_reply.c (1)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3687.patch https://github.com/kamailio/kamailio/pull/3687.diff
@xkaraman: thanks for looking into #3064 and proposing a PR!
As I looked at the commit of this PR and reviewed the code, the purpose was to avoid doing lookup of the event route every time, but do it only once per process. The commit in this PR resets the global variable so lookup is done again and should make a fix for #3064, but still doing the lookup every time.
I pushed an alternative commit to master branch that does the caching of the first lookup in the global variable, so it is going to be done only once, avoiding the search in the hash table of event route blocks each time.
Should commit 1f5444fd2e25d227ffd70f1087d057a3b8002558 (now in master) fail to fix #3064, then we can look further into it.
This PR should be closed if you think the above referenced commit fixes it.
Hey @miconda,
Great, now it makes sense on the usage of that check too. :)
I think new commit https://github.com/kamailio/kamailio/commit/1f5444fd2e25d227ffd70f1087d057a3... works as expected and i will close the PR.
Thanks
Closed #3687.