2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 2007, Tilghman Lesher
6 * Tilghman Lesher <cdr_adaptive_odbc__v1@the-tilghman.com>
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
21 * \brief Adaptive ODBC CDR backend
23 * \author Tilghman Lesher <cdr_adaptive_odbc__v1@the-tilghman.com>
24 * \ingroup cdr_drivers
28 <depend>generic_odbc</depend>
34 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
36 #include <sys/types.h>
43 #include "asterisk/config.h"
44 #include "asterisk/channel.h"
45 #include "asterisk/lock.h"
46 #include "asterisk/linkedlists.h"
47 #include "asterisk/res_odbc.h"
48 #include "asterisk/cdr.h"
49 #include "asterisk/module.h"
51 #define CONFIG "cdr_adaptive_odbc.conf"
53 static char *name = "Adaptive ODBC";
54 /* Optimization to reduce number of memory allocations */
55 static int maxsize = 512, maxsize2 = 512;
68 AST_LIST_ENTRY(columns) list;
74 unsigned int usegmtime:1;
75 AST_LIST_HEAD_NOLOCK(odbc_columns, columns) columns;
76 AST_RWLIST_ENTRY(tables) list;
79 static AST_RWLIST_HEAD_STATIC(odbc_tables, tables);
81 static int load_config(void)
83 struct ast_config *cfg;
84 struct ast_variable *var;
85 const char *tmp, *catg;
86 struct tables *tableptr;
87 struct columns *entry;
92 int lenconnection, lentable, usegmtime = 0;
96 struct ast_flags config_flags = { 0 }; /* Part of our config comes from the database */
98 cfg = ast_config_load(CONFIG, config_flags);
99 if (!cfg || cfg == CONFIG_STATUS_FILEINVALID) {
100 ast_log(LOG_WARNING, "Unable to load " CONFIG ". No adaptive ODBC CDRs.\n");
104 for (catg = ast_category_browse(cfg, NULL); catg; catg = ast_category_browse(cfg, catg)) {
105 var = ast_variable_browse(cfg, catg);
109 if (ast_strlen_zero(tmp = ast_variable_retrieve(cfg, catg, "connection"))) {
110 ast_log(LOG_WARNING, "No connection parameter found in '%s'. Skipping.\n", catg);
113 ast_copy_string(connection, tmp, sizeof(connection));
114 lenconnection = strlen(connection);
116 if (!ast_strlen_zero(tmp = ast_variable_retrieve(cfg, catg, "usegmtime"))) {
117 usegmtime = ast_true(tmp);
120 /* When loading, we want to be sure we can connect. */
121 obj = ast_odbc_request_obj(connection, 1);
123 ast_log(LOG_WARNING, "No such connection '%s' in the '%s' section of " CONFIG ". Check res_odbc.conf.\n", connection, catg);
127 if (ast_strlen_zero(tmp = ast_variable_retrieve(cfg, catg, "table"))) {
128 ast_log(LOG_NOTICE, "No table name found. Assuming 'cdr'.\n");
131 ast_copy_string(table, tmp, sizeof(table));
132 lentable = strlen(table);
134 res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt);
135 if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
136 ast_log(LOG_WARNING, "SQL Alloc Handle failed on connection '%s'!\n", connection);
137 ast_odbc_release_obj(obj);
141 res = SQLColumns(stmt, NULL, 0, NULL, 0, (unsigned char *)table, SQL_NTS, (unsigned char *)"%", SQL_NTS);
142 if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
143 ast_log(LOG_ERROR, "Unable to query database columns on connection '%s'. Skipping.\n", connection);
144 ast_odbc_release_obj(obj);
148 tableptr = ast_calloc(sizeof(char), sizeof(*tableptr) + lenconnection + 1 + lentable + 1);
150 ast_log(LOG_ERROR, "Out of memory creating entry for table '%s' on connection '%s'\n", table, connection);
151 ast_odbc_release_obj(obj);
156 tableptr->usegmtime = usegmtime;
157 tableptr->connection = (char *)tableptr + sizeof(*tableptr);
158 tableptr->table = (char *)tableptr + sizeof(*tableptr) + lenconnection + 1;
159 ast_copy_string(tableptr->connection, connection, lenconnection + 1);
160 ast_copy_string(tableptr->table, table, lentable + 1);
162 ast_verb(3, "Found adaptive CDR table %s@%s.\n", tableptr->table, tableptr->connection);
164 /* Check for filters first */
165 for (var = ast_variable_browse(cfg, catg); var; var = var->next) {
166 if (strncmp(var->name, "filter", 6) == 0) {
167 char *cdrvar = ast_strdupa(var->name + 6);
168 cdrvar = ast_strip(cdrvar);
169 ast_verb(3, "Found filter %s for cdr variable %s in %s@%s\n", var->value, cdrvar, tableptr->table, tableptr->connection);
171 entry = ast_calloc(sizeof(char), sizeof(*entry) + strlen(cdrvar) + 1 + strlen(var->value) + 1);
173 ast_log(LOG_ERROR, "Out of memory creating filter entry for CDR variable '%s' in table '%s' on connection '%s'\n", cdrvar, table, connection);
178 /* NULL column entry means this isn't a column in the database */
180 entry->cdrname = (char *)entry + sizeof(*entry);
181 entry->filtervalue = (char *)entry + sizeof(*entry) + strlen(cdrvar) + 1;
182 strcpy(entry->cdrname, cdrvar);
183 strcpy(entry->filtervalue, var->value);
185 AST_LIST_INSERT_TAIL(&(tableptr->columns), entry, list);
189 while ((res = SQLFetch(stmt)) != SQL_NO_DATA && res != SQL_ERROR) {
190 char *cdrvar = "", *staticvalue = "";
192 SQLGetData(stmt, 4, SQL_C_CHAR, columnname, sizeof(columnname), &sqlptr);
194 /* Is there an alias for this column? */
196 /* NOTE: This seems like a non-optimal parse method, but I'm going
197 * for user configuration readability, rather than fast parsing. We
198 * really don't parse this file all that often, anyway.
200 for (var = ast_variable_browse(cfg, catg); var; var = var->next) {
201 if (strncmp(var->name, "alias", 5) == 0 && strcasecmp(var->value, columnname) == 0) {
202 char *alias = ast_strdupa(var->name + 5);
203 cdrvar = ast_strip(alias);
204 ast_verb(3, "Found alias %s for column %s in %s@%s\n", cdrvar, columnname, tableptr->table, tableptr->connection);
206 } else if (strncmp(var->name, "static", 6) == 0 && strcasecmp(var->value, columnname) == 0) {
207 char *item = ast_strdupa(var->name + 6);
208 item = ast_strip(item);
209 if (item[0] == '"' && item[strlen(item) - 1] == '"') {
210 /* Remove surrounding quotes */
211 item[strlen(item) - 1] = '\0';
218 entry = ast_calloc(sizeof(char), sizeof(*entry) + strlen(columnname) + 1 + strlen(cdrvar) + 1 + strlen(staticvalue) + 1);
220 ast_log(LOG_ERROR, "Out of memory creating entry for column '%s' in table '%s' on connection '%s'\n", columnname, table, connection);
224 entry->name = (char *)entry + sizeof(*entry);
225 strcpy(entry->name, columnname);
227 if (!ast_strlen_zero(cdrvar)) {
228 entry->cdrname = entry->name + strlen(columnname) + 1;
229 strcpy(entry->cdrname, cdrvar);
230 } else { /* Point to same place as the column name */
231 entry->cdrname = (char *)entry + sizeof(*entry);
234 if (!ast_strlen_zero(staticvalue)) {
235 entry->staticvalue = entry->cdrname + strlen(entry->cdrname) + 1;
236 strcpy(entry->staticvalue, staticvalue);
239 SQLGetData(stmt, 5, SQL_C_SHORT, &entry->type, sizeof(entry->type), NULL);
240 SQLGetData(stmt, 7, SQL_C_LONG, &entry->size, sizeof(entry->size), NULL);
241 SQLGetData(stmt, 9, SQL_C_SHORT, &entry->decimals, sizeof(entry->decimals), NULL);
242 SQLGetData(stmt, 10, SQL_C_SHORT, &entry->radix, sizeof(entry->radix), NULL);
243 SQLGetData(stmt, 11, SQL_C_SHORT, &entry->nullable, sizeof(entry->nullable), NULL);
244 SQLGetData(stmt, 16, SQL_C_LONG, &entry->octetlen, sizeof(entry->octetlen), NULL);
246 /* Specification states that the octenlen should be the maximum number of bytes
247 * returned in a char or binary column, but it seems that some drivers just set
248 * it to NULL. (Bad Postgres! No biscuit!) */
249 if (entry->octetlen == 0)
250 entry->octetlen = entry->size;
252 ast_verb(10, "Found %s column with type %hd with len %ld, octetlen %ld, and numlen (%hd,%hd)\n", entry->name, entry->type, (long) entry->size, (long) entry->octetlen, entry->decimals, entry->radix);
253 /* Insert column info into column list */
254 AST_LIST_INSERT_TAIL(&(tableptr->columns), entry, list);
258 SQLFreeHandle(SQL_HANDLE_STMT, stmt);
259 ast_odbc_release_obj(obj);
261 if (AST_LIST_FIRST(&(tableptr->columns)))
262 AST_RWLIST_INSERT_TAIL(&odbc_tables, tableptr, list);
269 static int free_config(void)
271 struct tables *table;
272 struct columns *entry;
273 while ((table = AST_RWLIST_REMOVE_HEAD(&odbc_tables, list))) {
274 while ((entry = AST_LIST_REMOVE_HEAD(&(table->columns), list))) {
282 static SQLHSTMT generic_prepare(struct odbc_obj *obj, void *data)
286 SQLINTEGER nativeerror = 0, numfields = 0;
287 SQLSMALLINT diagbytes = 0;
288 unsigned char state[10], diagnostic[256];
290 res = SQLAllocHandle (SQL_HANDLE_STMT, obj->con, &stmt);
291 if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
292 ast_log(LOG_WARNING, "SQL Alloc Handle failed!\n");
296 res = SQLPrepare(stmt, (unsigned char *) data, SQL_NTS);
297 if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
298 ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", (char *) data);
299 SQLGetDiagField(SQL_HANDLE_STMT, stmt, 1, SQL_DIAG_NUMBER, &numfields, SQL_IS_INTEGER, &diagbytes);
300 for (i = 0; i < numfields; i++) {
301 SQLGetDiagRec(SQL_HANDLE_STMT, stmt, i + 1, state, &nativeerror, diagnostic, sizeof(diagnostic), &diagbytes);
302 ast_log(LOG_WARNING, "SQL Execute returned an error %d: %s: %s (%d)\n", res, state, diagnostic, diagbytes);
304 ast_log(LOG_WARNING, "Oh, that was good. There are really %d diagnostics?\n", (int)numfields);
308 SQLFreeHandle (SQL_HANDLE_STMT, stmt);
315 #define LENGTHEN_BUF1(size) \
317 /* Lengthen buffer, if necessary */ \
318 if (ast_str_strlen(sql) + size + 1 > ast_str_size(sql)) { \
319 if (ast_str_make_space(&sql, ((ast_str_size(sql) + size + 1) / 512 + 1) * 512) != 0) { \
320 ast_log(LOG_ERROR, "Unable to allocate sufficient memory. Insert CDR '%s:%s' failed.\n", tableptr->connection, tableptr->table); \
323 AST_RWLIST_UNLOCK(&odbc_tables); \
329 #define LENGTHEN_BUF2(size) \
331 if (ast_str_strlen(sql2) + size + 1 > ast_str_size(sql2)) { \
332 if (ast_str_make_space(&sql2, ((ast_str_size(sql2) + size + 3) / 512 + 1) * 512) != 0) { \
333 ast_log(LOG_ERROR, "Unable to allocate sufficient memory. Insert CDR '%s:%s' failed.\n", tableptr->connection, tableptr->table); \
336 AST_RWLIST_UNLOCK(&odbc_tables); \
342 static int odbc_log(struct ast_cdr *cdr)
344 struct tables *tableptr;
345 struct columns *entry;
346 struct odbc_obj *obj;
347 struct ast_str *sql = ast_str_create(maxsize), *sql2 = ast_str_create(maxsize2);
349 char colbuf[1024], *colptr;
350 SQLHSTMT stmt = NULL;
361 if (AST_RWLIST_RDLOCK(&odbc_tables)) {
362 ast_log(LOG_ERROR, "Unable to lock table list. Insert CDR(s) failed.\n");
368 AST_LIST_TRAVERSE(&odbc_tables, tableptr, list) {
370 ast_str_set(&sql, 0, "INSERT INTO %s (", tableptr->table);
371 ast_str_set(&sql2, 0, " VALUES (");
373 /* No need to check the connection now; we'll handle any failure in prepare_and_execute */
374 if (!(obj = ast_odbc_request_obj(tableptr->connection, 0))) {
375 ast_log(LOG_WARNING, "cdr_adaptive_odbc: Unable to retrieve database handle for '%s:%s'. CDR failed: %s\n", tableptr->connection, tableptr->table, ast_str_buffer(sql));
379 AST_LIST_TRAVERSE(&(tableptr->columns), entry, list) {
381 if (strcasecmp(entry->cdrname, "start") == 0) {
383 } else if (strcasecmp(entry->cdrname, "answer") == 0) {
385 } else if (strcasecmp(entry->cdrname, "end") == 0) {
389 /* Check if we have a similarly named variable */
390 if (entry->staticvalue) {
391 colptr = ast_strdupa(entry->staticvalue);
392 } else if (datefield && tableptr->usegmtime) {
393 struct timeval date_tv = (datefield == 1) ? cdr->start : (datefield == 2) ? cdr->answer : cdr->end;
394 struct ast_tm tm = { 0, };
395 ast_localtime(&date_tv, &tm, "UTC");
396 ast_strftime(colbuf, sizeof(colbuf), "%Y-%m-%d %H:%M:%S", &tm);
399 ast_cdr_getvar(cdr, entry->cdrname, &colptr, colbuf, sizeof(colbuf), 0, datefield ? 0 : 1);
403 /* Check first if the column filters this entry. Note that this
404 * is very specifically NOT ast_strlen_zero(), because the filter
405 * could legitimately specify that the field is blank, which is
406 * different from the field being unspecified (NULL). */
407 if (entry->filtervalue && strcasecmp(colptr, entry->filtervalue) != 0) {
408 ast_verb(4, "CDR column '%s' with value '%s' does not match filter of"
409 " '%s'. Cancelling this CDR.\n",
410 entry->cdrname, colptr, entry->filtervalue);
415 if (ast_strlen_zero(entry->name))
418 LENGTHEN_BUF1(strlen(entry->name));
420 switch (entry->type) {
423 case SQL_LONGVARCHAR:
426 case SQL_LONGVARBINARY:
428 /* For these two field names, get the rendered form, instead of the raw
429 * form (but only when we're dealing with a character-based field).
431 if (strcasecmp(entry->name, "disposition") == 0) {
432 ast_cdr_getvar(cdr, entry->name, &colptr, colbuf, sizeof(colbuf), 0, 0);
433 } else if (strcasecmp(entry->name, "amaflags") == 0) {
434 ast_cdr_getvar(cdr, entry->name, &colptr, colbuf, sizeof(colbuf), 0, 0);
437 /* Truncate too-long fields */
438 if (entry->type != SQL_GUID) {
439 if (strlen(colptr) > entry->octetlen) {
440 colptr[entry->octetlen] = '\0';
444 ast_str_append(&sql, 0, "%s%s", first ? "" : ",", entry->name);
445 LENGTHEN_BUF2(strlen(colptr));
447 /* Encode value, with escaping */
448 ast_str_append(&sql2, 0, "%s'", first ? "" : ",");
449 for (tmp = colptr; *tmp; tmp++) {
451 ast_str_append(&sql2, 0, "''");
452 } else if (*tmp == '\\' && ast_odbc_backslash_is_escape(obj)) {
453 ast_str_append(&sql2, 0, "\\\\");
455 ast_str_append(&sql2, 0, "%c", *tmp);
458 ast_str_append(&sql2, 0, "'");
462 int year = 0, month = 0, day = 0;
463 if (sscanf(colptr, "%d-%d-%d", &year, &month, &day) != 3 || year <= 0 ||
464 month <= 0 || month > 12 || day < 0 || day > 31 ||
465 ((month == 4 || month == 6 || month == 9 || month == 11) && day == 31) ||
466 (month == 2 && year % 400 == 0 && day > 29) ||
467 (month == 2 && year % 100 == 0 && day > 28) ||
468 (month == 2 && year % 4 == 0 && day > 29) ||
469 (month == 2 && year % 4 != 0 && day > 28)) {
470 ast_log(LOG_WARNING, "CDR variable %s is not a valid date ('%s').\n", entry->name, colptr);
474 if (year > 0 && year < 100) {
478 ast_str_append(&sql, 0, "%s%s", first ? "" : ",", entry->name);
480 ast_str_append(&sql2, 0, "%s{ d '%04d-%02d-%02d' }", first ? "" : ",", year, month, day);
485 int hour = 0, minute = 0, second = 0;
486 int count = sscanf(colptr, "%d:%d:%d", &hour, &minute, &second);
488 if ((count != 2 && count != 3) || hour < 0 || hour > 23 || minute < 0 || minute > 59 || second < 0 || second > 59) {
489 ast_log(LOG_WARNING, "CDR variable %s is not a valid time ('%s').\n", entry->name, colptr);
493 ast_str_append(&sql, 0, "%s%s", first ? "" : ",", entry->name);
495 ast_str_append(&sql2, 0, "%s{ t '%02d:%02d:%02d' }", first ? "" : ",", hour, minute, second);
498 case SQL_TYPE_TIMESTAMP:
501 int year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0;
502 int count = sscanf(colptr, "%d-%d-%d %d:%d:%d", &year, &month, &day, &hour, &minute, &second);
504 if ((count != 3 && count != 5 && count != 6) || year <= 0 ||
505 month <= 0 || month > 12 || day < 0 || day > 31 ||
506 ((month == 4 || month == 6 || month == 9 || month == 11) && day == 31) ||
507 (month == 2 && year % 400 == 0 && day > 29) ||
508 (month == 2 && year % 100 == 0 && day > 28) ||
509 (month == 2 && year % 4 == 0 && day > 29) ||
510 (month == 2 && year % 4 != 0 && day > 28) ||
511 hour > 23 || minute > 59 || second > 59 || hour < 0 || minute < 0 || second < 0) {
512 ast_log(LOG_WARNING, "CDR variable %s is not a valid timestamp ('%s').\n", entry->name, colptr);
516 if (year > 0 && year < 100) {
520 ast_str_append(&sql, 0, "%s%s", first ? "" : ",", entry->name);
522 ast_str_append(&sql2, 0, "%s{ ts '%04d-%02d-%02d %02d:%02d:%02d' }", first ? "" : ",", year, month, day, hour, minute, second);
528 if (sscanf(colptr, "%d", &integer) != 1) {
529 ast_log(LOG_WARNING, "CDR variable %s is not an integer.\n", entry->name);
533 ast_str_append(&sql, 0, "%s%s", first ? "" : ",", entry->name);
535 ast_str_append(&sql2, 0, "%s%d", first ? "" : ",", integer);
540 long long integer = 0;
541 if (sscanf(colptr, "%lld", &integer) != 1) {
542 ast_log(LOG_WARNING, "CDR variable %s is not an integer.\n", entry->name);
546 ast_str_append(&sql, 0, "%s%s", first ? "" : ",", entry->name);
548 ast_str_append(&sql2, 0, "%s%lld", first ? "" : ",", integer);
554 if (sscanf(colptr, "%hd", &integer) != 1) {
555 ast_log(LOG_WARNING, "CDR variable %s is not an integer.\n", entry->name);
559 ast_str_append(&sql, 0, "%s%s", first ? "" : ",", entry->name);
561 ast_str_append(&sql2, 0, "%s%d", first ? "" : ",", integer);
567 if (sscanf(colptr, "%hhd", &integer) != 1) {
568 ast_log(LOG_WARNING, "CDR variable %s is not an integer.\n", entry->name);
572 ast_str_append(&sql, 0, "%s%s", first ? "" : ",", entry->name);
574 ast_str_append(&sql2, 0, "%s%d", first ? "" : ",", integer);
580 if (sscanf(colptr, "%hhd", &integer) != 1) {
581 ast_log(LOG_WARNING, "CDR variable %s is not an integer.\n", entry->name);
587 ast_str_append(&sql, 0, "%s%s", first ? "" : ",", entry->name);
589 ast_str_append(&sql2, 0, "%s%d", first ? "" : ",", integer);
596 if (sscanf(colptr, "%lf", &number) != 1) {
597 ast_log(LOG_WARNING, "CDR variable %s is not an numeric type.\n", entry->name);
601 ast_str_append(&sql, 0, "%s%s", first ? "" : ",", entry->name);
602 LENGTHEN_BUF2(entry->decimals);
603 ast_str_append(&sql2, 0, "%s%*.*lf", first ? "" : ",", entry->decimals, entry->radix, number);
611 if (sscanf(colptr, "%lf", &number) != 1) {
612 ast_log(LOG_WARNING, "CDR variable %s is not an numeric type.\n", entry->name);
616 ast_str_append(&sql, 0, "%s%s", first ? "" : ",", entry->name);
617 LENGTHEN_BUF2(entry->decimals);
618 ast_str_append(&sql2, 0, "%s%lf", first ? "" : ",", number);
622 ast_log(LOG_WARNING, "Column type %d (field '%s:%s:%s') is unsupported at this time.\n", entry->type, tableptr->connection, tableptr->table, entry->name);
629 /* Concatenate the two constructed buffers */
630 LENGTHEN_BUF1(ast_str_strlen(sql2));
631 ast_str_append(&sql, 0, ")");
632 ast_str_append(&sql2, 0, ")");
633 ast_str_append(&sql, 0, "%s", ast_str_buffer(sql2));
635 ast_verb(11, "[%s]\n", ast_str_buffer(sql));
637 stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, ast_str_buffer(sql));
639 SQLRowCount(stmt, &rows);
640 SQLFreeHandle(SQL_HANDLE_STMT, stmt);
643 ast_log(LOG_WARNING, "cdr_adaptive_odbc: Insert failed on '%s:%s'. CDR failed: %s\n", tableptr->connection, tableptr->table, ast_str_buffer(sql));
646 ast_odbc_release_obj(obj);
648 AST_RWLIST_UNLOCK(&odbc_tables);
650 /* Next time, just allocate buffers that are that big to start with. */
651 if (ast_str_strlen(sql) > maxsize) {
652 maxsize = ast_str_strlen(sql);
654 if (ast_str_strlen(sql2) > maxsize2) {
655 maxsize2 = ast_str_strlen(sql2);
663 static int unload_module(void)
665 ast_cdr_unregister(name);
667 if (AST_RWLIST_WRLOCK(&odbc_tables)) {
668 ast_cdr_register(name, ast_module_info->description, odbc_log);
669 ast_log(LOG_ERROR, "Unable to lock column list. Unload failed.\n");
674 AST_RWLIST_UNLOCK(&odbc_tables);
678 static int load_module(void)
680 if (AST_RWLIST_WRLOCK(&odbc_tables)) {
681 ast_log(LOG_ERROR, "Unable to lock column list. Load failed.\n");
686 AST_RWLIST_UNLOCK(&odbc_tables);
687 ast_cdr_register(name, ast_module_info->description, odbc_log);
691 static int reload(void)
693 if (AST_RWLIST_WRLOCK(&odbc_tables)) {
694 ast_log(LOG_ERROR, "Unable to lock column list. Reload failed.\n");
700 AST_RWLIST_UNLOCK(&odbc_tables);
704 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Adaptive ODBC CDR backend",
706 .unload = unload_module,