48 if (
columns != 2 || strcmp(column_names[0],
"key") || strcmp(column_names[1],
"value")) {
49 fprintf(stderr,
"Unknown row type\n");
71 fprintf(stderr,
"Could not add row to Berkeley DB: %s\n", errmsg);
81 fprintf(stderr,
"Unable to open Asterisk database '%s': %s\n",
dbname, sqlite3_errmsg(
sql3db));
92 fprintf(stderr,
"Unable to create astdb: %s\n", strerror(
errno));
98int main(
int argc,
char *argv[])
100 struct stat dont_care;
103 fprintf(stderr,
"%s takes the path of SQLite3 astdb as its only argument\n", basename(argv[0]));
104 fprintf(stderr,
"and will produce a file 'astdb' in the current directory\n"
105 "Make a backup of any existing Berkeley DB astdb you have and copy\n"
106 "the new astdb to its location: often /var/lib/asterisk/astdb\n");
110 if (stat(argv[1], &dont_care)) {
111 fprintf(stderr,
"Unable to open %s: %s\n", argv[1], strerror(
errno));
124 fprintf(stderr,
"Database conversion failed!\n");
129 printf(
"Created ./astdb. Back up any existing astdb and copy the created\n");
130 printf(
"astdb file to the original's location. Often /var/lib/asterisk/astdb.\n");
static int db_open_sqlite3(const char *dbname)
int main(int argc, char *argv[])
static int add_row_to_bdb(void *arg, int columns, char **values, char **column_names)
static int convert_bdb_to_sqlite3(void)
static int create_bdb_astdb(void)
Asterisk main include file. File version handling, generic pbx functions.
static char dbname[MAX_DB_OPTION_SIZE]
DB * dbopen(char *fname, int flags, int mode, DBTYPE type, const void *openinfo) const