[Asterisk-Dev] Current database abstraction effort ?

James Sharp jsharp at psychoses.org
Wed Dec 31 14:48:08 MST 2003

> I need to finish redoing the odbc voicemail stuff and app_directory and
> maybe write res_odbc.c where we can have a global connection that every
> app can use to interact with the datasource.
> Any thoughts on how to do this?

I came up with this in my PAM attempt (which I'm still working on).

Function prototypes

ast_db_query(const char *identifier, const char *keyname, const char
*keyvalue, const int numofelements, const char *name1, char *value1, ...)

You pass it an identifier like "chan_sip" or "voicemail", the number of
elements you want information from, and then a series of pairs of
name/pointers to the odbc functions.



The call then percolates through and after it returns, the pointers of
&name, &password, and &email are filled with the appropriate data.

You config your res_odbc to query a particular DSN for a given identifier.
 Something like this:


More information about the asterisk-dev mailing list