[Asterisk-Dev] Current database abstraction effort ?

James Sharp jsharp at psychoses.org
Wed Dec 31 15:48:12 MST 2003


> Good idea... but how can we fix this where we can flip a switch and change
> between the two options... I was thinking of maybe replacing some of the
> API with calls the emulate the standards asterisk calls and return the
> values in the same manner.  If we did it like this then the core of
> asterisk wouldn't have to be changed much if any at all in most cases.

Yah, that's the best way to do it, IMO.  API wrappers around things.

int ast_do_something_neat(char *withthis) {
#ifdef ODBC
do_it_the_odbc_way();
#else
do_it_the_old_skool_way();
#endif
}

or if you don't feel like recompiling...

int ast_do_something_neat(char *withthis) {
if (global_odbc) {
do_it_the_odbc_way();
} else {
do_it_the_old_skool_way();
}
}



More information about the asterisk-dev mailing list