|
|
@ -351,10 +351,7 @@ int ast_cdr_update(struct ast_channel *c)
|
|
|
|
char *name, *num;
|
|
|
|
char *name, *num;
|
|
|
|
char tmp[AST_MAX_EXTENSION] = "";
|
|
|
|
char tmp[AST_MAX_EXTENSION] = "";
|
|
|
|
/* Grab source from ANI or normal Caller*ID */
|
|
|
|
/* Grab source from ANI or normal Caller*ID */
|
|
|
|
if (!cdr) {
|
|
|
|
if (cdr) {
|
|
|
|
ast_log(LOG_NOTICE, "The cdr pointer is not set\n");
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (c->ani)
|
|
|
|
if (c->ani)
|
|
|
|
strncpy(tmp, c->ani, sizeof(tmp) - 1);
|
|
|
|
strncpy(tmp, c->ani, sizeof(tmp) - 1);
|
|
|
|
else if (c->callerid && strlen(c->callerid))
|
|
|
|
else if (c->callerid && strlen(c->callerid))
|
|
|
@ -375,6 +372,7 @@ int ast_cdr_update(struct ast_channel *c)
|
|
|
|
/* Destination information */
|
|
|
|
/* Destination information */
|
|
|
|
strncpy(cdr->dst, c->exten, sizeof(cdr->dst) - 1);
|
|
|
|
strncpy(cdr->dst, c->exten, sizeof(cdr->dst) - 1);
|
|
|
|
strncpy(cdr->dcontext, c->context, sizeof(cdr->dcontext) - 1);
|
|
|
|
strncpy(cdr->dcontext, c->context, sizeof(cdr->dcontext) - 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -421,6 +419,7 @@ void ast_cdr_post(struct ast_cdr *cdr)
|
|
|
|
|
|
|
|
|
|
|
|
void ast_cdr_reset(struct ast_cdr *cdr, int post)
|
|
|
|
void ast_cdr_reset(struct ast_cdr *cdr, int post)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (cdr) {
|
|
|
|
/* Post if requested */
|
|
|
|
/* Post if requested */
|
|
|
|
if (post) {
|
|
|
|
if (post) {
|
|
|
|
ast_cdr_end(cdr);
|
|
|
|
ast_cdr_end(cdr);
|
|
|
@ -435,4 +434,5 @@ void ast_cdr_reset(struct ast_cdr *cdr, int post)
|
|
|
|
cdr->duration = 0;
|
|
|
|
cdr->duration = 0;
|
|
|
|
ast_cdr_start(cdr);
|
|
|
|
ast_cdr_start(cdr);
|
|
|
|
cdr->disposition = AST_CDR_NOANSWER;
|
|
|
|
cdr->disposition = AST_CDR_NOANSWER;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|