Parcourir la source

modules/websocket: added warning when websocket module is loaded in a configuration without either the nathelper or outbound modules

Peter Dunkley il y a 12 ans
Parent
commit
b220a571d0
1 fichiers modifiés avec 9 ajouts et 1 suppressions
  1. 9 1
      modules/websocket/ws_mod.c

+ 9 - 1
modules/websocket/ws_mod.c

@@ -265,12 +265,20 @@ static int mod_init(void)
 	}
 	}
 
 
 	if (cfg_declare("websocket", ws_cfg_def, &default_ws_cfg,
 	if (cfg_declare("websocket", ws_cfg_def, &default_ws_cfg,
-			cfg_sizeof(websocket), &ws_cfg)) {
+			cfg_sizeof(websocket), &ws_cfg))
+	{
 		LM_ERR("declaring configuration\n");
 		LM_ERR("declaring configuration\n");
 		return -1;
 		return -1;
 	}
 	}
 	cfg_get(websocket, ws_cfg, keepalive_timeout) = ws_keepalive_timeout;
 	cfg_get(websocket, ws_cfg, keepalive_timeout) = ws_keepalive_timeout;
 
 
+	if (!module_loaded("nathelper") && !module_loaded("outbound"))
+	{
+		LM_WARN("neither \"nathelper\" nor \"outbound\" modules are"
+			" loaded. At least one of these is required for correct"
+			" routing of SIP over WebSocket.\n");
+	}
+
 	return 0;
 	return 0;
 
 
 error:
 error: