[sr-dev] list of listeners with ports and advertisements

Daniel-Constantin Mierla miconda at gmail.com
Sat Jun 24 08:17:42 CEST 2017


Hello,


if you use jsonrpcs, there is a functions that you can use to execute
RPC commands from kamailio.cfg and you will get the result as a json
document that you can parse using jansson (or json) module. There is a
rpc command to get listen sockets.


If you prefer to add some pv, I would not involve XAVPs here, but add a
new class of variables which will refer directly to listen structure,
avoiding to duplicate values to xavp (which use shared memory). It can
be like $listen(id), where id can be like: socket, advertise, ... and
for the case of many listen values, and index can be used.

Cheers,
Daniel

On 24.06.17 00:12, Luis Azedo wrote:
>
> Hi,
>
>
> i don't think we can access this info at runtime from the script and i
> was thinking of implementing it.
>
> we have a timer proc that runs a script block and we need to access
> this info from that script.
>
>
> i'm think in adding a (maybe configurable name?) xavp with that info
> that would be available (only needs to evaluate once since listeners
> are not dynamic)
>
>
> what would be the best module to put this ? pv ?
>
>
> Thanks
>
>
>
>
> _______________________________________________
> Kamailio (SER) - Development Mailing List
> sr-dev at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20170624/8f1d5078/attachment-0001.html>


More information about the sr-dev mailing list