aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-06 21:14:46 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-06 21:14:46 +0000
commitfe764ed2df32bd1ced28ca458499d0accf22032c (patch)
tree207afcb983f96a45895316be07b9b970ad65f8ee /channels/chan_sip.c
parent6790f59ff6df6b97cf4d44ff867b7f00d961c458 (diff)
Fix a crash when doing call pickups with SIP phones. The code unlocked the
channel when it should not have. (issue #9652, reported by corruptor, fixed by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@67862 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 66840680e..ba811cdeb 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1500,7 +1500,7 @@ static void build_rpid(struct sip_pvt *p);
/*------Request handling functions */
static int handle_request(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int *recount, int *nounlock);
-static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int debug, int seqno, struct sockaddr_in *sin, int *recount, char *e);
+static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int debug, int seqno, struct sockaddr_in *sin, int *recount, char *e, int *nounlock);
static int handle_request_refer(struct sip_pvt *p, struct sip_request *req, int debug, int ignore, int seqno, int *nounlock);
static int handle_request_bye(struct sip_pvt *p, struct sip_request *req);
static int handle_request_register(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, char *e);
@@ -13260,7 +13260,7 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, in
* plan but tries to find the active call and masquerade
* into it
*/
-static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int debug, int seqno, struct sockaddr_in *sin, int *recount, char *e)
+static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int debug, int seqno, struct sockaddr_in *sin, int *recount, char *e, int *nounlock)
{
int res = 1;
int gotdest;
@@ -13636,6 +13636,7 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
}
} else { /* Pickup call in call group */
ast_channel_unlock(c);
+ *nounlock = 1;
if (ast_pickup_call(c)) {
ast_log(LOG_NOTICE, "Nothing to pick up for %s\n", p->callid);
if (ast_test_flag(req, SIP_PKT_IGNORE))
@@ -14890,7 +14891,7 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
res = handle_request_options(p, req);
break;
case SIP_INVITE:
- res = handle_request_invite(p, req, debug, seqno, sin, recount, e);
+ res = handle_request_invite(p, req, debug, seqno, sin, recount, e, nounlock);
break;
case SIP_REFER:
res = handle_request_refer(p, req, debug, ignore, seqno, nounlock);