mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-10 03:48:34 +00:00
closes issue #10668; thanks to arkadia for his patch; had to leave out the bit about ending the previous cdr in the fork; it would destroy current implementations.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82444 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -311,6 +311,7 @@ int ast_cdr_setvar(struct ast_cdr *cdr, const char *name, const char *value, int
|
||||
}
|
||||
|
||||
for (; cdr; cdr = recur ? cdr->next : NULL) {
|
||||
if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
|
||||
headp = &cdr->varshead;
|
||||
AST_LIST_TRAVERSE_SAFE_BEGIN(headp, newvariable, entries) {
|
||||
if (!strcasecmp(ast_var_name(newvariable), name)) {
|
||||
@@ -327,6 +328,7 @@ int ast_cdr_setvar(struct ast_cdr *cdr, const char *name, const char *value, int
|
||||
AST_LIST_INSERT_HEAD(headp, newvariable, entries);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -693,12 +695,14 @@ void ast_cdr_answer(struct ast_cdr *cdr)
|
||||
{
|
||||
|
||||
for (; cdr; cdr = cdr->next) {
|
||||
if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
|
||||
check_post(cdr);
|
||||
if (cdr->disposition < AST_CDR_ANSWERED)
|
||||
cdr->disposition = AST_CDR_ANSWERED;
|
||||
if (ast_tvzero(cdr->answer))
|
||||
cdr->answer = ast_tvnow();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ast_cdr_busy(struct ast_cdr *cdr)
|
||||
@@ -842,6 +846,7 @@ int ast_cdr_init(struct ast_cdr *cdr, struct ast_channel *c)
|
||||
void ast_cdr_end(struct ast_cdr *cdr)
|
||||
{
|
||||
for ( ; cdr ; cdr = cdr->next) {
|
||||
if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
|
||||
check_post(cdr);
|
||||
if (ast_tvzero(cdr->end))
|
||||
cdr->end = ast_tvnow();
|
||||
@@ -852,6 +857,7 @@ void ast_cdr_end(struct ast_cdr *cdr)
|
||||
cdr->duration = cdr->end.tv_sec - cdr->start.tv_sec;
|
||||
cdr->billsec = ast_tvzero(cdr->answer) ? 0 : cdr->end.tv_sec - cdr->answer.tv_sec;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
char *ast_cdr_disp2str(int disposition)
|
||||
|
||||
Reference in New Issue
Block a user