Module: kamailio
Branch: master
Commit: b06ed377323ce11a8ae0442af6558b453c4872bb
URL:
https://github.com/kamailio/kamailio/commit/b06ed377323ce11a8ae0442af6558b4…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-03-16T13:40:03+01:00
dmq: request nodes list in worker one init callback instead of main proc
- ensure availability of all transports
---
Modified: src/modules/dmq/dmq.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b06ed377323ce11a8ae0442af6558b4…
Patch:
https://github.com/kamailio/kamailio/commit/b06ed377323ce11a8ae0442af6558b4…
---
diff --git a/src/modules/dmq/dmq.c b/src/modules/dmq/dmq.c
index 0a807a983f..06e091038a 100644
--- a/src/modules/dmq/dmq.c
+++ b/src/modules/dmq/dmq.c
@@ -286,6 +286,11 @@ static int child_init(int rank)
{
int i, newpid;
+ if(rank == PROC_TCP_MAIN) {
+ /* do nothing for the tcp main process */
+ return 0;
+ }
+
if(rank == PROC_INIT) {
for(i = 0; i < dmq_num_workers; i++) {
if (init_worker(&dmq_workers[i]) < 0) {
@@ -312,6 +317,10 @@ static int child_init(int rank)
dmq_workers[i].pid = newpid;
}
}
+ return 0;
+ }
+
+ if(rank == PROC_SIPINIT) {
/* notification_node - the node from which the Kamailio instance
* gets the server list on startup.
* the address is given as a module parameter in dmq_notification_address
@@ -326,11 +335,6 @@ static int child_init(int rank)
STR_FMT(&dmq_notification_address));
}
}
- return 0;
- }
- if(rank == PROC_TCP_MAIN) {
- /* do nothing for the tcp main process */
- return 0;
}
dmq_pid = my_pid();