<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>For the benefit of anyone else struggling with this, I eventually
worked out that the example in the documentation should read:</p>
<p>{"jsonrpc":"2.0","method":"get_statistics","id":"1065",
"params":[["dialog:", "tm:"]]}</p>
<p>This sets the list of statistics as an array in the params array
(note the extra []).<br>
</p>
<p>It's such a simple thing, but it has taken me 8 hours of trial
and error to work out what was wrong.<br>
</p>
<p><font face="Verdana, Helvetica, Sans-Serif" color="#000000"><br>
</font></p>
<p><font face="Verdana, Helvetica, Sans-Serif" color="#000000">Kind
regards,</font></p>
<font face="Verdana, Helvetica, Sans-Serif" color="#000000">Adrian
Fretwell</font>
<p><font face="Verdana, Helvetica, Sans-Serif" color="#000000">Sibthorpe</font><font
face="Verdana, Helvetica, Sans-Serif" color="#000000"><br>
</font></p>
<p><font face="Verdana, Helvetica, Sans-Serif" color="#000000">Nottinghamshire</font><br>
</p>
<font face="Verdana, Helvetica, Sans-Serif" color="#000000">
UK.<br>
</font>
<p><br>
</p>
<p><br>
</p>
<font face="Verdana, Helvetica, Sans-Serif" color="#000000"></font>On
05/07/2020 20:48, Adrian Fretwell wrote:<br>
<blockquote type="cite"
cite="mid:d17a8b87-fb6d-2ca4-982d-c4858ebe05a6@topgreen.co.uk">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<p>Hello,</p>
<p>I'm having trouble with any MI command that has parameters over
UDP MI_DATAGRAM.</p>
<p>Below are a couple of captured packets:</p>
<p>U 2020/07/05 20:24:55.472104 185.222.222.247:34176 ->
185.222.222.247:9061 #3<br>
{"jsonrpc":"2.0","method":"get_statistics","id":"1075","params":["dialog:","tm:"]}<br>
</p>
<p><br>
U 2020/07/05 20:24:55.472233 185.222.222.247:9061 ->
185.222.222.247:34176 #4<br>
{"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid
params"},"id":"1075"}<br>
</p>
<p>The request is identical to the example given in <a
moz-do-not-send="true"
href="https://opensips.org/docs/modules/3.0.x/mi_datagram.html">https://opensips.org/docs/modules/3.0.x/mi_datagram.html</a>
But as you can see I get an invalid params error (dialog and tm
modules are both loaded).</p>
<p>A command without params is fine, see below:</p>
<p><br>
U 2020/07/05 20:24:23.650924 185.222.222.247:48846 ->
185.222.222.247:9061 #1<br>
{"jsonrpc":"2.0","method":"which","id":"1065"}<br>
<br>
</p>
<p>U 2020/07/05 20:24:23.651093 185.222.222.247:9061 ->
185.222.222.247:48846 #2<br>
{"jsonrpc":"2.0","result":["get_statistics","list_statistics","reset_statistics","uptime","version","pwd","arg","which","ps","kill","log_level","xlog_level","shm_check","cache_store","cache_fetch","cache_remove","event_subscribe","events_list","subscribers_list","list_tcp_conns","mem_pkg_dump","mem_shm_dump","mem_rpm_dump","reload_routes","help","list_blacklists","t_uac_dlg","t_uac_cancel","t_hash","t_reply","dlg_list","dlg_list_ctx","dlg_end_dlg","dlg_db_sync","dlg_restore_db","dlg_cluster_sync","profile_get_size","profile_list_dlgs","profile_get_values","list_all_profiles","profile_end_dlgs","dlg_push_var","dlg_send_sequential","ul_rm","ul_rm_contact","ul_dump","ul_flush","ul_add","ul_show_contact","ul_sync","ul_cluster_sync","nh_enable_ping","refreshWatchers","refresh_watchers","cleanup","pres_expose","pres_phtable_list","subs_phtable_list","pua_publish","pua_subscribe","rls_update_subscriptions","tcp_trace"],"id":"1065"}<br>
<br>
</p>
<p>Most of the documentation for the modules still shows the old
non JSON way of communicating. Can someone point me in the
right direction please.<br>
</p>
<div class="moz-signature"> <br>
</div>
<font face="Verdana, Helvetica, Sans-Serif" color="#000000">Kind
regards,<br>
<br>
Adrian Fretwell<br>
<br>
Sibthorpe<br>
Nottinghamshire<br>
UK.<br>
</font>
<p><br>
</p>
<small><small><small> </small></small></small> <br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
</body>
</html>