[SR-Users] execute config route by ctp command?

Juha Heinanen jh at tutpro.com
Mon Feb 6 20:00:13 CET 2017


Daniel-Constantin Mierla writes:

> > I'm not aware of one, but xhttp requests inherently trigger an event_route:
> >
> > http://kamailio.org/docs/modules/4.4.x/modules/xhttp.html#idp49731828
> >
> > If you had a need to execute some other logic that cannot be located
> > there, I suppose you could do something like:
> >
> > event_route[xhttp:request] {
> >         if($hu =~ "^/juha_special_rpc_path") {
> >                 route(THE_ROUTE);
> > 		xhttp_reply("200", "OK", "text/plain", "");
> >         } else
> >                 xhttp_reply("404", "Not Found", "text/html", "");
> > }
> >
> >
> This is also how the jsonrpcs module can execute the rpc commands:

Thanks for the answers.  I decided to use the former solution, because I
already had event_route[xhttp:request] in my config.

-- Juha



More information about the sr-users mailing list