Browse code

dmq: add support to specify a notification address multiple times in the cfg

- add support to specify a notification address multiple times in the cfg, e.g.:
- modparam("dmq", "notification_address", "sip:10.0.0.1:5060")
- modparam("dmq", "notification_address", "sip:10.0.0.2:5060") etc..
- this can be used to easily configure multiple notification server
- it is an alternative to the multi_notify mode and do not work together with it

Henning Westerholt authored on 29/03/2021 14:25:18
Showing 1 changed files
... ...
@@ -27,6 +27,7 @@
27 27
 #include "../../core/dprint.h"
28 28
 #include "../../core/error.h"
29 29
 #include "../../core/sr_module.h"
30
+#include "../../core/str_list.h"
30 31
 #include "../../modules/tm/tm_load.h"
31 32
 #include "../../core/parser/parse_uri.h"
32 33
 #include "../../modules/sl/sl.h"
... ...
@@ -45,9 +46,8 @@ extern dmq_peer_list_t *dmq_peer_list;
45 46
 extern str dmq_request_method;
46 47
 extern str dmq_server_socket;
47 48
 extern sip_uri_t dmq_server_uri;
48
-extern str dmq_notification_address;
49
+extern str_list_t *dmq_notification_address_list;
49 50
 extern int dmq_multi_notify;
50
-extern sip_uri_t dmq_notification_uri;
51 51
 /* sl and tm */
52 52
 extern struct tm_binds tmb;
53 53
 extern sl_api_t slb;
Browse code

dmq: use module prefix for global variables

- avoid potential conflicts with other globals, given that this module
is used by other modules to perform replication

Daniel-Constantin Mierla authored on 18/05/2020 10:06:05
Showing 1 changed files
... ...
@@ -15,8 +15,8 @@
15 15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 16
  * GNU General Public License for more details.
17 17
  *
18
- * You should have received a copy of the GNU General Public License 
19
- * along with this program; if not, write to the Free Software 
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program; if not, write to the Free Software
20 20
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21 21
  */
22 22
 
... ...
@@ -36,18 +36,18 @@
36 36
 #define DEFAULT_NUM_WORKERS 2
37 37
 #define MIN_PING_INTERVAL 5
38 38
 
39
-extern int num_workers;
40
-extern int worker_usleep;
41
-extern dmq_worker_t *workers;
39
+extern int dmq_num_workers;
40
+extern int dmq_worker_usleep;
41
+extern dmq_worker_t *dmq_workers;
42 42
 extern dmq_peer_t *dmq_notification_peer;
43 43
 extern str dmq_server_address;
44
-extern dmq_peer_list_t *peer_list;
44
+extern dmq_peer_list_t *dmq_peer_list;
45 45
 extern str dmq_request_method;
46 46
 extern str dmq_server_socket;
47
-extern struct sip_uri dmq_server_uri;
47
+extern sip_uri_t dmq_server_uri;
48 48
 extern str dmq_notification_address;
49
-extern int multi_notify;
50
-extern struct sip_uri dmq_notification_uri;
49
+extern int dmq_multi_notify;
50
+extern sip_uri_t dmq_notification_uri;
51 51
 /* sl and tm */
52 52
 extern struct tm_binds tmb;
53 53
 extern sl_api_t slb;
Browse code

dmq: exported functions to kemi framework

Daniel-Constantin Mierla authored on 05/12/2017 12:19:17
Showing 1 changed files
... ...
@@ -33,15 +33,15 @@
33 33
 #include "peer.h"
34 34
 #include "worker.h"
35 35
 
36
-#define DEFAULT_NUM_WORKERS	2
37
-#define MIN_PING_INTERVAL	5
36
+#define DEFAULT_NUM_WORKERS 2
37
+#define MIN_PING_INTERVAL 5
38 38
 
39 39
 extern int num_workers;
40 40
 extern int worker_usleep;
41
-extern dmq_worker_t* workers;
42
-extern dmq_peer_t* dmq_notification_peer;
41
+extern dmq_worker_t *workers;
42
+extern dmq_peer_t *dmq_notification_peer;
43 43
 extern str dmq_server_address;
44
-extern dmq_peer_list_t* peer_list;
44
+extern dmq_peer_list_t *peer_list;
45 45
 extern str dmq_request_method;
46 46
 extern str dmq_server_socket;
47 47
 extern struct sip_uri dmq_server_uri;
... ...
@@ -58,4 +58,3 @@ extern str dmq_500_rpl;
58 58
 extern str dmq_404_rpl;
59 59
 
60 60
 #endif
61
-
Browse code

dmq: add option for non-locking workers

- fixes high CPU condition on some systems (e.g. FreeBSD)
- reported by @soapnix, GH #822
- incorporates patch by Tom Beard (@tombeard)

Charles Chance authored on 29/03/2017 17:55:17
Showing 1 changed files
... ...
@@ -37,6 +37,7 @@
37 37
 #define MIN_PING_INTERVAL	5
38 38
 
39 39
 extern int num_workers;
40
+extern int worker_usleep;
40 41
 extern dmq_worker_t* workers;
41 42
 extern dmq_peer_t* dmq_notification_peer;
42 43
 extern str dmq_server_address;
Browse code

core, lib, modules: updated include paths for header files

Daniel-Constantin Mierla authored on 07/12/2016 11:07:22
Showing 1 changed files
... ...
@@ -24,11 +24,11 @@
24 24
 #ifndef _DMQ_H_
25 25
 #define _DMQ_H_
26 26
 
27
-#include "../../dprint.h"
28
-#include "../../error.h"
29
-#include "../../sr_module.h"
27
+#include "../../core/dprint.h"
28
+#include "../../core/error.h"
29
+#include "../../core/sr_module.h"
30 30
 #include "../../modules/tm/tm_load.h"
31
-#include "../../parser/parse_uri.h"
31
+#include "../../core/parser/parse_uri.h"
32 32
 #include "../../modules/sl/sl.h"
33 33
 #include "peer.h"
34 34
 #include "worker.h"
Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,60 @@
1
+/**
2
+ * dmq module - distributed message queue
3
+ *
4
+ * Copyright (C) 2011 Bucur Marius - Ovidiu
5
+ *
6
+ * This file is part of Kamailio, a free SIP server.
7
+ *
8
+ * Kamailio is free software; you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation; either version 2 of the License, or
11
+ * (at your option) any later version
12
+ *
13
+ * Kamailio is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License 
19
+ * along with this program; if not, write to the Free Software 
20
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21
+ */
22
+
23
+
24
+#ifndef _DMQ_H_
25
+#define _DMQ_H_
26
+
27
+#include "../../dprint.h"
28
+#include "../../error.h"
29
+#include "../../sr_module.h"
30
+#include "../../modules/tm/tm_load.h"
31
+#include "../../parser/parse_uri.h"
32
+#include "../../modules/sl/sl.h"
33
+#include "peer.h"
34
+#include "worker.h"
35
+
36
+#define DEFAULT_NUM_WORKERS	2
37
+#define MIN_PING_INTERVAL	5
38
+
39
+extern int num_workers;
40
+extern dmq_worker_t* workers;
41
+extern dmq_peer_t* dmq_notification_peer;
42
+extern str dmq_server_address;
43
+extern dmq_peer_list_t* peer_list;
44
+extern str dmq_request_method;
45
+extern str dmq_server_socket;
46
+extern struct sip_uri dmq_server_uri;
47
+extern str dmq_notification_address;
48
+extern int multi_notify;
49
+extern struct sip_uri dmq_notification_uri;
50
+/* sl and tm */
51
+extern struct tm_binds tmb;
52
+extern sl_api_t slb;
53
+
54
+extern str dmq_200_rpl;
55
+extern str dmq_400_rpl;
56
+extern str dmq_500_rpl;
57
+extern str dmq_404_rpl;
58
+
59
+#endif
60
+