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

Melek Oktay melekoktay at gmail.com
Tue Sep 24 12:09:43 CEST 2019


Hi again,

Thanks for help Daniel, it helps much

Regards,
Melek

On Tue, Sep 24, 2019 at 10:53 AM Daniel-Constantin Mierla <miconda at gmail.com>
wrote:

> Hello,
>
> have you looked at jansson module? Is it not offering what you need?
>
> Cheers,
> Daniel
> On 24.09.19 10:42, Melek Oktay wrote:
>
> 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
> ?
>
>
>
> _______________________________________________
> Kamailio (SER) - Users Mailing Listsr-users at lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> --
> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- https://asipto.com/u/kat
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20190924/71618bcb/attachment.html>


More information about the sr-users mailing list