]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge script <automerge@asterisk.org>
Wed, 5 Apr 2006 20:06:32 +0000 (20:06 +0000)
committerAutomerge script <automerge@asterisk.org>
Wed, 5 Apr 2006 20:06:32 +0000 (20:06 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@17734 65c4cc65-6c06-0410-ace0-fbb531ad65f3

pbx.c

diff --git a/pbx.c b/pbx.c
index b9662ad3dd7bc73d372ec1e3861937036e0ae7f6..96707fad64f650777778c259ea22762c80d7cd70 100644 (file)
--- a/pbx.c
+++ b/pbx.c
@@ -5025,8 +5025,10 @@ int ast_pbx_outgoing_exten(const char *type, int format, void *data, int timeout
                                } else {
                                        if (ast_pbx_start(chan)) {
                                                ast_log(LOG_ERROR, "Unable to start PBX on %s\n", chan->name);
-                                               if (channel)
+                                               if (channel) {
                                                        *channel = NULL;
+                                                       ast_mutex_unlock(&chan->lock);
+                                               }
                                                ast_hangup(chan);
                                                res = -1;
                                        } 
@@ -5042,13 +5044,15 @@ int ast_pbx_outgoing_exten(const char *type, int format, void *data, int timeout
                                                ast_cdr_failed(chan->cdr);
                                }
                        
-                               if (channel)
+                               if (channel) {
                                        *channel = NULL;
+                                       ast_mutex_unlock(&chan->lock);
+                               }
                                ast_hangup(chan);
                        }
                }
 
-               if(res < 0) { /* the call failed for some reason */
+               if (res < 0) { /* the call failed for some reason */
                        if (*reason == 0) { /* if the call failed (not busy or no answer)
                                            * update the cdr with the failed message */
                                cdr_res = ast_pbx_outgoing_cdr_failed();
@@ -5107,8 +5111,10 @@ int ast_pbx_outgoing_exten(const char *type, int format, void *data, int timeout
                if (ast_pthread_create(&as->p, &attr, async_wait, as)) {
                        ast_log(LOG_WARNING, "Failed to start async wait\n");
                        free(as);
-                       if (channel)
+                       if (channel) {
                                *channel = NULL;
+                               ast_mutex_unlock(&chan->lock);
+                       }
                        ast_hangup(chan);
                        res = -1;
                        goto outgoing_exten_cleanup;