aboutsummaryrefslogtreecommitdiffstats
path: root/main/features.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-09 15:44:43 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-09 15:44:43 +0000
commite675e4c379a83c0f6d632c9fc601f318fe66235c (patch)
tree0ab7301e4bc578d9045f3cfd87bf405fae067d7e /main/features.c
parent32d0d2b7124a7462ff63b7f8f953b52311d93879 (diff)
Merged revisions 142064 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r142064 | russell | 2008-09-09 10:44:10 -0500 (Tue, 09 Sep 2008) | 13 lines Merged revisions 142063 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r142063 | russell | 2008-09-09 10:40:24 -0500 (Tue, 09 Sep 2008) | 5 lines Ensure that the stored CDR reference is still valid after the bridge before poking at it. Also, keep the channel locked while messing with this CDR. (fixes crashes reported in issue #13409) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@142065 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/features.c')
-rw-r--r--main/features.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/main/features.c b/main/features.c
index 8eeda42f5..f13c5d124 100644
--- a/main/features.c
+++ b/main/features.c
@@ -2159,6 +2159,22 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
ast_cdr_specialized_reset(chan->cdr,0);
}
if (peer->cdr) {
+ struct ast_cdr *cur;
+
+ ast_channel_lock(peer);
+ for (cur = peer->cdr; cur; cur = cur->next) {
+ if (cur == orig_peer_cdr) {
+ break;
+ }
+ }
+
+ if (!cur) {
+ /* orig_peer_cdr is gone, probably because of a masquerade
+ * during the bridge. */
+ ast_channel_unlock(peer);
+ return res;
+ }
+
/* before resetting the peer cdr, throw a copy of it to the
backend, just in case the cdr.conf file is calling for
unanswered CDR's. */
@@ -2175,6 +2191,7 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
}
}
ast_cdr_specialized_reset(orig_peer_cdr,0);
+ ast_channel_unlock(peer);
}
}
return res;