aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/rtp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/main/rtp.c b/main/rtp.c
index 1260aff7d..f7078de5e 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -3713,6 +3713,14 @@ enum ast_bridge_result ast_rtp_bridge(struct ast_channel *c0, struct ast_channel
ast_channel_lock(c0);
}
+ /* Ensure neither channel got hungup during lock avoidance */
+ if (ast_check_hangup(c0) || ast_check_hangup(c1)) {
+ ast_log(LOG_WARNING, "Got hangup while attempting to bridge '%s' and '%s'\n", c0->name, c1->name);
+ ast_channel_unlock(c0);
+ ast_channel_unlock(c1);
+ return AST_BRIDGE_FAILED;
+ }
+
/* Find channel driver interfaces */
if (!(pr0 = get_proto(c0))) {
ast_log(LOG_WARNING, "Can't find native functions for channel '%s'\n", c0->name);