aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/cdr.c9
-rw-r--r--main/channel.c12
-rw-r--r--main/features.c5
3 files changed, 19 insertions, 7 deletions
diff --git a/main/cdr.c b/main/cdr.c
index 6c7ab8d9e..24a12a5e6 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -706,8 +706,7 @@ void ast_cdr_busy(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_BUSY)
- cdr->disposition = AST_CDR_BUSY;
+ cdr->disposition = AST_CDR_BUSY;
}
}
}
@@ -731,10 +730,8 @@ void ast_cdr_noanswer(struct ast_cdr *cdr)
while (cdr) {
if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
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 (cdr->disposition < AST_CDR_NOANSWER)
- cdr->disposition = AST_CDR_NOANSWER;
+ check_post(cdr);
+ cdr->disposition = AST_CDR_NOANSWER;
}
cdr = cdr->next;
}
diff --git a/main/channel.c b/main/channel.c
index e357fe3b8..e77498491 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -3920,8 +3920,19 @@ struct ast_channel *__ast_request_and_dial(const char *type, int format, void *d
break;
case AST_CONTROL_BUSY:
+ ast_cdr_busy(chan->cdr);
+ *outstate = f->subclass;
+ timeout = 0;
+ break;
+
case AST_CONTROL_CONGESTION:
+ ast_cdr_failed(chan->cdr);
+ *outstate = f->subclass;
+ timeout = 0;
+ break;
+
case AST_CONTROL_ANSWER:
+ ast_cdr_answer(chan->cdr);
*outstate = f->subclass;
timeout = 0; /* trick to force exit from the while() */
break;
@@ -4052,7 +4063,6 @@ int ast_call(struct ast_channel *chan, char *addr, int timeout)
if (!ast_test_flag(chan, AST_FLAG_ZOMBIE) && !ast_check_hangup(chan)) {
if (chan->cdr) {
ast_set_flag(chan->cdr, AST_CDR_FLAG_DIALED);
- ast_set_flag(chan->cdr, AST_CDR_FLAG_ORIGINATED);
}
if (chan->tech->call)
res = chan->tech->call(chan, addr, timeout);
diff --git a/main/features.c b/main/features.c
index e63d7cf21..4370014b3 100644
--- a/main/features.c
+++ b/main/features.c
@@ -2593,6 +2593,11 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
ast_set_flag(peer_cdr, AST_CDR_FLAG_BRIDGED);
}
}
+ /* the DIALED flag may be set if a dialed channel is transfered
+ * and then bridged to another channel. In order for the
+ * bridge CDR to be written, the DIALED flag must not be
+ * present. */
+ ast_clear_flag(bridge_cdr, AST_CDR_FLAG_DIALED);
}
for (;;) {
struct ast_channel *other; /* used later */