diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-05 20:05:09 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-05 20:05:09 +0000 |
commit | d49bf2558814c56354039d18bbf526ae6456c959 (patch) | |
tree | 25182645aec70438406e208bc304a3574d2ff8aa /pbx.c | |
parent | dffac9785955855082ab0bcf87fb02a68131726d (diff) |
Merged revisions 17702 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r17702 | file | 2006-04-05 17:01:19 -0300 (Wed, 05 Apr 2006) | 2 lines
Unlock channel on failure so that ast_mutex_destroy doesn't throw a fit (issue #6647 reported by casper)
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@17726 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rw-r--r-- | pbx.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -4704,8 +4704,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; } @@ -4721,13 +4723,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(); @@ -4783,8 +4787,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; |