|
@@ -100,7 +100,14 @@ int register_mi_mod( char *mod_name, mi_export_t *mis)
|
|
|
|
|
|
static int mi_commands_initialized = 0;
|
|
static int mi_commands_initialized = 0;
|
|
|
|
|
|
-int init_mi_child(void)
|
|
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * Init a process to work properly for MI commands
|
|
|
|
+ * - rank: rank of the process (PROC_XYZ...)
|
|
|
|
+ * - mode: 0 - don't try to init worker for SIP commands
|
|
|
|
+ * 1 - try to init worker for SIP commands
|
|
|
|
+ */
|
|
|
|
+int init_mi_child(int rank, int mode)
|
|
{
|
|
{
|
|
int i;
|
|
int i;
|
|
|
|
|
|
@@ -114,11 +121,13 @@ int init_mi_child(void)
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(is_sip_worker(PROC_NOCHLDINIT)) {
|
|
|
|
- LM_DBG("initalizing proc rpc for sip handling\n");
|
|
|
|
- if(init_child(PROC_SIPRPC)<0) {
|
|
|
|
- LM_ERR("failed to init proc rpc for sip handling\n");
|
|
|
|
- return -1;
|
|
|
|
|
|
+ if(mode==1) {
|
|
|
|
+ if(is_sip_worker(rank)) {
|
|
|
|
+ LM_DBG("initalizing proc rpc for sip handling\n");
|
|
|
|
+ if(init_child(PROC_SIPRPC)<0) {
|
|
|
|
+ LM_ERR("failed to init proc rpc for sip handling\n");
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return 0;
|
|
return 0;
|