Просмотр исходного кода

mi_rpc: initialize mi cmds for sip workers

- xmlrpc module re-uses sip workers to process xmlrpc request which can
  execute mi commands, therefore is need to initialize mi cmds as for a
  mi process
- initialization is done only when xmlrpc module is loaded
(cherry picked from commit b2b2a82d497ee37428abab933f4862255bc5c4a1)
Daniel-Constantin Mierla 15 лет назад
Родитель
Сommit
59d209fe33
1 измененных файлов с 9 добавлено и 1 удалено
  1. 9 1
      modules/mi_rpc/mi_rpc_mod.c

+ 9 - 1
modules/mi_rpc/mi_rpc_mod.c

@@ -79,10 +79,18 @@ struct module_exports exports = {
 static int child_init(int rank)
 {
 	if(rank==PROC_RPC) {
-		if( init_mi_child()!=0) {
+		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;