summaryrefslogtreecommitdiff
path: root/main/pbx.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/pbx.c')
-rw-r--r--main/pbx.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/main/pbx.c b/main/pbx.c
index 427c0cca9..9050c55fa 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -6534,6 +6534,7 @@ int ast_pbx_outgoing_exten(const char *type, int format, void *data, int timeout
if (channel)
*channel = NULL;
ast_hangup(chan);
+ chan = NULL;
res = -1;
}
} else {
@@ -6544,6 +6545,7 @@ int ast_pbx_outgoing_exten(const char *type, int format, void *data, int timeout
ast_channel_unlock(chan);
}
ast_hangup(chan);
+ chan = NULL;
res = -1;
}
}
@@ -6562,6 +6564,7 @@ int ast_pbx_outgoing_exten(const char *type, int format, void *data, int timeout
ast_channel_unlock(chan);
}
ast_hangup(chan);
+ chan = NULL;
}
}
@@ -6589,7 +6592,11 @@ int ast_pbx_outgoing_exten(const char *type, int format, void *data, int timeout
pbx_builtin_setvar_helper(chan, "REASON", failed_reason);
if (account)
ast_cdr_setaccount(chan, account);
- ast_pbx_run(chan);
+ if (ast_pbx_run(chan)) {
+ ast_log(LOG_ERROR, "Unable to run PBX on %s\n", chan->name);
+ ast_hangup(chan);
+ }
+ chan = NULL;
}
}
}