Hello,
I’m using jsonrpc_dispatch in a "xhttp:request" section (with xhttp and jsonrpcs modules), e.g.:
event_route[xhttp:request] {
if ($hu =~ "^/RPC") {
jsonrpc_dispatch();
exit;
}
xhttp_reply("404", "Not Found", "", "");
exit;
}
This works, but I would like to restrict the RPC functions that can be invoked this way.
Any advice on how I could do that ?
The xhttp module provides "url_skip" and "url_match" but this is not useful because in the URL I only have something like "RPC".
And the method is in the JSON body.
I could parse the JSON body before calling jsonrpc_dispatch, but it’s a bit complicated (I don’t know if it’s feasible in Kamailio script ?), and seems redundant because jsonrpc_dispatch already does that…
Maybe somehow this could be checked from the "void *" second argument passed to the RPC function ?
Thanks.
Regards,
Nicolas.