Hello, indeed, the format was wrong, I just pushed a patch for it in master and branch 5.0:
- https://github.com/kamailio/kamailio/commit/0956257ae6fdc0a801ce109017089ac18018e63b Cheers, Daniel On 03.11.17 17:01, Marrold wrote: > Hi All, > > I am currently trying to retrieve the contents of a htable using the > JSONRPC-S module over HTTP, however I have observed if a slot contains > multiple values, the JSON returned has duplicate keys which could be > considered invalid. > > Here are the relevant lines from kamailio.cfg - > > event_route[xhttp:request] { > if ($hu =~ "^/carrier") { > jsonrpc_exec('{"jsonrpc": "2.0", "method": "htable.dump", > "params" : {"htable": "carrier"}, "id": 1}'); > xhttp_reply("200", "OK", "text/html", "$jsonrpl(body)"); > } > } > > And the output, showing a slot with two items- > > > { > "entry": 5, > "size": 2, > "slot": { > "item": { > "name": "carrierA", > "value": "90", > "type": "str" > }, > "item": { > "name": "carrierB", > "value": "190", > "type": "str" > } > } > } > > And the same from `kamcmd -s unix:/tmp/kamailio_ctl htable.dump carrier` - > > { > entry: 5 > size: 2 > slot: { > item: { > name: carrierA > value: 90 > type: str > } > item: { > name: carrierB > value: 190 > type: str > } > } > } > > Would it be possible to change it to something like the following - > > { > "entry": 5, > "size": 2, > "slot": [ > { > "name": "carrierA", > "value": "90", > "type": "str" > }, > { > "name": "carrierB", > "value": "190", > "type": "str" > } > ] > } > > Any other suggestions or work arounds would be appreciated, > > Thanks > Matthew > > > > _______________________________________________ > Kamailio (SER) - Users Mailing List > [email protected] > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla www.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio Advanced Training, Nov 13-15, 2017, in Berlin - www.asipto.com Kamailio World Conference - www.kamailioworld.com
_______________________________________________ Kamailio (SER) - Users Mailing List [email protected] https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
