aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-30 14:42:41 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-30 14:42:41 +0000
commitce33d3a5189862d36f3a315b3e7b15d9a676b5fc (patch)
tree84022d0159f99e84ab51ed0acde9706ac6400812 /main
parent9fa69c31d44fa1a95869a05fd8284c88e03fcf97 (diff)
(closes issue #10603)
Reported by: jmls Patches: pbx.diff uploaded by jmls (license 141) Add REASON dialplan variable for when an originated call fails and the failed extension is executed. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81372 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/pbx.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main/pbx.c b/main/pbx.c
index c43faa585..666f33458 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -5053,10 +5053,13 @@ int ast_pbx_outgoing_exten(const char *type, int format, void *data, int timeout
if (ast_exists_extension(chan, context, "failed", 1, NULL)) {
chan = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "", "", "", 0, "OutgoingSpoolFailed");
if (chan) {
+ char failed_reason[4] = "";
if (!ast_strlen_zero(context))
ast_copy_string(chan->context, context, sizeof(chan->context));
set_ext_pri(chan, "failed", 1);
ast_set_variables(chan, vars);
+ snprintf(failed_reason, sizeof(failed_reason), "%d", *reason);
+ pbx_builtin_setvar_helper(chan, "REASON", failed_reason);
if (account)
ast_cdr_setaccount(chan, account);
ast_pbx_run(chan);