summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorKevin Harwell <kharwell@digium.com>2013-12-13 18:33:25 +0000
committerKevin Harwell <kharwell@digium.com>2013-12-13 18:33:25 +0000
commit84e1790beb1c28f762fa991f99d4a41ede2c3935 (patch)
tree0d013a16a3d23b4e72c4392ca8875deb4206141c /channels/chan_sip.c
parentf425c4a086526d8f4da91d62a5e02121c09609b8 (diff)
bridge_native_rtp: Deadlock during 4-way conference creation
The change contains a slightly adjusted patch that was on the issue (submitted by kmoore). A fix was made by adding in a bridge lock while calling bridge_start/stop from the framehook callback. Since the framehook callback is not called from the bridging core the bridge is not locked, but needs to be before calling bridge_start. (closes issue ASTERISK-22749) Reported by: Kinsey Moore Review: https://reviewboard.asterisk.org/r/3066/ Patches: lock_inversion.diff uploaded by kmoore (license 6273) ........ Merged revisions 403767 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 5d729cd02..a7649127e 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -32667,11 +32667,8 @@ static int sip_set_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance *i
struct sip_pvt *p;
int changed = 0;
- /* Lock the channel and the private safely. */
- ast_channel_lock(chan);
p = ast_channel_tech_pvt(chan);
if (!p) {
- ast_channel_unlock(chan);
return -1;
}
sip_pvt_lock(p);
@@ -32679,7 +32676,6 @@ static int sip_set_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance *i
/* I suppose it could be argued that if this happens it is a bug. */
ast_debug(1, "The private is not owned by channel %s anymore.\n", ast_channel_name(chan));
sip_pvt_unlock(p);
- ast_channel_unlock(chan);
return 0;
}
@@ -32688,14 +32684,12 @@ static int sip_set_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance *i
!ast_channel_is_bridged(chan) &&
!sip_cfg.directrtpsetup) {
sip_pvt_unlock(p);
- ast_channel_unlock(chan);
return 0;
}
if (p->alreadygone) {
/* If we're destroyed, don't bother */
sip_pvt_unlock(p);
- ast_channel_unlock(chan);
return 0;
}
@@ -32704,7 +32698,6 @@ static int sip_set_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance *i
*/
if (nat_active && !ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA_NAT)) {
sip_pvt_unlock(p);
- ast_channel_unlock(chan);
return 0;
}
@@ -32770,7 +32763,6 @@ static int sip_set_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance *i
*/
ast_clear_flag(&p->flags[2], SIP_PAGE3_DIRECT_MEDIA_OUTGOING);
sip_pvt_unlock(p);
- ast_channel_unlock(chan);
return 0;
}
@@ -32791,7 +32783,6 @@ static int sip_set_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance *i
/* Reset lastrtprx timer */
p->lastrtprx = p->lastrtptx = time(NULL);
sip_pvt_unlock(p);
- ast_channel_unlock(chan);
return 0;
}