<!-- 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] New feature (non-breaking change which adds new functionality)
#### Checklist: <!-- Go over all points below, and after creating the PR, tick the checkboxes that apply --> - [x] Tested changes locally
#### Description
- adding support for persistent mqueue in a DB
``` modparam("mqueue", "db_url", "sqlite:////kamailio_db/mqueue.sqlite") modparam("mqueue", "mqueue", "name=acc_events;size=1000000;dbmode=1") modparam("acc_json", "output_mqueue", "acc_events") ```
#### Todo - make sure the mqueue order is preserved, I will have to use incremental ID - review and more tests - documentation You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2359
-- Commit Summary --
* mqueue: add db
-- File Changes --
M src/modules/mqueue/Makefile (3) M src/modules/mqueue/README (0) M src/modules/mqueue/api.h (0) M src/modules/mqueue/mqueue_api.c (28) M src/modules/mqueue/mqueue_api.h (2) A src/modules/mqueue/mqueue_db.c (331) A src/modules/mqueue/mqueue_db.h (33) M src/modules/mqueue/mqueue_mod.c (15)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2359.patch https://github.com/kamailio/kamailio/pull/2359.diff
@jchavanton pushed 1 commit.
a12d76a64b14cd10c980c2db118978765a2ebc2c mqueue: add support for db persistency
@jchavanton pushed 1 commit.
873bf2f8f71e0f01425a700f1809f86a245ba3fa mqueue: add support for db persistency
@jchavanton pushed 1 commit.
485d1a8e6946c8b2c70cadd0ca3c1896a9745722 mqueue: add support for db persistency
@jchavanton pushed 1 commit.
6e5ae7eed41a15505666faa61a59d60246027cff mqueue: add support for db persistency
@jchavanton pushed 1 commit.
a6bdbbde1edce03253f8a44102d24a30c17ec1e4 mqueue: add support for db persistency
@linuxmaniac I guess I need to makr it as a draft until to avoid pushing to often and failing.
I just completed testing, I did some last minute modifications to ensure proper ordering, this is why I changed my mind about WIP vs ready, sorry for the noise.
This pull request **introduces 1 alert** when merging 18669ac48134396aa2c603d5a703a673f71dd8eb into df6f64b7bd9c094563a4ce765eb20266b6f1c378 - [view on LGTM.com](https://lgtm.com/projects/g/kamailio/kamailio/rev/pr-7d8fcff098bc0d02436606f...)
**new alerts:**
* 1 for Implicit function declaration
@jchavanton pushed 1 commit.
770edc50a5fa35853230bd0704c62456bdeacb85 mqueue: add support for db persistency
@linuxmaniac I am trying to understand the LGTM failure.
``` [2020-06-16 23:12:29] [analysis] [EVALUATION 95/150] [FAIL] Error running query semmlecode-cpp-queries/Security/CWE/CWE-079/CgiXss.ql: OutOfMemory Query evaluation ran out of memory (maximum allowed memory: 2958MB). [2020-06-16 23:12:30] [analysis] Completed analysis for out - snapshot in 78 minutes. ```
builded and tested locally, seems like it did run out of ram, he found a real problem last time, good work
I guess the LGTM failure was just a fluke, now it looks ok. Any updates open from your side?
I guess the LGTM failure was just a fluke, now it looks ok. Any updates open from your side?
nothing left to do, ready to merge.
Code patch looks ok, maybe some small cosmetic adjustments can be done later (e.g., vars declared at the beginning of blocks), so can be merged from that point of view. But there are some changes to file permissions, adding executable flag:
``` mode change 100644 => 100755 src/modules/mqueue/Makefile mode change 100644 => 100755 src/modules/mqueue/README mode change 100644 => 100755 src/modules/mqueue/api.h mode change 100644 => 100755 src/modules/mqueue/mqueue_api.c mode change 100644 => 100755 src/modules/mqueue/mqueue_api.h create mode 100755 src/modules/mqueue/mqueue_db.c create mode 100755 src/modules/mqueue/mqueue_db.h mode change 100644 => 100755 src/modules/mqueue/mqueue_mod.c ```
Which should not be needed.
@jchavanton pushed 1 commit.
c85da32333237359f9e8b9cfe6715437458c04a8 mqueue: add support for db persistency
Thanks for having a look, I did persmission adjustments and moved the variable declarations to beginning of scope. I did not run clang-format, I tried to keep the formatting that was used in the module before.
I guess I should merge it
Sure, go ahead
Merged #2359 into master.