Gente,
ya se encuentra funcionando, muchas gracias por toda la colaboración.
La conf. quedó de la siguiente manera, por si alguno le interesa.
disable_tcp=no
tcp_accept_no_cl=yes
#####Modulos para Request Reload mtree#####
loadmodule "xhttp.so"
loadmodule "jsonrpcs.so"
#sudo apt-get install kamailio-json-modules#
loadmodule "json.so"
#######
event_route[xhttp:request] {
if!(dst_port==8080) {
xlog("L_NOTICE", "[XHTTP:REQUEST] $si FORBIDDEN! ***\n");
exit;
}
if(src_ip!=192.168.224.184) {
xhttp_reply("403", "Forbidden", "text/html",
"<html><body>Not allowed from $si</body></html>");
xlog("L_NOTICE", "[XHTTP:REQUEST] NOT ALLOWED FROM $si! ***\n");
exit;
}
if ($hu =~ "^/mtree") {
$var(dbmtree) =$(rb{json.parse,db});
xlog("L_NOTICE", "[XHTTP:REQUEST] $si:$sp - db: $var(dbmtree) ACCEPTED ***\n");
$var(json_rpc)='{"jsonrpc": "2.0", "method": "mtree.reload", "id": "$var(dbmtree)"}';
jsonrpc_exec($var(json_rpc));
xlog("L_NOTICE","jsonrpc response code: $jsonrpl(code) - the body is: $jsonrpl(body)\n");
xhttp_reply("200", "Forbidden", "text/html",
"<html><body>OK - [$si:$sp - db: $var(dbmtree)]</body></html>");
} else {
xhttp_reply("200", "OK", "text/html",
"<html><body>Wrong URL $hu</body></html>");
xlog("L_NOTICE", "[XHTTP:REQUEST] WRONG URL $hu! ***\n");
}
return;
}
Saludos.