- forward in dialog messages using RMS bridge in B2BUA manner - move all code related to rms_session_info to dedicated source file - session_list refactoring to always include all dialog information needed - suspend transaction to have non blocking bridging - random rtp port - stop using shared memory for MS2 and oRTP, manage all the allocation from one dedicated process
<!-- 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 --> - [ ] Commit message has the format required by CONTRIBUTING guide - [ ] Commits are split per component (core, individual modules, libs, utils, ...) - [ ] Each component has a single commit (if not, squash them into one commit) - [ ] 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 - [ ] 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 - [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description Even if this module is very much Alpha, I am getting closer to the minimal feature set I was having in mind, I should be able to focus my work on stabilizing the code and validate the behavior.
``` route { if (t_precheck_trans()) { t_check_trans(); exit; } t_check_trans(); xnotice("[$rm][$ci]\n"); if (is_method("INVITE") && !has_totag()) { fix_nated_contact(); if ($rU == "777") { setflag(2); if (rms_answer() != 1) { send_reply("503", "server error"); xerr("rtp_media_server error!\n"); exit; } else { exit; } } $var(target) = "sip:1234@11.12.69.51:5060;"; if (!rms_bridge("$var(target)", "rms:bridged")) { send_reply("604", "server error"); xerr("rtp_media_server bridge error!\n"); exit; } } if(rms_session_check()) rms_sip_request(); exit; } ```
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1823
-- Commit Summary --
* rtp_media_server: adding call bridging
-- File Changes --
M src/core/dns_cache.c (1) M src/core/resolve.c (11) M src/modules/rtp_media_server/Makefile (0) M src/modules/rtp_media_server/config_example/kamailio.cfg (5) M src/modules/rtp_media_server/doc/rtp_media_server_admin.xml (40) A src/modules/rtp_media_server/doc/state.txt (14) M src/modules/rtp_media_server/rms_media.c (160) M src/modules/rtp_media_server/rms_media.h (7) M src/modules/rtp_media_server/rms_sdp.c (106) M src/modules/rtp_media_server/rms_sdp.h (2) A src/modules/rtp_media_server/rms_session_info.c (202) A src/modules/rtp_media_server/rms_session_info.h (109) M src/modules/rtp_media_server/rms_util.h (4) M src/modules/rtp_media_server/rtp_media_server.c (887) M src/modules/rtp_media_server/rtp_media_server.h (46) M src/modules/tm/ut.h (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1823.patch https://github.com/kamailio/kamailio/pull/1823.diff
After you pushed new commits, I see that there is still a small patch to tm module that likely you wanted only for testing.
Thanks for looking and noticing, corrected, I did run clang-format as well. I will proceed with further review before merging.
There were also two debug changes to the core, but they seems also now removed as well, thank you. Is the binding from Kamailio memory manager to library memory manager functionality (ortp_memory_functions etc..) not needed anymore?
I am fine to merge, you can reformat or do further changes for this module as you want, being the maintainer of the module. I wanted to ensure other components are not affected without review, and if they need to be changed, then make a separate commit per module or core.
@henningw Q: "Is the binding from Kamailio memory manager to library memory manager functionality (ortp_memory_functions etc..) not needed anymore?"
A: I found as least to edge case in oRTP where it was not using the specified memory allocation functions ... At this point I think it will be less problematic spawn threads from one or more dedicated processes in Kamailio, the worker processes will not interact with the libraries directly. This seems like a perfectly fine decision in terms of architecture and there will be no more bugs related to shared memory ...
Thank for pinpointing the unwanted modifications to the core
Few remarks here ...
As a matter of fact, if an external library doesn't require shared memory, leave it as it is, without enforcing Kamailio's pkg memory.
I looked over time to several libs used by different Kamailio modules, most of them are using anyhow malloc/free for what is not expected to be shared memory. Also, I found that is not easy to predict how much private memory an external lib may need, so that is impacted if enforcing pkg, resulting bad runtime behaviour. We actually never tried to enforce pkg to external libs (e.g., like mysql or postgres clients, redis/mongodb, ...).
If needed to use shared memory, then it is a must to set our shm memory manager for external libs. We have to do it for TLS, because the connections are shared among Kamailio workers.
Otherwise, PKG must be used for the code written in Kamailio.
@jchavanton - thank you for the answer of my memory manager question. I just noticed it and was curious. :-) @miconda - the memcached module still binds against pkg_malloc*, this should be probably changed as well. During my review I noticed a few places where the core and also modules (e.g. db_mysql, app_*) uses in a few places system malloc.
@jchavanton pushed 1 commit.
522a44fc4b49afd277d8322bf63f106d8040e862 core: dns slow queries reporting
Merged #1823 into master.