In part of profiles and/or variables section while using `static inline void internal_rpc_print_dlg(rpc_t *rpc, void *c, dlg_cell_t *dlg, int with_context) ` May be it is an error of ctl module
``` # kamcmd dlg.list { h_entry: 6718 h_id: 20440 call-id: 48c9fe85f6750163@192.168.5.60 from_uri: sip:000*051@xxxxxx.xx:5068 to_uri: sip:002@xxxxxx.xx:5068 state: 4 start_ts: 1430324850 init_ts: 1430324847 timeout: 1430368049 lifetime: 43200 dflags: 515 sflags: 0 iflags: 0 caller: { tag: bda5e24faa4c4ff5 contact: sip:000*051@192.168.5.60:5066;transport=udp;alias=xxx.xxx.78.202~5066~1 cseq: 5457 route_set: socket: udp:xxx.xxx.66.150:5068 } callee: { tag: 4y2gjr7N9231K contact: sip:002@xxx.xxx.66.151:5080;transport=udp cseq: 0 route_set: socket: udp:xxx.xxx.66.150:5068 } profiles: { ERROR while parsing the record 62, @698: 03 : bad record ```
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/145
This might be kamcmd not handling arrays in response. Arrays were added quite recently and somehow mapped over structure for kamcmd.
Can you give it a try with xmlrpc or jsonrpc to see if the result there is ok? Perhaps you can emulate it with curl command if you don't have another client.
For example:
``` curl -X GET -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "dlg.list", "id": 1}' http://youreserverip:5060/RPC ```
See the readme of jsonrpc-s module for more docs on configuring it.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/145#issuecomment-99223144
Yes, it is "array" using porblem. I use "rpc->struct_add" instead of "rpc->array_add" for my kamcmd purpose, but will happy see fix in 4.x releases ) And yes, it also works fine via jsonrpc-s as array
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/145#issuecomment-99422629
I pushed some commits to master branch to get kamcmd work in such case, soing some basic tests. If the issue is still there, reopen.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/145#issuecomment-135112954
Closed #145.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/145#event-393125665
it woks. for example **json-rpc** ``` ............ "profiles": [{ "call_by_client": "12" }, { "call_by_extension": "54" }, { "call_by_extension": "3" }], ............... ``` **kamcd** ``` .................... profiles: { { call_by_client: 12 } { call_by_extension: 54 } { call_by_extension: 3 } }
...................
backporting to 4.x is appreciated
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/145#issuecomment-136338204
Hi,
I followed miconda's suggestion for jsonrpc. It gives me error as method callback not found. I am using kamailio 4.4 with modules jsonrpc-s, xhttp, mi_fifo and dialplan. Would you suggest me how to solve this?
Json example: curl -X GET -H "Content-Type: application/json" -d'{"jsonrpc":"2.0","method":"dispatcher.reload", "id":"1"}' http://127.0.0.1:5060/RPC
Response:
{ "jsonrpc": "2.0", "error": { "code": -32000, "message": "Execution Error" }, "id": "1"