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
... ...
@@ -48,7 +48,7 @@ int build_node_str(dmq_node_t *node, char *buf, int buflen);
48 48
  *           forward the request to its own list
49 49
  */
50 50
 int request_nodelist(dmq_node_t *node, int forward);
51
-dmq_node_t *add_server_and_notify(str *server_address);
51
+dmq_node_t *add_server_and_notify(str_list_t *server_list);
52 52
 
53 53
 /* helper functions */
54 54
 extern int notification_resp_callback_f(
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
 
... ...
@@ -31,11 +31,11 @@
31 31
 #include "peer.h"
32 32
 #include "dmq_funcs.h"
33 33
 
34
-extern str notification_content_type;
34
+extern str dmq_notification_content_type;
35 35
 extern int *dmq_init_callback_done;
36 36
 
37 37
 int add_notification_peer();
38
-int dmq_notification_callback(
38
+int dmq_notification_callback_f(
39 39
 		struct sip_msg *msg, peer_reponse_t *resp, dmq_node_t *dmq_node);
40 40
 int extract_node_list(dmq_node_list_t *update_list, struct sip_msg *msg);
41 41
 str *build_notification_body();
... ...
@@ -44,7 +44,7 @@ int build_node_str(dmq_node_t *node, char *buf, int buflen);
44 44
  * this is acomplished by a KDMQ request
45 45
  * KDMQ notification@server:port
46 46
  * node - the node to send to
47
- * forward - flag that tells if the node receiving the message is allowed to 
47
+ * forward - flag that tells if the node receiving the message is allowed to
48 48
  *           forward the request to its own list
49 49
  */
50 50
 int request_nodelist(dmq_node_t *node, int forward);
... ...
@@ -53,6 +53,6 @@ dmq_node_t *add_server_and_notify(str *server_address);
53 53
 /* helper functions */
54 54
 extern int notification_resp_callback_f(
55 55
 		struct sip_msg *msg, int code, dmq_node_t *node, void *param);
56
-extern dmq_resp_cback_t notification_callback;
56
+extern dmq_resp_cback_t dmq_notification_resp_callback;
57 57
 
58 58
 #endif
Browse code

dmq: exported functions to kemi framework

Daniel-Constantin Mierla authored on 05/12/2017 12:19:17
Showing 1 changed files
... ...
@@ -35,10 +35,11 @@ extern str notification_content_type;
35 35
 extern int *dmq_init_callback_done;
36 36
 
37 37
 int add_notification_peer();
38
-int dmq_notification_callback(struct sip_msg* msg, peer_reponse_t* resp, dmq_node_t* dmq_node);
39
-int extract_node_list(dmq_node_list_t* update_list, struct sip_msg* msg);
40
-str* build_notification_body();
41
-int build_node_str(dmq_node_t* node, char* buf, int buflen);
38
+int dmq_notification_callback(
39
+		struct sip_msg *msg, peer_reponse_t *resp, dmq_node_t *dmq_node);
40
+int extract_node_list(dmq_node_list_t *update_list, struct sip_msg *msg);
41
+str *build_notification_body();
42
+int build_node_str(dmq_node_t *node, char *buf, int buflen);
42 43
 /* request a nodelist from a server
43 44
  * this is acomplished by a KDMQ request
44 45
  * KDMQ notification@server:port
... ...
@@ -46,12 +47,12 @@ int build_node_str(dmq_node_t* node, char* buf, int buflen);
46 47
  * forward - flag that tells if the node receiving the message is allowed to 
47 48
  *           forward the request to its own list
48 49
  */
49
-int request_nodelist(dmq_node_t* node, int forward);
50
-dmq_node_t* add_server_and_notify(str* server_address);
50
+int request_nodelist(dmq_node_t *node, int forward);
51
+dmq_node_t *add_server_and_notify(str *server_address);
51 52
 
52 53
 /* helper functions */
53
-extern int notification_resp_callback_f(struct sip_msg* msg, int code,
54
-		dmq_node_t* node, void* param);
54
+extern int notification_resp_callback_f(
55
+		struct sip_msg *msg, int code, dmq_node_t *node, void *param);
55 56
 extern dmq_resp_cback_t notification_callback;
56 57
 
57 58
 #endif
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
... ...
@@ -23,9 +23,9 @@
23 23
 #ifndef _NOTIFICATION_PEER_H_
24 24
 #define _NOTIFICATION_PEER_H_
25 25
 
26
-#include "../../parser/msg_parser.h"
27
-#include "../../parser/parse_content.h"
28
-#include "../../ut.h"
26
+#include "../../core/parser/msg_parser.h"
27
+#include "../../core/parser/parse_content.h"
28
+#include "../../core/ut.h"
29 29
 #include "dmq.h"
30 30
 #include "dmqnode.h"
31 31
 #include "peer.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,57 @@
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
+#ifndef _NOTIFICATION_PEER_H_
24
+#define _NOTIFICATION_PEER_H_
25
+
26
+#include "../../parser/msg_parser.h"
27
+#include "../../parser/parse_content.h"
28
+#include "../../ut.h"
29
+#include "dmq.h"
30
+#include "dmqnode.h"
31
+#include "peer.h"
32
+#include "dmq_funcs.h"
33
+
34
+extern str notification_content_type;
35
+extern int *dmq_init_callback_done;
36
+
37
+int add_notification_peer();
38
+int dmq_notification_callback(struct sip_msg* msg, peer_reponse_t* resp, dmq_node_t* dmq_node);
39
+int extract_node_list(dmq_node_list_t* update_list, struct sip_msg* msg);
40
+str* build_notification_body();
41
+int build_node_str(dmq_node_t* node, char* buf, int buflen);
42
+/* request a nodelist from a server
43
+ * this is acomplished by a KDMQ request
44
+ * KDMQ notification@server:port
45
+ * node - the node to send to
46
+ * forward - flag that tells if the node receiving the message is allowed to 
47
+ *           forward the request to its own list
48
+ */
49
+int request_nodelist(dmq_node_t* node, int forward);
50
+dmq_node_t* add_server_and_notify(str* server_address);
51
+
52
+/* helper functions */
53
+extern int notification_resp_callback_f(struct sip_msg* msg, int code,
54
+		dmq_node_t* node, void* param);
55
+extern dmq_resp_cback_t notification_callback;
56
+
57
+#endif