Browse Source

mi_rpc: call init mi child based on core advertising of handling rpc commands

- update of the way to prepare sip workers to execute mi commands via rpc
Daniel-Constantin Mierla 14 years ago
parent
commit
30f501c092
1 changed files with 2 additions and 9 deletions
  1. 2 9
      modules/mi_rpc/mi_rpc_mod.c

+ 2 - 9
modules/mi_rpc/mi_rpc_mod.c

@@ -78,19 +78,12 @@ struct module_exports exports = {
 
 static int child_init(int rank)
 {
-	if(rank==PROC_RPC) {
+	if(is_rpc_worker(rank)) {
+		LM_DBG("initializing child[%d] for rpc handling\n", rank);
 		if(init_mi_child()!=0) {
 			LM_CRIT("Failed to init the mi commands\n");
 			return -1;
 		}
-	} else if(rank>0) {
-		if(find_module_by_name("xmlrpc")!=0)
-		{
-			if(init_mi_child()!=0) {
-				LM_CRIT("Failed to init the mi commands for xmlrpc usage\n");
-				return -1;
-			}
-		}
 	}
 
 	return 0;