Forráskód Böngészése

modules_k/rls: Fixed issues with new RLS MI command

- Renamed "cleanup" to "rls_cleanup" so it doesn't conflict with the presence
  MI command of the same name.
- I'd forgotton to register the MI commands in mod_init()
Peter Dunkley 13 éve
szülő
commit
bdaeb24dd8
1 módosított fájl, 19 hozzáadás és 13 törlés
  1. 19 13
      modules_k/rls/rls.c

+ 19 - 13
modules_k/rls/rls.c

@@ -256,24 +256,24 @@ static param_export_t params[]={
 };
 
 static mi_export_t mi_cmds[] = {
-	{ "cleanup",		mi_cleanup,		0,  0,  mi_child_init},
+	{ "rls_cleanup",	mi_cleanup,		0,  0,  mi_child_init},
 	{ 0,			0,			0,  0,  0}
 };
 
 /** module exports */
 struct module_exports exports= {
-	"rls",  					/* module name */
-	DEFAULT_DLFLAGS,				/* dlopen flags */
-	cmds,						/* exported functions */
-	params,						/* exported parameters */
-	0,						/* exported statistics */
-	mi_cmds,      					/* exported MI functions */
-	0,						/* exported pseudo-variables */
-	0,						/* extra processes */
-	mod_init,					/* module initialization function */
-	0,						/* response handling function */
-	(destroy_function) destroy,			/* destroy function */
-	child_init					/* per-child init function */
+	"rls",  			/* module name */
+	DEFAULT_DLFLAGS,		/* dlopen flags */
+	cmds,				/* exported functions */
+	params,				/* exported parameters */
+	0,				/* exported statistics */
+	mi_cmds,      			/* exported MI functions */
+	0,				/* exported pseudo-variables */
+	0,				/* extra processes */
+	mod_init,			/* module initialization function */
+	0,				/* response handling function */
+	(destroy_function) destroy,	/* destroy function */
+	child_init			/* per-child init function */
 };
 
 /**
@@ -293,6 +293,12 @@ static int mod_init(void)
 
 	LM_DBG("start\n");
 
+	if (register_mi_mod(exports.name, mi_cmds)!=0)
+	{
+		LM_ERR("failed to register MI commands\n");
+		return -1;
+	}
+
 	if (dbmode <RLS_DB_DEFAULT || dbmode > RLS_DB_ONLY)
 	{
 		LM_ERR( "Invalid dbmode-set to default mode\n" );