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.

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.