<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body 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>
<br>
<div class="moz-cite-prefix">On 10/11/16 09:35, Aqs Younas wrote:<br>
</div>
<blockquote
cite="mid:CAGVOjVXpGwXTJSktm9Ezu1S+-BcB-ottvXWJ0D-fhGz_gtiaUg@mail.gmail.com"
type="cite">
<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" target="_blank" style="font-size:12.8px">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":{"accountno":
"1234567"}, "id": "0deadb33f"}' <a moz-do-not-send="true"
href="http://127.0.0.1:5060/rpc_path/">http://127.0.0.1:5060/rpc_path/</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">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">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/kamailio/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="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<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>