diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-30 14:43:15 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-30 14:43:15 +0000 |
commit | 32e1af476a68f4ab9c078e890968fe36af716fcf (patch) | |
tree | a18d9824a597bfb4fe43b900e5842fca8d4be793 | |
parent | 7e11ebeb1f2780dfad0f1f810463edbf48e1ee1b (diff) |
Fix locking issues under one legged replaces scenarios.
(closes issue #11420)
Reported by: irroot
Patches:
chan_sip_oneleg.patch uploaded by irroot (license 52)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90269 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_sip.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index c9281c75f..31d1e3266 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -13405,7 +13405,8 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, in if (option_debug > 3) ast_log(LOG_DEBUG, "Invite/Replaces: preparing to masquerade %s into %s\n", c->name, replacecall->name); /* Unlock clone, but not original (replacecall) */ - ast_channel_unlock(c); + if (!oneleggedreplace) + ast_channel_unlock(c); /* Unlock PVT */ ast_mutex_unlock(&p->refer->refer_call->lock); @@ -13437,7 +13438,8 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, in ast_log(LOG_WARNING, "Invite/Replace: Could not read frame from RING channel \n"); } c->hangupcause = AST_CAUSE_SWITCH_CONGESTION; - ast_channel_unlock(replacecall); + if (!oneleggedreplace) + ast_channel_unlock(replacecall); } else { /* Bridged call, UP channel */ if ((f = ast_read(replacecall))) { /* Force the masq to happen */ /* Masq ok */ @@ -13472,7 +13474,8 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, in } ast_channel_unlock(p->owner); /* Unlock new owner */ - ast_mutex_unlock(&p->lock); /* Unlock SIP structure */ + if (!oneleggedreplace) + ast_mutex_unlock(&p->lock); /* Unlock SIP structure */ /* The call should be down with no ast_channel, so hang it up */ c->tech_pvt = NULL; |