[sr-dev] [kamailio/kamailio] dispatcher: runtime status access from script (#1166)

Daniel-Constantin Mierla notifications at github.com
Tue Jun 27 16:37:06 CEST 2017


The id and description columns are complementary in the database, they must not be loaded in the memory. The id is auto-increment and present in many tables only for provisioning purposes outside of kamailio usage and definitely not for dispatcher needs. Some database backends such as mongodb or berkleydb don't have id column, or it is a string.

I am also not convinced this addition brings any benefits. It is a lot of code for just a little purpose. If you want the status of a destination address, then you can add a functions specific for that - a function that takes an IP address as parameter and sets the value of the state in a variable.

The patch here clones the all dispatcher destinations structure, with all attributes, in xavps.

Moreover, there is an option right now to get all the destinations and their state in a json, via jsnorpcs:

  * https://www.kamailio.org/docs/modules/stable/modules/jsonrpcs.html#jsonrpcs.f.jsonrpc_exec

The you can use jansson module to access the attributes or the state field for destinations.

Ultimately, if you really need this cloning in xavps, maybe it is time to add a new module in top of dispatcher, with dispatcher exposing some inter-module api to access its structure. Otherwise I really want to keep dispatcher as lightweight as possible, its purpose is to be very slim/fast/scalable to fit well also in embedded devices .

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1166#issuecomment-311378521
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20170627/eb372d77/attachment.html>


More information about the sr-dev mailing list