Module: kamailio
Branch: master
Commit: a744f1dede4db147926f68ae748ee61d5be81a16
URL: 
https://github.com/kamailio/kamailio/commit/a744f1dede4db147926f68ae748ee61d5be81a16

Author: Stefan Mititelu <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2026-05-11T21:34:53+02:00

htable: add new modparam dmq_peer_id

---

Modified: src/modules/htable/doc/htable_admin.xml
Modified: src/modules/htable/ht_dmq.c
Modified: src/modules/htable/htable.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/a744f1dede4db147926f68ae748ee61d5be81a16.diff
Patch: 
https://github.com/kamailio/kamailio/commit/a744f1dede4db147926f68ae748ee61d5be81a16.patch

---

diff --git a/src/modules/htable/doc/htable_admin.xml 
b/src/modules/htable/doc/htable_admin.xml
index 31d48d5764f..8a14261ff4a 100644
--- a/src/modules/htable/doc/htable_admin.xml
+++ b/src/modules/htable/doc/htable_admin.xml
@@ -804,6 +804,27 @@ end
 ...
 modparam("htable", "event_callback_mode", 1)
 ...
+</programlisting>
+               </example>
+       </section>
+       <section id="htable.p.dmq_peer_id">
+               <title><varname>dmq_peer_id</varname> (string)</title>
+               <para>
+                       The DMQ peer identifier for htable replication. This 
allows
+                       customizing the peer name used in DMQ communication, 
which can be useful
+                       to avoid compatibility conflicts, and for a better 
partitioning.
+               </para>
+               <para>
+               <emphasis>
+                       Default value is <quote>htable</quote>.
+               </emphasis>
+               </para>
+               <example>
+               <title>Set <varname>dmq_peer_id</varname> parameter</title>
+               <programlisting format="linespecific">
+...
+modparam("htable", "dmq_peer_id", "htable_6.1.1")
+...
 </programlisting>
                </example>
        </section>
diff --git a/src/modules/htable/ht_dmq.c b/src/modules/htable/ht_dmq.c
index 6ac833ae342..0b5f5354607 100644
--- a/src/modules/htable/ht_dmq.c
+++ b/src/modules/htable/ht_dmq.c
@@ -53,6 +53,7 @@ static int dmq_cell_group_empty_size = 12; // {"cells":[]}
 static int dmq_cell_group_max_size = 60000;
 static ht_dmq_jdoc_cell_group_t ht_dmq_jdoc_cell_group;
 extern int ht_dmq_init_sync;
+extern str ht_dmq_peer_id;
 
 dmq_api_t ht_dmqb;
 dmq_peer_t *ht_dmq_peer = NULL;
@@ -235,10 +236,8 @@ int ht_dmq_initialize()
        not_peer.callback = ht_dmq_handle_msg;
        not_peer.init_callback =
                        (ht_dmq_init_sync ? ht_dmq_request_sync_all : NULL);
-       not_peer.description.s = "htable";
-       not_peer.description.len = 6;
-       not_peer.peer_id.s = "htable";
-       not_peer.peer_id.len = 6;
+       not_peer.peer_id = ht_dmq_peer_id;
+       not_peer.description = ht_dmq_peer_id;
        ht_dmq_peer = ht_dmqb.register_dmq_peer(&not_peer);
        if(!ht_dmq_peer) {
                LM_ERR("error in register_dmq_peer\n");
diff --git a/src/modules/htable/htable.c b/src/modules/htable/htable.c
index fd5946393bd..6e550a41dd8 100644
--- a/src/modules/htable/htable.c
+++ b/src/modules/htable/htable.c
@@ -55,6 +55,7 @@ int ht_timer_interval = 20;
 int ht_db_expires_flag = 0;
 int ht_enable_dmq = 0;
 int ht_dmq_init_sync = 0;
+str ht_dmq_peer_id = str_init("htable");
 int ht_timer_procs = 0;
 static int ht_event_callback_mode = 0;
 
@@ -194,6 +195,7 @@ static param_export_t params[] = {
        {"timer_procs", PARAM_INT, &ht_timer_procs},
        {"event_callback", PARAM_STR, &ht_event_callback},
        {"event_callback_mode", PARAM_INT, &ht_event_callback_mode},
+       {"dmq_peer_id", PARAM_STR, &ht_dmq_peer_id},
        {0, 0, 0}
 };
 

_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to