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

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

presence: add new modparam dmq_peer_id

---

Modified: src/modules/presence/doc/presence_admin.xml
Modified: src/modules/presence/presence.c
Modified: src/modules/presence/presence_dmq.c

---

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

---

diff --git a/src/modules/presence/doc/presence_admin.xml 
b/src/modules/presence/doc/presence_admin.xml
index e9ee9d8a392..37f7721db06 100644
--- a/src/modules/presence/doc/presence_admin.xml
+++ b/src/modules/presence/doc/presence_admin.xml
@@ -1143,6 +1143,28 @@ modparam("presence", "subs_respond_200", 0)
        </example>
 </section>
 
+<section id="presence.p.dmq_peer_id">
+       <title><varname>dmq_peer_id</varname> (string)</title>
+       <para>
+               The DMQ peer identifier for presence 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>presence</quote>.
+       </emphasis>
+       </para>
+       <example>
+               <title>Set <varname>dmq_peer_id</varname> parameter</title>
+               <programlisting format="linespecific">
+...
+modparam("presence", "dmq_peer_id", "presence_6.1.1")
+...
+</programlisting>
+       </example>
+</section>
+
 </section>
 
 <section>
diff --git a/src/modules/presence/presence.c b/src/modules/presence/presence.c
index 79704c9d6bd..43149698806 100644
--- a/src/modules/presence/presence.c
+++ b/src/modules/presence/presence.c
@@ -171,6 +171,7 @@ str pres_xavp_cfg = {0};
 int pres_retrieve_order = 0;
 str pres_retrieve_order_by = str_init("priority");
 int pres_enable_dmq = 0;
+str pres_dmq_peer_id = str_init("presence");
 int pres_enable_pres_dmq = 1;
 int pres_enable_pres_sync_dmq = 1;
 int pres_enable_subs_dmq = 0;
@@ -263,6 +264,7 @@ static param_export_t params[]={
        { "delete_same_subs",       PARAM_INT, &pres_delete_same_subs},
        { "timer_mode",             PARAM_INT, &pres_timer_mode},
        { "subs_respond_200",       PARAM_INT, &pres_subs_respond_200},
+       { "dmq_peer_id",            PARAM_STR, &pres_dmq_peer_id},
 
        {0,0,0}
 };
diff --git a/src/modules/presence/presence_dmq.c 
b/src/modules/presence/presence_dmq.c
index 9a2bc9165bf..970c9524795 100644
--- a/src/modules/presence/presence_dmq.c
+++ b/src/modules/presence/presence_dmq.c
@@ -34,6 +34,8 @@ static int *pres_dmq_recv = 0;
 dmq_api_t pres_dmqb;
 dmq_peer_t *pres_dmq_peer = NULL;
 
+extern str pres_dmq_peer_id;
+
 int pres_dmq_send_all_presentities(dmq_node_t *dmq_node);
 int pres_dmq_send_all_subscriptions(dmq_node_t *dmq_node);
 int pres_dmq_request_sync(dmq_node_t *dmq_node);
@@ -55,10 +57,8 @@ int pres_dmq_initialize()
 
        not_peer.callback = pres_dmq_handle_msg;
        not_peer.init_callback = pres_dmq_request_sync;
-       not_peer.description.s = "presence";
-       not_peer.description.len = 8;
-       not_peer.peer_id.s = "presence";
-       not_peer.peer_id.len = 8;
+       not_peer.peer_id = pres_dmq_peer_id;
+       not_peer.description = pres_dmq_peer_id;
        pres_dmq_peer = pres_dmqb.register_dmq_peer(&not_peer);
        if(!pres_dmq_peer) {
                LM_ERR("error in register_dmq_peer\n");

_______________________________________________
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