Rtpengine dmq sync#2
Open
vlad-korniiaka-idt wants to merge 5 commits into
Open
Conversation
- implement rtpengine_dmq_request_sync() to broadcast a SYNC request to all DMQ peers on startup via JSON DMQ message - handle RTPENGINE_DMQ_SYNC action in rtpengine_dmq_handle_msg() to trigger full local hash table replication when sync is requested - implement rtpengine_dmq_replicate_sync() to iterate all hash table entries and replicate non-expired ones via DMQ INSERT messages - expose rtpengine_hash_table as non-static in rtpengine_hash.c and add extern declaration in rtpengine_hash.h to allow DMQ sync access
vlad-korniiaka-idt
requested review from
Copilot,
n2p-litvinov and
stefan-mititelu-idt
May 4, 2026 09:08
There was a problem hiding this comment.
Pull request overview
Adds DMQ-based RTP engine hash-table synchronization so a node can request peers to resend current callid/viabranch mappings during startup or rejoin.
Changes:
- Exposes the RTP engine hash table through the header and a getter.
- Adds a DMQ sync request message (
RTPENGINE_DMQ_SYNC) and handler path. - Adds logic to iterate the local hash table and replicate active entries over DMQ.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/modules/rtpengine/rtpengine_hash.h |
Exposes hash-table state/API needed by DMQ sync code. |
src/modules/rtpengine/rtpengine_hash.c |
Makes the hash-table symbol externally visible and adds a getter. |
src/modules/rtpengine/rtpengine_dmq.c |
Implements sync request handling and full-table replication over DMQ. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+89
to
+93
| jdoc.buf.len = strlen(jdoc.buf.s); | ||
| LM_DBG("sending serialized data %.*s\n", jdoc.buf.len, jdoc.buf.s); | ||
| if(rtpengine_dmq_send(&jdoc.buf, 0) != 0) { | ||
| goto error; | ||
| } |
Author
There was a problem hiding this comment.
I have checked:
- usrloc has the same behavior:
int usrloc_dmq_request_sync()
{
if(usrloc_dmq_send(&jdoc.buf, 0) != 0) {
goto error;
}
- dlg_dmq also:
int dlg_dmq_request_sync()
{
...
if(dlg_dmq_send(&jdoc.buf, 0) != 0) {
goto error;
}
Comment on lines
+31
to
+32
| extern struct rtpengine_hash_table *rtpengine_hash_table; | ||
|
|
|
|
||
|
|
||
| static struct rtpengine_hash_table *rtpengine_hash_table; | ||
| struct rtpengine_hash_table *rtpengine_hash_table; |
Author
|
@stefan-mititelu-idt @n2p-litvinov Thanks for the review. Tested: See .pcap: RTPENG_DMQ_SYNC_ONLY_TO_1.pcap 3 Kamailio nodes:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





Pre-Submission Checklist
clang-formatusing the config file.clang-formatfrom source code folder
in
doc/subfolder, the README file is autogenerated)Type Of Change
Checklist:
Description