56 if ((
out = fopen(
config->output_filename,
"a"))) {
63 if (!
out || res < 0) {
179 res = sqlite3_bind_text(
config->insert, ix + 1,
value->values.string, -1, SQLITE_STATIC);
180 if (res != SQLITE_OK) {
181 ast_log(
LOG_ERROR,
"Unable to write %s to database %s. SQL bind for field %s:'%s'. Error: %s\n",
184 sqlite3_errmsg(
config->db));
185 sqlite3_reset(
config->insert);
191 res = sqlite3_step(
config->insert);
192 if (res != SQLITE_DONE) {
195 sqlite3_errmsg(
config->db));
196 sqlite3_reset(
config->insert);
201 sqlite3_reset(
config->insert);
Private header for res_cdrel_custom.
#define RECORD_TYPE_STR(_rt)
cdrel_backend_writer cdrel_backend_writers[cdrel_format_type_end]
static const char config[]
#define ast_debug(level,...)
Log a DEBUG message.
#define ast_mutex_unlock(a)
#define ast_mutex_lock(a)
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
void ast_str_reset(struct ast_str *buf)
Reset the content of a dynamic string. Useful before a series of ast_str_append.
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
char *attribute_pure ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
struct ast_str * ast_str_thread_get(struct ast_threadstorage *ts, size_t init_len)
Retrieve a thread locally stored dynamic string.
Support for dynamic strings.
union cdrel_value::@454 values
#define AST_THREADSTORAGE(name)
Define a thread storage variable.
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
#define AST_VECTOR_GET(vec, idx)
Get an element from a vector.
static int dsv_writer(struct cdrel_config *config, struct cdrel_values *values)
int write_record_to_database(struct cdrel_config *config, struct cdrel_values *values)
int write_record_to_file(struct cdrel_config *config, struct ast_str *record)
static int json_writer(struct cdrel_config *config, struct cdrel_values *values)
static int database_writer(struct cdrel_config *config, struct cdrel_values *values)
static int dsv_appender(struct cdrel_config *config, struct cdrel_values *values, struct ast_str **str)