aboutsummaryrefslogtreecommitdiffstats
path: root/main/channel.c
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-05 23:13:20 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-05 23:13:20 +0000
commit5482dbc0430efc94e35c5ab9d7a58c0743efadf9 (patch)
tree28765ae88a2eb03202410c78cc1a40c281a9aa98 /main/channel.c
parent0343c9913dc4dfc64567d5ec89e07a3602a767d6 (diff)
(closes issue #12982)
Reported by: bcnit Tested by: murf I discovered that also, in the previous bug fixes and changes, the cdr.conf 'unanswered' option is not being obeyed, so I fixed this. And, yes, there are two 'answer' times involved in this scenario, and I would agree with you, that the first answer time is the time that should appear in the CDR. (the second 'answer' time is the time that the bridge was begun). I made the necessary adjustments, recording the first answer time into the peer cdr, and then using that to override the bridge cdr's value. To get the 'unanswered' CDRs to appear, I purposely output them, using the dial cmd to mark them as DIALED (with a new flag), and outputting them if they bear that flag, and you are in the right mode. I also corrected one small mention of the Zap device to equally consider the dahdi device. I heavily tested 10-sec-wait macros in dial, and without the macro call; I tested hangups while the macro was running vs. letting the macro complete and the bridge form. Looks OK. Removed all the instrumentation and debug. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@135799 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c
index 1383feb0f..fb51c20fa 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -1514,7 +1514,10 @@ int ast_hangup(struct ast_channel *chan)
ast_cause2str(chan->hangupcause)
);
- if (chan->cdr && !ast_test_flag(chan->cdr, AST_CDR_FLAG_BRIDGED) && !ast_test_flag(chan->cdr, AST_CDR_FLAG_POST_DISABLED) && chan->cdr->disposition != AST_CDR_NULL) {
+ if (chan->cdr && !ast_test_flag(chan->cdr, AST_CDR_FLAG_BRIDGED) &&
+ !ast_test_flag(chan->cdr, AST_CDR_FLAG_POST_DISABLED) &&
+ (chan->cdr->disposition != AST_CDR_NULL || ast_test_flag(chan->cdr, AST_CDR_FLAG_DIALED))) {
+
ast_cdr_end(chan->cdr);
ast_cdr_detach(chan->cdr);
}
@@ -3052,6 +3055,8 @@ int ast_call(struct ast_channel *chan, char *addr, int timeout)
/* Stop if we're a zombie or need a soft hangup */
ast_channel_lock(chan);
if (!ast_test_flag(chan, AST_FLAG_ZOMBIE) && !ast_check_hangup(chan)) {
+ if (chan->cdr)
+ ast_set_flag(chan->cdr, AST_CDR_FLAG_DIALED);
if (chan->tech->call)
res = chan->tech->call(chan, addr, timeout);
ast_set_flag(chan, AST_FLAG_OUTGOING);