Hello!
I need to get some data via RPC to Kamailio inside by external event. But
it seems long values of body brakes something:
loadmodule "xhttp.so"
loadmodule "jsonrpcs.so"
modparam("jsonrpcs", "transport", 0)
1)
event_route[xhttp:request] {
...
jsonrpc_exec('{"jsonrpc": "2.0", "method":
"core.psx", "id": 1}');
xlog("L_ERR","RPC code: $jsonrpl(code) \n");
xlog("L_ERR","RPC text: $jsonrpl(text) \n");
xlog("L_ERR","RPC body: $jsonrpl(body) \n");
return;
}
But in result I do not have body:
Sep 21 14:27:55 /usr/sbin/kamailio[16140]: ERROR: <script>: RPC code: 200
Sep 21 14:27:55 /usr/sbin/kamailio[16140]: ERROR: <script>: RPC text: OK
2)
If I request core.uptime I have something in body:
event_route[xhttp:request] {
...
jsonrpc_exec('{"jsonrpc": "2.0", "method":
"core.uptime", "id": 1}');
xlog("L_ERR","RPC code: $jsonrpl(code) \n");
xlog("L_ERR","RPC text: $jsonrpl(text) \n");
xlog("L_ERR","RPC body: $jsonrpl(body) \n");
return;
}
Sep 21 14:37:17 /usr/sbin/kamailio[22683]: ERROR: <script>: RPC code: 200
Sep 21 14:37:17 /usr/sbin/kamailio[22683]: ERROR: <script>: RPC text: OK
Sep 21 14:37:17 /usr/sbin/kamailio[22683]: ERROR: <script>: RPC body:
{"jsonrpc":"2.0","result":{"now":"Fri Sep 21
14:37:17 2018","up_since":"Fri
Sep 21 14:37:16 2018","uptime":1},"id":1}
[root@kamailio]# kamailio -v
version: kamailio 5.1.2 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE,
USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC,
TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT,
USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST,
HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
--
BR,
Denys Pozniak