aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-20 17:30:25 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-20 17:30:25 +0000
commit2038f6fdd4c04c9cc5ef6479cbbc5adb7c4a69a3 (patch)
treeed0dbf04387ad0149ff86b4aa15187a49a2956b0
parenta367e35dd3a7323b42ce1721a084e34bacfc3475 (diff)
Fix some code that wrongly assumed a pointer would always be non-NULL when dealing with CDRs after a bridge.
(closes issue #15079) Reported by: barryf git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@195688 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--res/res_features.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/res/res_features.c b/res/res_features.c
index 00bacaa93..cf2b8669d 100644
--- a/res/res_features.c
+++ b/res/res_features.c
@@ -1760,15 +1760,21 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
hears nothing but ringing while the macro does its thing. */
if (peer_cdr && !ast_tvzero(peer_cdr->answer)) {
bridge_cdr->answer = peer_cdr->answer;
- chan_cdr->answer = peer_cdr->answer;
bridge_cdr->disposition = peer_cdr->disposition;
- chan_cdr->disposition = peer_cdr->disposition;
+ if (chan_cdr) {
+ chan_cdr->answer = peer_cdr->answer;
+ chan_cdr->disposition = peer_cdr->disposition;
+ }
} else {
ast_cdr_answer(bridge_cdr);
- ast_cdr_answer(chan_cdr); /* for the sake of cli status checks */
+ if (chan_cdr) {
+ ast_cdr_answer(chan_cdr); /* for the sake of cli status checks */
+ }
}
- if (ast_test_flag(chan,AST_FLAG_BRIDGE_HANGUP_DONT)) {
- ast_set_flag(chan_cdr, AST_CDR_FLAG_BRIDGED);
+ if (ast_test_flag(chan,AST_FLAG_BRIDGE_HANGUP_DONT) && (chan_cdr || peer_cdr)) {
+ if (chan_cdr) {
+ ast_set_flag(chan_cdr, AST_CDR_FLAG_BRIDGED);
+ }
if (peer_cdr) {
ast_set_flag(peer_cdr, AST_CDR_FLAG_BRIDGED);
}