diff --git a/main/cdr.c b/main/cdr.c index 8f25c84b61ad29a61e4563316f58bad00813dd83..db277af29ceca8467d9406a6c5f5de95e1d5298c 100644 --- a/main/cdr.c +++ b/main/cdr.c @@ -740,8 +740,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; } } } @@ -765,10 +764,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 dfa61b23be7c7533b28e10d2bc1370497e289af1..712da3d2b3da402f76d0c8a42568c02e4ffda28a 100644 --- a/main/channel.c +++ b/main/channel.c @@ -4660,7 +4660,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); @@ -6142,6 +6141,24 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha ast_clear_flag(c0, AST_FLAG_NBRIDGE); ast_clear_flag(c1, AST_FLAG_NBRIDGE); + 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; + if (c0->_softhangup == AST_SOFTHANGUP_UNBRIDGE || c1->_softhangup == AST_SOFTHANGUP_UNBRIDGE) continue; diff --git a/main/features.c b/main/features.c index 1aaf33a25e1325dc7345257dd655eced0b549e5a..0a26ad1c07608ffe3b8e0e311d17752254560bbd 100644 --- a/main/features.c +++ b/main/features.c @@ -3098,6 +3098,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); } ast_cel_report_event(chan, AST_CEL_BRIDGE_START, NULL, NULL, NULL); for (;;) {