[sr-dev] git:master: modules/tsilo: removed MI commands

Federico Cabiddu federico.cabiddu at gmail.com
Thu Nov 13 14:56:50 CET 2014


Module: sip-router
Branch: master
Commit: c0f58d77fc6cff80cf6a4fc62cd9e8acb9e5ba79
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c0f58d77fc6cff80cf6a4fc62cd9e8acb9e5ba79

Author: Federico Cabiddu <federico.cabiddu at gmail.com>
Committer: Federico Cabiddu <federico.cabiddu at gmail.com>
Date:   Thu Nov 13 14:41:07 2014 +0100

modules/tsilo: removed MI commands
    (revert commit a255911902788bf74a7f4279fce4758b2f2a4613)

---

 modules/tsilo/Makefile            |    3 --
 modules/tsilo/README              |   53 +++++++-----------------------------
 modules/tsilo/doc/tsilo_admin.xml |   33 -----------------------
 modules/tsilo/tsilo.c             |   18 ++++--------
 4 files changed, 17 insertions(+), 90 deletions(-)

diff --git a/modules/tsilo/Makefile b/modules/tsilo/Makefile
index c179aec..3ce15b4 100644
--- a/modules/tsilo/Makefile
+++ b/modules/tsilo/Makefile
@@ -15,7 +15,4 @@ ifeq ($(INSTALL_FLAVOUR),kamailio)
 DEFS+= -DWITH_EVENT_LOCAL_REQUEST
 endif # INSTALL_FLAVOUR
 
-SERLIBPATH=../../lib
-SER_LIBS+=$(SERLIBPATH)/kmi/kmi
-
 include ../../Makefile.modules
diff --git a/modules/tsilo/README b/modules/tsilo/README
index af1ade0..46d8574 100644
--- a/modules/tsilo/README
+++ b/modules/tsilo/README
@@ -33,15 +33,10 @@ Federico Cabiddu
               4.2. ts_append(domain, ruri)
               4.3. ts_append_to(tindex, tlabel, domain)
 
-        5. MI Commands
+        5. Exported RPC Functions
 
-              5.1. ts_dump
-              5.2. ts_lookup
-
-        6. Exported RPC Functions
-
-              6.1. ts.dump
-              6.2. ts.lookup
+              5.1. ts.dump
+              5.2. ts.lookup
 
    List of Examples
 
@@ -70,15 +65,10 @@ Chapter 1. Admin Guide
         4.2. ts_append(domain, ruri)
         4.3. ts_append_to(tindex, tlabel, domain)
 
-   5. MI Commands
-
-        5.1. ts_dump
-        5.2. ts_lookup
-
-   6. Exported RPC Functions
+   5. Exported RPC Functions
 
-        6.1. ts.dump
-        6.2. ts.lookup
+        5.1. ts.dump
+        5.2. ts.lookup
 
 1. Overview
 
@@ -202,33 +192,12 @@ if (is_method("REGISTER")) {
 }
 ...
 
-5. MI Commands
-
-   5.1. ts_dump
-   5.2. ts_lookup
-
-5.1.  ts_dump
-
-   Dumps the entire content of the TSILO table
-
-   Parameters:
-     * brief - (optional, may not be present); if equals to string
-       "brief", a brief dump will be done (only RURI, without the
-       transaction(s) details)
-
-5.2.  ts_lookup
-
-   Dumps the transactions stored for the given RURI
-
-   Parameters:
-     * ruri - RURI for which we want to show the transactions.
-
-6. Exported RPC Functions
+5. Exported RPC Functions
 
-   6.1. ts.dump
-   6.2. ts.lookup
+   5.1. ts.dump
+   5.2. ts.lookup
 
-6.1. ts.dump
+5.1. ts.dump
 
    Dumps the content of the TSILO table
 
@@ -237,7 +206,7 @@ if (is_method("REGISTER")) {
    RPC Command Format:
                         kamcmd ts.dump
 
-6.2. ts.lookup
+5.2. ts.lookup
 
    Dumps the transactions stored for the given RURI
 
diff --git a/modules/tsilo/doc/tsilo_admin.xml b/modules/tsilo/doc/tsilo_admin.xml
index 32acf8b..749ba25 100644
--- a/modules/tsilo/doc/tsilo_admin.xml
+++ b/modules/tsilo/doc/tsilo_admin.xml
@@ -199,39 +199,6 @@ if (is_method("REGISTER")) {
 	</section>
 
 	<section>
-		<title>MI Commands</title>
-		<section id="tsilo.mi.ts_dump">
-			<title>
-			<function moreinfo="none">ts_dump</function>
-			</title>
-			<para>
-			Dumps the entire content of the TSILO table
-			</para>
-			<para>Parameters: </para>
-			<itemizedlist>
-				<listitem><para>
-					<emphasis>brief</emphasis> - (optional, may not be present); if
-					equals to string <quote>brief</quote>, a brief dump will be
-					done (only RURI, without the transaction(s) details)
-				</para></listitem>
-			</itemizedlist>
-		</section>
-		<section id="tsilo.mi.ts_lookup">
-			<title>
-			<function moreinfo="none">ts_lookup</function>
-			</title>
-			<para>
-			Dumps the transactions stored for the given RURI
-			</para>
-			<para>Parameters: </para>
-			<itemizedlist>
-				<listitem><para>
-					<emphasis>ruri</emphasis> - RURI for which we want to show the transactions.
-				</para></listitem>
-			</itemizedlist>
-		</section>
-	</section>
-	<section>
 	<title>Exported RPC Functions</title>
 		<section>
 			<title><varname>ts.dump</varname></title>
diff --git a/modules/tsilo/tsilo.c b/modules/tsilo/tsilo.c
index 9c404dd..a0e9a21 100644
--- a/modules/tsilo/tsilo.c
+++ b/modules/tsilo/tsilo.c
@@ -33,12 +33,13 @@
 #include "../../modules/registrar/api.h"
 #include "../../dset.h"
 #include "../../lib/kmi/mi.h"
+#include "../../rpc_lookup.h"
 
 #include "ts_hash.h"
 #include "ts_handlers.h"
 #include "ts_append.h"
 #include "ts_store.h"
-#include "ts_mi.h"
+#include "ts_rpc.h"
 
 MODULE_VERSION
 
@@ -71,12 +72,6 @@ static cmd_export_t cmds[]={
 	{0,0,0,0,0}
 };
 
-static mi_export_t mi_cmds[] = {
-	{ "ts_dump",		mi_tsilo_dump,		0,	0,	0 },
-	{ "ts_lookup",		mi_tsilo_lookup,	0,	0,	0 },
-    { 0, 0, 0, 0, 0}
-};
-
 static param_export_t params[]={
 	{"hash_size",	INT_PARAM,	&hash_size},
 	{0,0,0}
@@ -90,7 +85,7 @@ struct module_exports exports= {
 	cmds,
 	params,
 	0, /* exported statistics */
-    mi_cmds,    /* exported MI functions */
+    0,    /* exported MI functions */
     0,
     0,
 	mod_init,   /* module initialization function */
@@ -106,13 +101,12 @@ static int mod_init(void)
 {
 	unsigned int n;
 
-	/* register the MI commands */
-	if(register_mi_mod(exports.name, mi_cmds)!=0)
+	/* register the RPC methods */
+	if(rpc_register_array(rpc_methods)!=0)
     {
-        LM_ERR("failed to register MI commands\n");
+        LM_ERR("failed to register RPC commands\n");
         return -1;
     }
-
 	/* load the TM API */
 	if (load_tm_api(&_tmb)!=0) {
 		LM_ERR("can't load TM API\n");




More information about the sr-dev mailing list