Fix potential hangup issues
authorMark Spencer <markster@digium.com>
Wed, 9 Apr 2003 16:47:40 +0000 (16:47 +0000)
committerMark Spencer <markster@digium.com>
Wed, 9 Apr 2003 16:47:40 +0000 (16:47 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@798 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 36aa294..1cbcf55 100755 (executable)
@@ -4164,13 +4164,15 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
                                if (strcmp(p->exten, ast_pickup_ext())) {
                                        if (ast_pbx_start(c)) {
                                                ast_log(LOG_WARNING, "Failed to start PBX :(\n");
-                                               sip_hangup(c);
+                                               ast_pthread_mutex_unlock(&c->lock);
+                                               ast_hangup(c);
                                                transmit_response_reliable(p, "503 Unavailable", req);
                                                c = NULL;
                                        }
                                } else if (ast_pickup_call(c)) {
                                        ast_log(LOG_WARNING, "Nothing to pick up\n");
-                                       sip_hangup(c);
+                                       ast_pthread_mutex_unlock(&c->lock);
+                                       ast_hangup(c);
                                        transmit_response_reliable(p, "503 Unavailable", req);
                                } else {
                                        ast_pthread_mutex_unlock(&c->lock);