aboutsummaryrefslogtreecommitdiffstats
path: root/pbx.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-04 17:41:30 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-04 17:41:30 +0000
commita154153e5b7f6bda1f6072ca48e8c68b496b3e53 (patch)
tree2f9cefe8cb966c5ceff2edce99688965ec1134f2 /pbx.c
parent59ed6b9ed523ea53a202b18b2ba14a0a3c4d2d87 (diff)
If you're hanging up channels, be sure we clean it up...
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6712 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rwxr-xr-xpbx.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/pbx.c b/pbx.c
index 2b81d352d..3466a9844 100755
--- a/pbx.c
+++ b/pbx.c
@@ -4999,12 +4999,16 @@ int ast_pbx_outgoing_exten(const char *type, int format, void *data, int timeout
ast_mutex_unlock(&chan->lock);
if (ast_pbx_run(chan)) {
ast_log(LOG_ERROR, "Unable to run PBX on %s\n", chan->name);
+ if (channel)
+ *channel = NULL;
ast_hangup(chan);
res = -1;
}
} else {
if (ast_pbx_start(chan)) {
ast_log(LOG_ERROR, "Unable to start PBX on %s\n", chan->name);
+ if (channel)
+ *channel = NULL;
ast_hangup(chan);
res = -1;
}
@@ -5020,6 +5024,8 @@ int ast_pbx_outgoing_exten(const char *type, int format, void *data, int timeout
ast_cdr_failed(chan->cdr);
}
+ if (channel)
+ *channel = NULL;
ast_hangup(chan);
}
}
@@ -5079,6 +5085,8 @@ 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)
+ *channel = NULL;
ast_hangup(chan);
res = -1;
goto outgoing_exten_cleanup;