[asterisk-dev] Application/Function configuration parsing
nir.simionovich at gmail.com
Sun Oct 26 03:13:21 CDT 2008
Thanks for the info and the pointer to the presentation - I'll take a
look at it and see if I get the hang of
Here's a silly question, why not include the configuration parsing
handling techniques to the app_skel.c
file, so that people starting off have a clear example. app_skel.c is a
wonderful example, and it took me
about 20 minutes to read, another 10 minutes to understand how the
application flags and options are
parsed and continue on from there. I'm confident that for someone
experienced, it will take no more than
a few minutes to create a skel.conf file, showing a skeleton
configuration file, and have it parsed in the
application - I'm confident it will help many like myself to get up and
Russell Bryant wrote:
> On Oct 25, 2008, at 5:29 PM, Nir Simionovich wrote:
>> I've been trying to read how Asterisk applications or functions
>> to specific configuration files,
>> however, I was unable to figure out a single methodology to do so. I
>> be missing something here,
>> but as I'm trying to write an application that relies on a
>> file, this point kinda got me stuck.
>> My general application description is available at
>> http://www.simionovich.com/?page_id=94, and I
>> would highly appreciate it is you could please point me to some
>> that may help me out in a
>> simple and clear way. I've tried chan_sip.c to figure out how the
>> configuration section works, but as
>> I said, I got stuck (My C is a little rusty, I have to admit).
> The functions for configuration handling are declared in include/
> asterisk/config.h. The three that are most commonly used are.
> - Load a configuration file
> - Traverse configuration categories (The stuff in square brackets)
> - Traverse key/value pairs within a certain configuration category
> There are a lot of examples, and they're all a little bit different.
> If you search around for ast_config_load(), you will find all of the
> places that configuration is handled.
> Here is an older set of slides on the config API that might help as
> Russell Bryant
> Senior Software Engineer
> Open Source Team Lead
> Digium, Inc.
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
More information about the asterisk-dev