Greetings list,
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.
listen=tcp:0.0.0.0:5060
loadmodule "xhttp"
loadmodule "jsonrpc-s"
modparam("xhttp", "url_match", "^/rpc_path/")
modparam("jsonrpc-s", "pretty_format", 1)
event_route[xhttp:request] {
if($hu =~ "^/rpc_path")
jsonrpc_dispatch();
else
xhttp_reply("404", "Not Found", "text/html",
"");
}
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"}'
http://127.0.0.1:5060/rpc_path/
I am getting this in respose.
* Hostname was NOT found in DNS cache
* Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 5060 (#0)
POST /rpc_path/ HTTP/1.1
User-Agent: curl/7.38.0
Host: 127.0.0.1:5060
Accept: */*
Content-Type: application/json
Call-ID: abc12
Content-Length: 106
* upload completely sent off: 106 out of 106 bytes
*< HTTP/1.1 404 Profile not found: 1234567*
< Sia: SIP/2.0/TCP 127.0.0.1:49374
< Call-ID: abc12
< Content-Type: application/json
* Server kamailio (4.4.1 (x86_64/linux)) is not blacklisted
< Server: kamailio (4.4.1 (x86_64/linux))
< Content-Length: 106
<
{
"jsonrpc": "2.0",
"error": {
"code": -32000,
"message": "Execution Error"
},
"id": "0deadb33f"
* Connection #0 to host 127.0.0.1 left intact
Whereas fifo command gives me this.
root@debian:/usr/local/kamailio/sbin# ./kamctl fifo profile_get_size
accountno 1234567
profile:: name=accountno value=1234567 count=2
Why jsonrpc-s is search for profile 1234567 whereas profile should be
accountno.
Anyhelp what i am doing wrong here is much appreciated.
Best Regards.