Hello,
I am new to Kamailio and I am using Kamailio 5.2. When trying to the load the XHTTP module, event route not found error is thrown and XHTTP is module is not getting loaded. I am trying to use JSONRPC module through HTTP transport for RPC calls. Using XMLRPC, things work fine.
DEBUG: <core> [core/sr_module.c:896]: init_mod(): xhttp ERROR: xhttp [xhttp_mod.c:136]: mod_init(): failed to find event_route[xhttp:request] ERROR: <core> [core/sr_module.c:898]: init_mod(): Error while initializing module xhttp (/usr/lib/kamailio/modules/xhttp.so) ERROR: error while initializing modules
I have added below to Kamailio.cfg file: loadmodule "xhttp.so"
event_route[xhttp:request] { if(src_ip!=127.0.0.1) { xhttp_reply("403", "Forbidden", "text/html", "<html><body>Not allowed from $si</body></html>"); exit; } if ($hu =~ "^/RPC") { jsonrpc_dispatch(); } else { xhttp_reply("200", "OK", "text/html", "<html><body>Wrong URL $hu</body></html>"); } return; }
Any help in this regard.
Thanks, Dhruva
Hello,
check the config file and be sure you do not have the event route block between some #!IFDEF ... #!ENDIF that is not enabled.
Cheers, Daniel
On 13.06.19 13:40, Dhruva TS wrote:
Hello,
I am new to Kamailio and I am using Kamailio 5.2. When trying to the load the XHTTP module, event route not found error is thrown and XHTTP is module is not getting loaded. I am trying to use JSONRPC module through HTTP transport for RPC calls. Using XMLRPC, things work fine.
DEBUG: <core> [core/sr_module.c:896]: init_mod(): xhttp ERROR: xhttp [xhttp_mod.c:136]: mod_init(): failed to find event_route[xhttp:request] ERROR: <core> [core/sr_module.c:898]: init_mod(): Error while initializing module xhttp (/usr/lib/kamailio/modules/xhttp.so) ERROR: error while initializing modules
I have added below to Kamailio.cfg file: loadmodule "xhttp.so"
event_route[xhttp:request] { if(src_ip!=127.0.0.1) { xhttp_reply("403", "Forbidden", "text/html", "<html><body>Not allowed from $si</body></html>"); exit; } if ($hu =~ "^/RPC") { jsonrpc_dispatch(); } else { xhttp_reply("200", "OK", "text/html", "<html><body>Wrong URL $hu</body></html>"); } return; } Any help in this regard.
Thanks, Dhruva
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users