[SR-Users] Parsing json file on kamailio.cfg file

Melek Oktay melekoktay at gmail.com
Tue Sep 24 10:42:21 CEST 2019


Hi,

I am trying to monitor *uac *channels status periodically in kamailio
config file.
I call  uac.reg_dump  rpc command and result will be inside in
$var(uac_channel) variable

 jsonrpc_exec('{"jsonrpc": "2.0", "method": "uac.reg_dump"}');
$var(uac_channel) = $jsonrpl(body);

it returns me json formatted result like below, it has a several channels
info and their status *flags*

{"jsonrpc":"2.0", "result":[
{"l_uuid":"YY","l_username":"YY","l_domain":"YY","r_username":"YY",".,  "
*flags*":16   },
{"l_uuid":"XX","l_username":"XX","l_domain":"XX","r_username":"XX",,... "
*flags*":1 }}]}

I could not parse this result on kamailio.cfg file ! I want to learn
channel that has a 16 value in flag attribute for example !!

Would you help me to figure out how I am gonna parse this json file please ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20190924/bec226f4/attachment.html>


More information about the sr-users mailing list