[SR-Users] Missing pipelimit values in data returned by JSONRPC-S

Brooks Bridges bbridges at o1.com
Thu Mar 17 21:44:34 CET 2016


When trying to pull a list of pipes and their current values by using pl.dump via the JSONRPC-S module, I am only getting the last result in the reply as opposed to an array.  If I use the CLI RPC interface I get the data I expect.

Here's a sanitized example:

[root at server1 ~]# kamcmd pl.stats
PIPE: id=user_1 load=0 counter=29
PIPE: id=user_2 load=0 counter=108
PIPE: id=user_3 load=0 counter=18
PIPE: id=user_4 load=0 counter=0
PIPE: id=user_5 load=0 counter=1
PIPE: id=user_6 load=0 counter=2
PIPE: id=user_7 load=0 counter=0
PIPE: id=user_8 load=0 counter=84
PIPE: id=user_9 load=0 counter=26
PIPE: id=user_10 load=0 counter=0
PIPE: id=user_11 load=0 counter=23
PIPE: id=user_12 load=0 counter=9
PIPE: id=user_13 load=0 counter=23
PIPE: id=user_14 load=0 counter=0
PIPE: id=user_15 load=0 counter=107
PIPE: id=user_16 load=0 counter=10
PIPE: id=user_17 load=0 counter=28
PIPE: id=user_18 load=0 counter=45
PIPE: id=user_19 load=0 counter=7
PIPE: id=user_20 load=0 counter=0
PIPE: id=user_21 load=0 counter=12
PIPE: id=user_22 load=0 counter=94
PIPE: id=user_23 load=0 counter=14
PIPE: id=user_24 load=0 counter=7
PIPE: id=user_25 load=0 counter=18
PIPE: id=user_26 load=0 counter=46
PIPE: id=user_27 load=0 counter=45
PIPE: id=user_28 load=0 counter=50
PIPE: id=user_29 load=0 counter=2
PIPE: id=user_30 load=0 counter=2

[root at server1 ~]# curl -s --header 'Content-Type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "pl.stats"}' http://1.2.3.4:5060/jsonrpc
{"jsonrpc":"2.0","result":"PIPE: id=user_30 load=0 counter=2"}
[root at server1 ~]#



The jsonrpc config and event route is about as basic as you can get:

modparam("jsonrpc-s", "pretty_format", 0)
modparam("jsonrpc-s", "transport", 1)

event_route[xhttp:request] {
                xlog("L_INFO", "[R-HTTP-REQUEST:$si] -> Got HTTP request\n");
                if($hu =~ "^/jsonrpc") {
                                xlog("L_INFO", "[R-XHTTP-REQUEST:$si] -> Handling JSON RPC request: $hu\n");
                                jsonrpc_dispatch();
                } else {
                                xhttp_reply("404", "Not Found", "text/html", "");
                }
}


Should the JSONRPC-S module be returning this as an array instead of just a single value?


Brooks Bridges | Sr. Voice Services Engineer
O1 Communications
5190 Golden Foothill Pkwy
El Dorado Hills, CA 95762
office: 916.235.2097 | main: 888.444.1111, Option 2
email: bbridges at o1.com<mailto:bbridges at o1.com> | web: www.o1.com<http://www.o1.com/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20160317/698f8e39/attachment.html>


More information about the sr-users mailing list