<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hello,</p>
<p>you provide only one parameter to the rpc command.</p>
<p>You can try with:<br>
</p>
<p>{"jsonrpc": "2.0", "method": "dlg.profile_get_size","params":{"profile":
"accountno", "value": "1234567"}, "id": "0deadb33f"}<br>
</p>
The name of parameters doesn't matter, the order is important, so
you can also try with:<br>
<br>
{"jsonrpc": "2.0", "method":
"dlg.profile_get_size","params":["accountno","1234567"], "id":
"0deadb33f"}<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<div class="moz-cite-prefix">On 11/11/16 08:08, Aqs Younas wrote:<br>
</div>
<blockquote
cite="mid:CAGVOjVWHbMp1rdAHXBEvsTVCgu36-+jGE5H92bETs13YgQPCmw@mail.gmail.com"
type="cite">
<div dir="ltr">Any thoughts?</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 10 November 2016 at 15:02, Aqs
Younas <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:aqsyounas@gmail.com" target="_blank">aqsyounas@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><span style="color:rgb(84,84,84)">Many thanks
for the prompt reply. Below are requested logs. </span>
<div><span style="color:rgb(84,84,84)"><br>
</span></div>
<div>
<div><font color="#545454">root@debian:/usr/local/<wbr>kamailio/sbin#
Nov 10 04:56:34 debian ./kamailio[5527]: DEBUG:
<core> [ip_addr.c:229]: print_ip():
tcpconn_new: new tcp connection: 127.0.0.1</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5527]: DEBUG: <core>
[tcp_main.c:985]: tcpconn_new(): on port 49396, type
2</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5527]: DEBUG: <core>
[tcp_main.c:1295]: tcpconn_add(): hashes:
395:373:662, 1</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5527]: DEBUG: <core>
[io_wait.h:376]: io_watch_add(): DBG:
io_watch_add(0xa1d280, 38, 2, 0x7f5abcd36708),
fd_no=31</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5527]: DEBUG: <core>
[io_wait.h:598]: io_watch_del(): DBG: io_watch_del
(0xa1d280, 38, -1, 0x0) fd_no=32 called</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5527]: DEBUG: <core>
[tcp_main.c:4131]: handle_tcpconn_ev(): sending to
child, events 1</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5527]: DEBUG: <core>
[tcp_main.c:3813]: send2child(): selected tcp worker
0 15(5515) for activity on [tcp:<a
moz-do-not-send="true" href="http://0.0.0.0:5060"
target="_blank">0.0.0.0:5060</a>], 0x7f5abcd3670</font></div>
<div><font color="#545454">8</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[tcp_read.c:1566]: handle_io(): received n=8
con=0x7f5abcd36708, fd=10</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[tcp_read.c:1366]: tcp_read_req():
content-length=105</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[parser/msg_parser.c:608]: parse_msg(): SIP Request:</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[parser/msg_parser.c:610]: parse_msg(): method:
<POST></font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[parser/msg_parser.c:612]: parse_msg(): uri:
</rpc_path/></font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[parser/msg_parser.c:614]: parse_msg(): version:
<HTTP/1.1></font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[parser/msg_parser.c:187]: get_hdr_field(): DEBUG:
get_hdr_body : content_length=105</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[parser/msg_parser.c:89]: get_hdr_field(): found end
of header</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[receive.c:178]: receive_msg(): After parse_msg...</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: xhttp [xhttp_mod.c:356]:
xhttp_handler(): new fake msg created (296
bytes):#012<POST /rpc_path/ HTTP/1.1#015#012Via:
SIP</font></div>
<div><font color="#545454">/2.0/TCP <a
moz-do-not-send="true"
href="http://127.0.0.1:49396#015%23012User-Agent"
target="_blank">127.0.0.1:49396#015#012User-<wbr>Agent</a>:
curl/7.38.0#015#012Host: <a moz-do-not-send="true"
href="http://127.0.0.1:5060#015%23012Accept"
target="_blank">127.0.0.1:5060#015#012Accept</a>:
*/*#015#012Content-Type:
application/json#015#012Call-<wbr>ID: abc12#015#0</font></div>
<div><font color="#545454">12Content-Length:
105#015#012#015#012{"jsonrpc": "2.0", "method":
"dlg.profile_get_size","<wbr>params":{"accountno":
"1234567"}, "id": "0deadb33f"}></font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[parser/msg_parser.c:608]: parse_msg(): SIP Request:</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[parser/msg_parser.c:610]: parse_msg(): method:
<POST></font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[parser/msg_parser.c:612]: parse_msg(): uri:
</rpc_path/></font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[parser/msg_parser.c:614]: parse_msg(): version:
<HTTP/1.1></font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[parser/parse_via.c:2642]: parse_via(): end of
header reached, state=5</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[parser/msg_parser.c:496]: parse_headers():
parse_headers: Via found, flags=2</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[parser/msg_parser.c:498]: parse_headers():
parse_headers: this is the first via</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[parser/msg_parser.c:187]: get_hdr_field(): DEBUG:
get_hdr_body : content_length=105</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[parser/msg_parser.c:89]: get_hdr_field(): found end
of header</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: sl [sl.c:280]:
send_reply(): reply in stateless mode (sl)</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[msg_translator.c:158]: check_via_address():
(127.0.0.1, 127.0.0.1, 0)</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[tcp_main.c:2196]: tcpconn_send_put(): send from
reader (5515 (15)), reusing fd</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[tcp_main.c:2430]: tcpconn_do_send(): sending...</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[tcp_main.c:2464]: tcpconn_do_send(): after real
write: c= 0x7f5abcd36708 n=293 fd=10</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[tcp_main.c:2465]: tcpconn_do_send():
buf=#012HTTP/1.1 404 Profile not found:
1234567#015#012Sia: SIP/2.0/TCP <a
moz-do-not-send="true"
href="http://127.0.0.1:49396#015%23012Call-ID"
target="_blank">127.0.0.1:49396#015#012Call-ID</a><wbr>:
abc12#015#012Content-Type: application/json#015#<wbr>012Server:
kamailio (4.4.1 (x86_64/linux))#015#<wbr>012Content-Length:
106#015#012#015#012{#012#011"<wbr>jsonrpc":#011"2.0",#012#011"<wbr>error":#011{#012#011#011"code"<wbr>:#011-32000,#012#011#011"<wbr>message":#011"Execution
Error"#012#011},#012#011"id":#<wbr>011"0deadb33f"#012}</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[usr_avp.c:631]: destroy_avp_list(): destroying list
(nil)</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[usr_avp.c:631]: destroy_avp_list(): destroying list
(nil)</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[usr_avp.c:631]: destroy_avp_list(): destroying list
(nil)</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[usr_avp.c:631]: destroy_avp_list(): destroying list
(nil)</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[usr_avp.c:631]: destroy_avp_list(): destroying list
(nil)</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[usr_avp.c:631]: destroy_avp_list(): destroying list
(nil)</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core> [xavp.c:446]:
xavp_destroy_list(): destroying xavp list (nil)</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[receive.c:322]: receive_msg(): cleaning up</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[io_wait.h:376]: io_watch_add(): DBG:
io_watch_add(0xa76680, 10, 2, 0x7f5abcd36708),
fd_no=1</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[tcp_read.c:195]: tcp_make_closed_event(): TCP
closed event creation triggered</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[tcp_read.c:203]: tcp_make_closed_event(): no
callback registering for handling TCP closed event -
dropping!</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[tcp_read.c:310]: tcp_read_data(): EOF on
0x7f5abcd36708, FD 10 ([127.0.0.1]:49396 ->
[127.0.0.1]:5060)</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[tcp_read.c:1342]: tcp_read_req(): EOF</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[io_wait.h:598]: io_watch_del(): DBG: io_watch_del
(0xa76680, 10, -1, 0x10) fd_no=2 called</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[tcp_read.c:1490]: release_tcpconn(): releasing con
0x7f5abcd36708, state -1, fd=10, id=1
([127.0.0.1]:49396 -> [127.0.0.1]:5060)</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5515]: DEBUG: <core>
[tcp_read.c:1491]: release_tcpconn(): extra_data
(nil)</font></div>
<div><font color="#545454">Nov 10 04:56:34 debian
./kamailio[5527]: DEBUG: <core>
[tcp_main.c:3243]: handle_tcp_child(): reader
response= 7f5abcd36708, -1 from 0</font></div>
<div style="color:rgb(84,84,84)"><br>
Let me know if you need anything else. </div>
</div>
<div style="color:rgb(84,84,84)">Best Regards. </div>
</div>
<div class="HOEnZb">
<div class="h5">
<div class="gmail_extra"><br>
<div class="gmail_quote">On 10 November 2016 at 13:47,
Daniel-Constantin Mierla <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<p>Hello,</p>
<p>can you get the log messages with debug=3 in
kamailio.cfg for the execution of the rpc
command?</p>
<p>Cheers,<br>
Daniel<br>
</p>
<div>
<div class="m_-7387826325444807754h5"> <br>
<div
class="m_-7387826325444807754m_9179590804740913670moz-cite-prefix">On
10/11/16 09:35, Aqs Younas wrote:<br>
</div>
</div>
</div>
<blockquote type="cite">
<div>
<div class="m_-7387826325444807754h5">
<div dir="ltr">Greetings list,
<div><br>
</div>
<div>I am trying to get profile size
with jsonrpc-s module. Below is
jsonrpc-s configuration and a curl
command to get the profile size. </div>
<div><br>
</div>
<div><span style="font-size:12.8px">listen=tcp:</span><a
moz-do-not-send="true"
href="http://0.0.0.0:5060/"
rel="noreferrer"
style="font-size:12.8px"
target="_blank">0.0.0.0:5060</a><br
style="font-size:12.8px">
<br style="font-size:12.8px">
<span style="font-size:12.8px">loadmodule
"xhttp"</span><br
style="font-size:12.8px">
<span style="font-size:12.8px">loadmodule
"jsonrpc-s"</span><br
style="font-size:12.8px">
<br style="font-size:12.8px">
<span style="font-size:12.8px">modparam("xhttp",
"url_match", "^/rpc_path/")</span><br
style="font-size:12.8px">
<span style="font-size:12.8px">modparam("jsonrpc-s",
"pretty_format", 1)</span><br
style="font-size:12.8px">
<br style="font-size:12.8px">
<span style="font-size:12.8px">event_route[xhttp:request]
{</span><br style="font-size:12.8px">
<span style="font-size:12.8px">
if($hu =~ "^/rpc_path")</span><br
style="font-size:12.8px">
<span style="font-size:12.8px">
jsonrpc_dispatch();</span><br
style="font-size:12.8px">
<span style="font-size:12.8px"> else</span><br
style="font-size:12.8px">
<span style="font-size:12.8px">
xhttp_reply("404", "Not Found",
"text/html", "");</span><br
style="font-size:12.8px">
<span style="font-size:12.8px">}</span><br>
</div>
<div><span style="font-size:12.8px"><br>
</span></div>
<div><span style="font-size:12.8px">curl
-v -H 'Content-Type:
application/json' -H 'Call-ID:
abc12' -d '{"jsonrpc": "2.0",
"method":
"dlg.profile_get_size","params<wbr>":{"accountno":
"1234567"}, "id": "0deadb33f"}' <a
moz-do-not-send="true"
href="http://127.0.0.1:5060/rpc_path/"
target="_blank">http://127.0.0.1:5060/rpc_path<wbr>/</a></span><br>
</div>
<div><span style="font-size:12.8px"><br>
</span></div>
<div><span style="font-size:12.8px">I am
getting this in respose.</span></div>
<div><span style="font-size:12.8px"><br>
</span></div>
<div><span style="font-size:12.8px"> *
Hostname was NOT found in DNS cache</span></div>
<div><span style="font-size:12.8px">*
Trying 127.0.0.1...</span></div>
<div><span style="font-size:12.8px">*
Connected to 127.0.0.1 (127.0.0.1)
port 5060 (#0)</span></div>
<div><span style="font-size:12.8px">>
POST /rpc_path/ HTTP/1.1</span></div>
<div><span style="font-size:12.8px">>
User-Agent: curl/7.38.0</span></div>
<div><span style="font-size:12.8px">>
Host: <a moz-do-not-send="true"
href="http://127.0.0.1:5060"
target="_blank">127.0.0.1:5060</a></span></div>
<div><span style="font-size:12.8px">>
Accept: */*</span></div>
<div><span style="font-size:12.8px">>
Content-Type: application/json</span></div>
<div><span style="font-size:12.8px">>
Call-ID: abc12</span></div>
<div><span style="font-size:12.8px">>
Content-Length: 106</span></div>
<div><span style="font-size:12.8px">></span></div>
<div><span style="font-size:12.8px">*
upload completely sent off: 106 out
of 106 bytes</span></div>
<div><span style="font-size:12.8px"><b><
HTTP/1.1 404 Profile not found:
1234567</b></span></div>
<div><span style="font-size:12.8px"><
Sia: SIP/2.0/TCP <a
moz-do-not-send="true"
href="http://127.0.0.1:49374"
target="_blank">127.0.0.1:49374</a></span></div>
<div><span style="font-size:12.8px"><
Call-ID: abc12</span></div>
<div><span style="font-size:12.8px"><
Content-Type: application/json</span></div>
<div><span style="font-size:12.8px">*
Server kamailio (4.4.1
(x86_64/linux)) is not blacklisted</span></div>
<div><span style="font-size:12.8px"><
Server: kamailio (4.4.1
(x86_64/linux))</span></div>
<div><span style="font-size:12.8px"><
Content-Length: 106</span></div>
<div><span style="font-size:12.8px"><</span></div>
<div><span style="font-size:12.8px">{</span></div>
<div><span style="font-size:12.8px">
"jsonrpc": "2.0",</span></div>
<div><span style="font-size:12.8px">
"error": {</span></div>
<div><span style="font-size:12.8px">
"code": -32000,</span></div>
<div><span style="font-size:12.8px">
"message":
"Execution Error"</span></div>
<div><span style="font-size:12.8px">
},</span></div>
<div><span style="font-size:12.8px">
"id": "0deadb33f"</span></div>
<div><span style="font-size:12.8px">*
Connection #0 to host 127.0.0.1 left
intact</span></div>
<div><br>
</div>
<div>Whereas fifo command gives me
this. <br>
</div>
<div>
<div>root@debian:/usr/local/kamaili<wbr>o/sbin#
./kamctl fifo profile_get_size
accountno 1234567</div>
<div>profile:: name=accountno
value=1234567 count=2</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Why jsonrpc-s is search for profile
1234567 whereas profile should be
accountno. <br>
<br>
Anyhelp what i am doing wrong here is
much appreciated. </div>
<div><br>
</div>
<div>Best Regards. </div>
</div>
<br>
<fieldset
class="m_-7387826325444807754m_9179590804740913670mimeAttachmentHeader"></fieldset>
<br>
</div>
</div>
<pre>______________________________<wbr>_________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" class="m_-7387826325444807754m_9179590804740913670moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" class="m_-7387826325444807754m_9179590804740913670moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cg<wbr>i-bin/mailman/listinfo/sr-user<wbr>s</a><span class="m_-7387826325444807754HOEnZb"><font color="#888888">
</font></span></pre><span class="m_-7387826325444807754HOEnZb"><font color="#888888">
</font></span></blockquote><span class="m_-7387826325444807754HOEnZb"><font color="#888888">
<pre class="m_-7387826325444807754m_9179590804740913670moz-signature" cols="72">--
Daniel-Constantin Mierla
<a moz-do-not-send="true" class="m_-7387826325444807754m_9179590804740913670moz-txt-link-freetext" href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" class="m_-7387826325444807754m_9179590804740913670moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/mic<wbr>onda</a>
Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - <a moz-do-not-send="true" class="m_-7387826325444807754m_9179590804740913670moz-txt-link-freetext" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></pre>
</font></span></div>
______________________________<wbr>_________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">http://lists.sip-router.org/cg<wbr>i-bin/mailman/listinfo/sr-user<wbr>s</a>
</blockquote></div>
</div>
</div></div></blockquote></div>
</div>
</blockquote>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre></body></html>