[asterisk-commits] murf: branch 1.4 r65201 -
/branches/1.4/main/cdr.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Fri May 18 15:26:52 MST 2007
Author: murf
Date: Fri May 18 17:26:51 2007
New Revision: 65201
URL: http://svn.digium.com/view/asterisk?view=rev&rev=65201
Log:
Ugh. The svnmerge didn't catch the shift from cdr.c to main/cdr.c, and neither did I. This is the remainder of the 9717 patch, the fix for the run-away FAIL status for a call
Modified:
branches/1.4/main/cdr.c
Modified: branches/1.4/main/cdr.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/cdr.c?view=diff&rev=65201&r1=65200&r2=65201
==============================================================================
--- branches/1.4/main/cdr.c (original)
+++ branches/1.4/main/cdr.c Fri May 18 17:26:51 2007
@@ -660,6 +660,22 @@
}
}
+void ast_cdr_noanswer(struct ast_cdr *cdr)
+{
+ char *chan;
+
+ while (cdr) {
+ chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
+ if (ast_test_flag(cdr, AST_CDR_FLAG_POSTED))
+ ast_log(LOG_WARNING, "CDR on channel '%s' already posted\n", chan);
+ if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
+ if (cdr->disposition < AST_CDR_NOANSWER)
+ cdr->disposition = AST_CDR_NOANSWER;
+ }
+ cdr = cdr->next;
+ }
+}
+
int ast_cdr_disposition(struct ast_cdr *cdr, int cause)
{
int res = 0;
@@ -751,7 +767,7 @@
ast_copy_string(cdr->channel, c->name, sizeof(cdr->channel));
set_one_cid(cdr, c);
- cdr->disposition = (c->_state == AST_STATE_UP) ? AST_CDR_ANSWERED : AST_CDR_NOANSWER;
+ cdr->disposition = (c->_state == AST_STATE_UP) ? AST_CDR_ANSWERED : AST_CDR_NULL;
cdr->amaflags = c->amaflags ? c->amaflags : ast_default_amaflags;
ast_copy_string(cdr->accountcode, c->accountcode, sizeof(cdr->accountcode));
/* Destination information */
@@ -782,6 +798,8 @@
char *ast_cdr_disp2str(int disposition)
{
switch (disposition) {
+ case AST_CDR_NULL:
+ return "NO ANSWER"; /* by default, for backward compatibility */
case AST_CDR_NOANSWER:
return "NO ANSWER";
case AST_CDR_FAILED:
@@ -948,7 +966,7 @@
cdr->billsec = 0;
cdr->duration = 0;
ast_cdr_start(cdr);
- cdr->disposition = AST_CDR_NOANSWER;
+ cdr->disposition = AST_CDR_NULL;
}
}
}
More information about the asterisk-commits
mailing list