[Asterisk-Dev] Construct an ast_config from database

Matthew Boehm mboehm at cytelcom.com
Wed Sep 15 15:04:57 MST 2004


Hey gang. Since I'm not 'that' great with C I've got a curiosity. My
eventual goal is to add MySQL support to the entire server. Got SIP,
Voicemail and Extensions to work (using those retrieve_* scripts). Will
eventually try to make them dynamic.

Focusing right now on app_directory. I can see from the source that it gets
its information by reading the voicemail.conf file and parsing the vm
extensions for certain context.

In my case, there are none in that file as all my VM is done in db.

Without rewriting/adding too much code to the app_directory.c, I figured it
would be easier if instead of the directory doing this:  cfg =
ast_load(DIRECTORY_CONFIG);

I could do: cfg = make_cfg_from_db( "voicemail_users" );

That function could then do all the querying and could construct a .cfg
struct and return it.

Does this sound like something that 'can' be done? Any hints/suggestions for
things to watch out for?

Thanks,
Matthew




More information about the asterisk-dev mailing list