[sr-dev] [kamailio] jsonrpc-s issue with array as result (#368)

Dan Christian Bogos notifications at github.com
Sat Oct 10 18:57:52 CEST 2015


Hey Guys,

I have been playing with jsonrpc-s module and it appears that for some reason it does not properly encapsulate replies containing more than one item.

Sample return via kamcmd:
```
root at iPBXDev1:~# kamcmd -s tcp:127.0.0.1:2046 uac.reg_dump
{
	l_uuid: rsua2
	l_username: rsua2
	l_domain: 172.16.254.101
	r_username: cust_sua2
	r_domain: 172.16.254.102
	realm: 
	auth_username: cust_sua2
	auth_password: check123
	auth_proxy: sip:172.16.254.102
	expires: 3600
	flags: 12
	diff_expires: 3558
	timer_expires: 1444499546
}
{
	l_uuid: rsua1
	l_username: rsua1
	l_domain: 172.16.254.101
	r_username: cust_sua1
	r_domain: 172.16.254.102
	realm: 
	auth_username: cust_sua1
	auth_password: check123
	auth_proxy: sip:172.16.254.102
	expires: 3600
	flags: 4
	diff_expires: 3558
	timer_expires: 1444499546
}
```

Sample return via jsonrpc:
```
T 2015/10/10 18:49:49.250401 172.16.254.102:35371 -> 172.16.254.101:5090 [AP]
POST /jsonrpc HTTP/1.1.
Host: 172.16.254.101:5090.
User-Agent: Go-http-client/1.1.
Content-Length: 60.
Content-Type: application/json.
Accept-Encoding: gzip.
.
{"jsonrpc":"2.0","method":"uac.reg_dump","params":[],"id":0}
##
T 2015/10/10 18:49:49.251097 172.16.254.101:5090 -> 172.16.254.102:35371 [AP]
HTTP/1.1 200 OK.
Sia: SIP/2.0/TCP 172.16.254.102:35371.
Content-Type: application/json.
Server: Sipean-RP 4.3.2.
Content-Length: 325.
.
{"jsonrpc":"2.0","result":{"l_uuid":"rsua1","l_username":"rsua1","l_domain":"172.16.254.101","r_username":"cust_sua1","r_domain":"172.16.254.102","realm":"","auth_username":"cust_sua1","auth_password":"check123","auth_proxy":"sip:172.16.254.102","expires":3600,"flags":0,"diff_expires":217,"timer_expires":1444496006},"id":0}
```

It appears that in second case there is only one item returned (so items overwrite each other).

DanB

---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/368
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20151010/6cf5dee1/attachment.html>


More information about the sr-dev mailing list