aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-08-23 22:27:10 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-08-23 22:27:10 +0000
commitb4ba4dd1ca82c2448e87be01dc21e4bde3c2a4f3 (patch)
tree81a9d1b7ddcf6e4f7693fb2238d8ed95bcae5146 /channels
parent6645236b0c5dd52e7e20aaac0f894ea64aa67fa3 (diff)
Fix call pickup with SIP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1412 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_sip.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 5099c2a8b..7934d63d7 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -4752,22 +4752,23 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
transmit_response_reliable(p, "503 Unavailable", req);
c = NULL;
}
- } else if (ast_pickup_call(c)) {
- ast_log(LOG_NOTICE, "Nothing to pick up\n");
- transmit_response_reliable(p, "503 Unavailable", req);
- p->alreadygone = 1;
- /* Unlock locks so ast_hangup can do its magic */
- ast_mutex_unlock(&c->lock);
- ast_mutex_unlock(&p->lock);
- ast_hangup(c);
- ast_mutex_lock(&p->lock);
- c = NULL;
} else {
ast_mutex_unlock(&c->lock);
- ast_mutex_unlock(&p->lock);
- ast_hangup(c);
- ast_mutex_lock(&p->lock);
- c = NULL;
+ if (ast_pickup_call(c)) {
+ ast_log(LOG_NOTICE, "Nothing to pick up\n");
+ transmit_response_reliable(p, "503 Unavailable", req);
+ p->alreadygone = 1;
+ /* Unlock locks so ast_hangup can do its magic */
+ ast_mutex_unlock(&p->lock);
+ ast_hangup(c);
+ ast_mutex_lock(&p->lock);
+ c = NULL;
+ } else {
+ ast_mutex_unlock(&p->lock);
+ ast_hangup(c);
+ ast_mutex_lock(&p->lock);
+ c = NULL;
+ }
}
break;
case AST_STATE_RING: