From c569d9bd39c0bbcf247913526203a285c71796bd Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Mon, 2 Jan 2017 19:58:45 +0100 Subject: [PATCH] dmq: removed empty mi structs --- src/modules/dmq/Makefile | 1 - src/modules/dmq/dmq.c | 22 ++++----------- src/modules/dmq/doc/dmq_admin.xml | 47 +++++++++++++++++++++---------- 3 files changed, 38 insertions(+), 32 deletions(-) diff --git a/src/modules/dmq/Makefile b/src/modules/dmq/Makefile index 638bf0bc08c..2067da9670e 100644 --- a/src/modules/dmq/Makefile +++ b/src/modules/dmq/Makefile @@ -12,6 +12,5 @@ LIBS= DEFS+=-DKAMAILIO_MOD_INTERFACE SERLIBPATH=../../lib -SER_LIBS+=$(SERLIBPATH)/kmi/kmi SER_LIBS+=$(SERLIBPATH)/srdb1/srdb1 include ../../Makefile.modules diff --git a/src/modules/dmq/dmq.c b/src/modules/dmq/dmq.c index 422a3332716..1b4c885e296 100644 --- a/src/modules/dmq/dmq.c +++ b/src/modules/dmq/dmq.c @@ -15,8 +15,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -35,7 +35,6 @@ #include "../../core/mem/shm_mem.h" #include "../../core/usr_avp.h" #include "../../core/pt.h" -#include "../../lib/kmi/mi.h" #include "../../core/hashes.h" #include "../../core/mod_fix.h" #include "../../core/rpc_lookup.h" @@ -90,7 +89,7 @@ static int send_dmq_fixup(void** param, int param_no); static int bcast_dmq_fixup(void** param, int param_no); static cmd_export_t cmds[] = { - {"dmq_handle_message", (cmd_function)dmq_handle_message, 0, handle_dmq_fixup, 0, + {"dmq_handle_message", (cmd_function)dmq_handle_message, 0, handle_dmq_fixup, 0, REQUEST_ROUTE}, {"dmq_send_message", (cmd_function)cfg_dmq_send_message, 4, send_dmq_fixup, 0, ANY_ROUTE}, @@ -115,10 +114,6 @@ static param_export_t params[] = { {0, 0, 0} }; -static mi_export_t mi_cmds[] = { - {0, 0, 0, 0, 0} -}; - static rpc_export_t rpc_methods[]; /** module exports */ @@ -128,7 +123,7 @@ struct module_exports exports = { cmds, /* exported functions */ params, /* exported parameters */ 0, /* exported statistics */ - mi_cmds, /* exported MI functions */ + 0, /* exported MI functions */ 0, /* exported pseudo-variables */ 0, /* extra processes */ mod_init, /* module initialization function */ @@ -172,12 +167,6 @@ static int make_socket_str_from_uri(struct sip_uri *uri, str *socket) { */ static int mod_init(void) { - - if(register_mi_mod(exports.name, mi_cmds)!=0) { - LM_ERR("failed to register MI commands\n"); - return -1; - } - /* bind the SL API */ if (sl_load_api(&slb)!=0) { LM_ERR("cannot bind to SL API\n"); @@ -211,7 +200,7 @@ static int mod_init(void) /* register worker processes - add one because of the ping process */ register_procs(num_workers); - + /* check server_address and notification_address are not empty and correct */ if(parse_uri(dmq_server_address.s, dmq_server_address.len, &dmq_server_uri) < 0) { LM_ERR("server address invalid\n"); @@ -375,6 +364,7 @@ static void dmq_rpc_list_nodes(rpc_t *rpc, void *c) return; error: LM_ERR("Failed to add item to RPC response\n"); + rpc->fault(c, 500, "Server failure"); return; } diff --git a/src/modules/dmq/doc/dmq_admin.xml b/src/modules/dmq/doc/dmq_admin.xml index 6d99cbbe781..ab43dfb3ebc 100644 --- a/src/modules/dmq/doc/dmq_admin.xml +++ b/src/modules/dmq/doc/dmq_admin.xml @@ -11,23 +11,23 @@ &adminguide; - +
Overview - The DMQ module implements a distributed message queue on top of Kamailio in order to enable the - passing/replication of data between multiple instances. The DMQ "nodes" within the system are grouped - in a logical entity called the DMQ "bus" and are able to communicate with each other by - sending/receiving messages (either by broadcast or directly to a specific node). The system + The DMQ module implements a distributed message queue on top of Kamailio in order to enable the + passing/replication of data between multiple instances. The DMQ "nodes" within the system are grouped + in a logical entity called the DMQ "bus" and are able to communicate with each other by + sending/receiving messages (either by broadcast or directly to a specific node). The system transparently deals with node discovery, consistency, retransmissions, etc. - Other entities ("peers") are then able to utlize the DMQ bus to pass messages between themselves. - Peers are grouped by name in order to ensure the correct messages are passed to the relevant peers. + Other entities ("peers") are then able to utlize the DMQ bus to pass messages between themselves. + Peers are grouped by name in order to ensure the correct messages are passed to the relevant peers. This grouping of peers can be compared to a topic in a typical pub/sub system. - DMQ sends SIP requests using the KDMQ request method, that is private + DMQ sends SIP requests using the KDMQ request method, that is private to Kamailio. @@ -56,7 +56,7 @@ sip:192.168.40.17:5060;status=active - +
@@ -94,7 +94,7 @@ sip:192.168.40.17:5060;status=active
- +
Parameters
@@ -134,12 +134,12 @@ modparam("dmq", "notification_address", "sip:10.0.0.21:5060")
<varname>multi_notify</varname>(int) - Enables the ability to resolve multiple IPv4/IPv6 addresses for + Enables the ability to resolve multiple IPv4/IPv6 addresses for a single notification address. - A value of zero resolves to the first IP address found. - A non-zero value resolves to all IP addresses associated with the host. + A value of zero resolves to the first IP address found. + A non-zero value resolves to all IP addresses associated with the host. This includes addresses from DNS SRV records, A and AAAA records. @@ -197,7 +197,7 @@ modparam("dmq", "ping_interval", 90) dmq_handle_message() - Handles a DMQ message by passing it to the appropriate local peer (module). + Handles a DMQ message by passing it to the appropriate local peer (module). The peer is identified by the user part of the To header. @@ -302,7 +302,7 @@ modparam("dmq", "ping_interval", 90) dmq_t_replicate([skip_loop_test]) - Replicates the current SIP message to all active nodes (except self). Useful for replicating + Replicates the current SIP message to all active nodes (except self). Useful for replicating REGISTER, PUBLISH etc. in a clustered environment. Meaning of parameters: @@ -360,5 +360,22 @@ modparam("dmq", "ping_interval", 90)
+
+ RPC Commands +
+ dmq.list_nodes + + List the DMQ nodes. It has no parameters. + + + dmq.list_nodes usage + +... +&kamcmd; dmq.list_nodes +... + + +
+