<div dir="ltr">Hi All,<br><div><br></div><div>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. <br><br>Here are the relevant lines from kamailio.cfg -</div><div><br>event_route[xhttp:request] {<br>    if ($hu =~ "^/carrier") {<br><div>        jsonrpc_exec('{"jsonrpc": "2.0", "method": "htable.dump", "params" : {"htable": "carrier"}, "id": 1}');</div><div>        xhttp_reply("200", "OK", "text/html", "$jsonrpl(body)");<br>    }</div><div>}<br><br></div><div>And the output, showing a slot with two items-</div><div><br><br></div><div><div>{</div><div><span style="white-space:pre">   </span>"entry": 5,</div><div><span style="white-space:pre"> </span>"size": 2,</div><div><span style="white-space:pre">  </span>"slot": {</div><div><span style="white-space:pre">           </span>"item": {</div><div><span style="white-space:pre">                   </span>"name": "carrierA",</div><div><span style="white-space:pre">                       </span>"value": "90",</div><div><span style="white-space:pre">                    </span>"type": "str"</div><div><span style="white-space:pre">             </span>},</div><div><span style="white-space:pre">            </span>"item": {</div><div><span style="white-space:pre">                   </span>"name": "carrierB",</div><div><span style="white-space:pre">                       </span>"value": "190",</div><div><span style="white-space:pre">                   </span>"type": "str"</div><div><span style="white-space:pre">             </span>}</div><div><span style="white-space:pre">     </span>}</div><div>}<br><br>And the same from `kamcmd -s unix:/tmp/kamailio_ctl htable.dump carrier` -<br><br><div>{</div><div><span style="white-space:pre">      </span>entry: 5</div><div><span style="white-space:pre">      </span>size: 2</div><div><span style="white-space:pre">       </span>slot: {</div><div><span style="white-space:pre">               </span>item: {</div><div><span style="white-space:pre">                       </span>name: carrierA</div><div><span style="white-space:pre">                        </span>value: 90</div><div><span style="white-space:pre">                     </span>type: str</div><div><span style="white-space:pre">             </span>}</div><div><span style="white-space:pre">             </span>item: {</div><div><span style="white-space:pre">                       </span>name: carrierB</div><div><span style="white-space:pre">                        </span>value: 190</div><div><span style="white-space:pre">                    </span>type: str</div><div><span style="white-space:pre">             </span>}</div><div><span style="white-space:pre">     </span>}</div><div>}<br><br>Would it be possible to change it to something like the following -<br><br><div>{</div><div>    "entry": 5,</div><div>    "size": 2,</div><div>    "slot": [</div><div>        {</div><div>            "name": "carrierA",</div><div>            "value": "90",</div><div>            "type": "str"</div><div>        },</div><div>        {</div><div>            "name": "carrierB",</div><div>            "value": "190",</div><div>            "type": "str"</div><div>        }</div><div>    ]</div><div>}<br><br>Any other suggestions or work arounds would be appreciated, </div><div><br>Thanks</div></div><div>Matthew</div><br></div></div></div></div>