aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_local.c
diff options
context:
space:
mode:
authortwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-22 23:20:27 +0000
committertwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-22 23:20:27 +0000
commitf6b4f75aacfd29b4b4d6226cb5b4e818e747a32b (patch)
tree9510ff603b80d7c1303b463e354c1ec4ea0bc6d0 /channels/chan_local.c
parentf6587a6743c6da9cf227f9cfb1a0a814c53ca90d (diff)
Merged revisions 288507 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r288507 | twilson | 2010-09-22 16:18:27 -0700 (Wed, 22 Sep 2010) | 22 lines Merged revisions 288500 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r288500 | twilson | 2010-09-22 16:10:09 -0700 (Wed, 22 Sep 2010) | 15 lines Merged revisions 288499 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r288499 | twilson | 2010-09-22 16:00:30 -0700 (Wed, 22 Sep 2010) | 8 lines Don't let a Local channel get bridged to itself If a local channel gets bridged to itself, it becomes orphaned with no devices left to actually tell it to hang up. This patch modifies local_fixup() to detect this case and deny it. Review: https://reviewboard.asterisk.org/r/934 ........ ................ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@288519 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_local.c')
-rw-r--r--channels/chan_local.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index 8d309f5a7..343e41f90 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -568,6 +568,15 @@ static int local_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
p->owner = newchan;
else
p->chan = newchan;
+
+ /* Do not let a masquerade cause a Local channel to be bridged to itself! */
+ if (p->owner->_bridge == p->chan || p->chan->_bridge == p->owner) {
+ ast_log(LOG_WARNING, "You can not bridge a Local channel to itself!\n");
+ ast_mutex_unlock(&p->lock);
+ ast_queue_hangup(newchan);
+ return -1;
+ }
+
ast_mutex_unlock(&p->lock);
return 0;
}