Good Morning. Just thinking of a way to a create a view (Form) to define a conf (say pjsip.conf) which upon declaration will expose its properties, Methods and every other “possible” things inside it using intellisense…
This way:
using asterisk
namespace AsteriskPropertiesRevealed
{
public Context myContext = default; #enumerated constant
public Endpoint 6001;
string secret = "unsecurepassword"
}
and all and all and all…
Shortly asked: Is there a way to build an API out of Asterisk Source files?
Asterisk is open source, so anything is possible, but it doesn’t use a table driven parser, for the details. There is a standard parser that deals with sections, and templates, keys and values, but parsing of values is done by individual modules. Also I believe it is still the case that some modules read the configuration in order of appearance, and look up the keywords, and some look for specific keywords in the whole section.
Even when reading in order of appearance, some keywords are treated as last one wins, and others (e.g. for codecs) accumulate values, sometimes in an order sensitive way.
Many modules have ARA database schemas, which have fields for all or most of the keywords, in a section.
In some cases, any form is going to very long, and contain mostly default values, so will be unhelpful when people try to get support.