Custom SQLite3 CDR records.
More...
Go to the source code of this file.
|
static char * | columns |
|
static const char | config_file [] = "cdr_sqlite3_custom.conf" |
|
static sqlite3 * | db = NULL |
|
static const char | desc [] = "Customizable SQLite3 CDR Backend" |
|
static ast_mutex_t | lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, 1 } |
|
static const char | name [] = "cdr_sqlite3_custom" |
|
static struct sql_values | sql_values = { .first = NULL, .last = NULL, .lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, 1 } , } |
|
static char | table [80] |
|
static void free_config |
( |
int |
reload | ) |
|
|
static |
static int load_column_config |
( |
const char * |
tmp | ) |
|
|
static |
Definition at line 76 of file cdr_sqlite3_custom.c.
References ast_free, ast_log(), ast_str_append(), ast_str_buffer(), ast_str_create(), ast_str_strlen(), ast_strdup, ast_strip(), ast_strlen_zero(), LOG_ERROR, LOG_WARNING, and strsep().
79 char *cols = NULL, *save = NULL;
81 struct ast_str *column_string = NULL;
88 ast_log(
LOG_ERROR,
"Out of memory creating temporary buffer for column list for table '%s.'\n",
table);
92 ast_log(
LOG_ERROR,
"Out of memory creating temporary buffer for column list for table '%s.'\n",
table);
96 while ((col =
strsep(&cols,
","))) {
98 escaped = sqlite3_mprintf(
"%q", col);
106 sqlite3_free(escaped);
char * strsep(char **str, const char *delims)
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
struct ast_str * ast_str_create(size_t init_len)
Create a malloc'ed dynamic length string.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
char * ast_strip(char *s)
Strip leading/trailing whitespace from a string.
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
static int load_values_config |
( |
const char * |
tmp | ) |
|
|
static |
Definition at line 120 of file cdr_sqlite3_custom.c.
References AST_APP_ARG, ast_calloc, AST_DECLARE_APP_ARGS, ast_free, AST_LIST_INSERT_TAIL, ast_log(), AST_STANDARD_RAW_ARGS, ast_strdup, ast_strip_quoted(), ast_strlen_zero(), values::expression, values::list, LOG_ERROR, LOG_WARNING, and value.
const char config_file[] = "cdr_sqlite3_custom.conf" |
|
static |
const char desc[] = "Customizable SQLite3 CDR Backend" |
|
static |
ast_mutex_t lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, 1 } |
|
static |
const char name[] = "cdr_sqlite3_custom" |
|
static |