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

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2020-11-04T11:29:56+01:00

dmq: new parameter notification_channel

- allow setting the channel id for peer availability notifications
- default is "notification_peer"

---

Modified: src/modules/dmq/dmq.c
Modified: src/modules/dmq/notification_peer.c

---

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

---

diff --git a/src/modules/dmq/dmq.c b/src/modules/dmq/dmq.c
index 509c42c405..337d75c1b9 100644
--- a/src/modules/dmq/dmq.c
+++ b/src/modules/dmq/dmq.c
@@ -60,6 +60,7 @@ str dmq_server_socket = {0, 0};
 sip_uri_t dmq_server_uri = {0};
 
 str dmq_notification_address = {0, 0};
+str dmq_notification_channel = str_init("notification_peer");
 int dmq_multi_notify = 0;
 sip_uri_t dmq_notification_uri = {0};
 int dmq_ping_interval = 60;
@@ -109,6 +110,7 @@ static param_export_t params[] = {
        {"ping_interval", INT_PARAM, &dmq_ping_interval},
        {"server_address", PARAM_STR, &dmq_server_address},
        {"notification_address", PARAM_STR, &dmq_notification_address},
+       {"notification_channel", PARAM_STR, &dmq_notification_channel},
        {"multi_notify", INT_PARAM, &dmq_multi_notify},
        {"worker_usleep", INT_PARAM, &dmq_worker_usleep},
        {0, 0, 0}
diff --git a/src/modules/dmq/notification_peer.c 
b/src/modules/dmq/notification_peer.c
index 4cb44c0dee..83da389269 100644
--- a/src/modules/dmq/notification_peer.c
+++ b/src/modules/dmq/notification_peer.c
@@ -32,6 +32,7 @@ dmq_resp_cback_t dmq_notification_resp_callback = 
{&notification_resp_callback_f
 
 int *dmq_init_callback_done = 0;
 
+extern str dmq_notification_channel;
 
 /**
  * @brief add notification peer
@@ -43,10 +44,8 @@ int add_notification_peer()
        memset(&not_peer, 0, sizeof(dmq_peer_t));
        not_peer.callback = dmq_notification_callback_f;
        not_peer.init_callback = NULL;
-       not_peer.description.s = "notification_peer";
-       not_peer.description.len = 17;
-       not_peer.peer_id.s = "notification_peer";
-       not_peer.peer_id.len = 17;
+       not_peer.description = dmq_notification_channel;
+       not_peer.peer_id = dmq_notification_channel;
        dmq_notification_peer = register_dmq_peer(&not_peer);
        if(!dmq_notification_peer) {
                LM_ERR("error in register_dmq_peer\n");


_______________________________________________
Kamailio (SER) - Development Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to