aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-17 17:18:31 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-17 17:18:31 +0000
commitd118b02eb85d7f2082657b5a1420632f2e3d167b (patch)
tree894f0992e4833d70ca423f7c42397321e4e5f1e6 /res
parentec99b4621efa045e3256d876b4b03ac95b10bc7c (diff)
Interesting crash. In this case, you exit the
bridge with peer completely GONE. I moved the channel find call up to cover the whole peer CDR reset code segment. This appears to solve the crash without changing the logic at all. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@150637 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_features.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/res/res_features.c b/res/res_features.c
index 6b5bc6b18..57a309ad8 100644
--- a/res/res_features.c
+++ b/res/res_features.c
@@ -1812,9 +1812,9 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
} else {
ast_cdr_specialized_reset(chan_cdr,0); /* nothing changed, reset the chan_cdr */
}
- if (strcasecmp(orig_peername, peer->name) != 0) {
+ chan_ptr = ast_get_channel_by_name_locked(orig_peername);
+ if (chan_ptr && strcasecmp(orig_peername, peer->name) != 0) {
/* old channel */
- chan_ptr = ast_get_channel_by_name_locked(orig_peername);
if (chan_ptr) {
if (!ast_bridged_channel(chan_ptr)) {
struct ast_cdr *cur;
@@ -1826,13 +1826,15 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
if (cur)
ast_cdr_specialized_reset(peer_cdr,0);
}
- ast_channel_unlock(chan_ptr);
}
/* new channel */
ast_cdr_specialized_reset(new_peer_cdr,0);
} else {
- ast_cdr_specialized_reset(peer_cdr,0); /* nothing changed, reset the peer_cdr */
+ if (chan_ptr)
+ ast_cdr_specialized_reset(peer_cdr,0); /* nothing changed, reset the peer_cdr */
}
+ if (chan_ptr)
+ ast_channel_unlock(chan_ptr);
}
return res;
}