[SR-Users] kamailio jsonrpc client
Aidar Kamalov
aidar.kamalov at gmail.com
Tue Sep 19 10:54:36 CEST 2017
Hello,
cannot get working rpc client n kamailio.
[root at sipchel kamailio]# grep 'json\|jansson' kamailio-default.cfg
loadmodule "jsonrpcs.so"
loadmodule "jansson.so"
loadmodule "janssonrpcc.so"
# jsonrpcs params -----
modparam("jsonrpcs", "pretty_format", 1)
modparam("jsonrpcs", "transport", 3)
# jansson
modparam("janssonrpcc", "server",
"conn=user_db;addr=127.0.0.1;port=5060;priority=10;weight=10");
....
request_route {
...
janssonrpc_request("user_db", "core.version", '', "route=RESPONSE;retry=1");
...
}
....
event_route[xhttp:request] {
if ($hu =~ "^/jsonrpc") {
jsonrpc_dispatch();
} else {
xhttp_reply("200", "OK", "text/html",
"<html><body>Wrong URL $hu</body></html>");
}
return;
}
With this config i got error
Sep 19 08:52:15 sipchel /usr/sbin/kamailio[39891]: INFO: janssonrpcc
[janssonrpc_connect.c:294]: bev_connect(): Connecting to server
127.0.0.1:5060 for conn user_db.
Sep 19 08:52:15 sipchel /usr/sbin/kamailio[39891]: INFO: janssonrpcc
[janssonrpc_connect.c:277]: bev_connect_cb(): Connected to host
127.0.0.1:5060
...
Sep 19 08:52:20 sipchel /usr/sbin/kamailio[39891]: WARNING: janssonrpcc
[janssonrpc_request.c:242]: schedule_retry(): Number of retries exceeded.
Failing request.
Sep 19 08:52:20 sipchel /usr/sbin/kamailio[39891]: WARNING: janssonrpcc
[janssonrpc_io.c:218]: fail_request(): Request timeout:
#012{"id":3,"jsonrpc":"2.0","method":"core.version"}
But
[root at sipchel kamailio]# curl -s -H 'Content-Type: application/json'
--data-binary '{"jsonrpc":"2.0", "method": "core.version"}'
http://localhost:5060/jsonrpc
{
"jsonrpc": "2.0",
"result": "kamailio 5.0.3 (x86_64/linux) "
}
How to get working rpc client in kamailio? Is it possible to define url
for janssonrpcc module?
--
Aydar A. Kamalov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20170919/faf3eb4e/attachment.html>
More information about the sr-users
mailing list