113 char start[80], answer[80], end[80];
114 char *
accountcode, *src, *dst, *dcontext, *clid, *channel, *dstchannel, *lastapp, *lastdata, *uniqueid, *userfield = NULL;
155 double hrbillsec = 0.0;
166 "accountcode, src, dst, dcontext, clid, channel, "
167 "dstchannel, lastapp, lastdata, start, answer, [end], duration, "
168 "billsec, disposition, amaflags, uniqueid, userfield"
172 "'%s', '%s', '%s', '%s', '%s', '%s', "
173 "'%s', '%s', '%s', %s, %s, %s, %lf, "
174 "%lf, '%s', '%s', '%s', '%s'"
177 accountcode, src, dst, dcontext, clid, channel,
178 dstchannel, lastapp, lastdata, start, answer, end, hrduration,
186 "accountcode, src, dst, dcontext, clid, channel, "
187 "dstchannel, lastapp, lastdata, start, answer, [end], duration, "
188 "billsec, disposition, amaflags, uniqueid, userfield"
192 "'%s', '%s', '%s', '%s', '%s', '%s', "
193 "'%s', '%s', '%s', %s, %s, %s, %ld, "
194 "%ld, '%s', '%s', '%s', '%s'"
197 accountcode, src, dst, dcontext, clid, channel,
198 dstchannel, lastapp, lastdata, start, answer, end, cdr->
duration,
205 double hrbillsec = 0.0;
216 "accountcode, src, dst, dcontext, clid, channel, "
217 "dstchannel, lastapp, lastdata, start, answer, [end], duration, "
218 "billsec, disposition, amaflags, uniqueid"
222 "'%s', '%s', '%s', '%s', '%s', '%s', "
223 "'%s', '%s', '%s', %s, %s, %s, %lf, "
224 "%lf, '%s', '%s', '%s'"
227 accountcode, src, dst, dcontext, clid, channel,
228 dstchannel, lastapp, lastdata, start, answer, end, hrduration,
235 "accountcode, src, dst, dcontext, clid, channel, "
236 "dstchannel, lastapp, lastdata, start, answer, [end], duration, "
237 "billsec, disposition, amaflags, uniqueid"
241 "'%s', '%s', '%s', '%s', '%s', '%s', "
242 "'%s', '%s', '%s', %s, %s, %s, %ld, "
243 "%ld, '%s', '%s', '%s'"
246 accountcode, src, dst, dcontext, clid, channel,
247 dstchannel, lastapp, lastdata, start, answer, end, cdr->
duration,
259 ast_log(
LOG_ERROR,
"Failed to build INSERT statement, no CDR was logged.\n");
270 ast_log(
LOG_ERROR,
"Failed to execute INSERT statement, no CDR was logged.\n");
static char accountcode[AST_MAX_ACCOUNT_CODE]
char accountcode[AST_MAX_ACCOUNT_CODE]
static char * anti_injection(const char *, int)
#define AST_MAX_USER_FIELD
char dstchannel[AST_MAX_EXTENSION]
const ast_string_field hostname
const ast_string_field table
char dcontext[AST_MAX_EXTENSION]
static ast_mutex_t tds_lock
int ast_tvzero(const struct timeval t)
Returns true if the argument is 0,0.
const ast_string_field hrtime
#define ast_mutex_lock(a)
char * ast_cdr_flags2str(int flags)
static int mssql_connect(void)
char lastdata[AST_MAX_EXTENSION]
static int mssql_disconnect(void)
unsigned int has_userfield
char dst[AST_MAX_EXTENSION]
char channel[AST_MAX_EXTENSION]
char lastapp[AST_MAX_EXTENSION]
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...
char src[AST_MAX_EXTENSION]
int64_t ast_tvdiff_us(struct timeval end, struct timeval start)
Computes the difference (in microseconds) between two struct timeval instances.
char clid[AST_MAX_EXTENSION]
static struct cdr_tds_config * settings
char * ast_cdr_disp2str(int disposition)
Disposition to a string.
char userfield[AST_MAX_USER_FIELD]
#define ast_mutex_unlock(a)
static void get_date(char *, size_t len, struct timeval)