[asterisk-commits] file: trunk r81372 - in /trunk: CHANGES main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 30 09:42:42 CDT 2007


Author: file
Date: Thu Aug 30 09:42:41 2007
New Revision: 81372

URL: http://svn.digium.com/view/asterisk?view=rev&rev=81372
Log:
(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.

Modified:
    trunk/CHANGES
    trunk/main/pbx.c

Modified: trunk/CHANGES
URL: http://svn.digium.com/view/asterisk/trunk/CHANGES?view=diff&rev=81372&r1=81371&r2=81372
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Thu Aug 30 09:42:41 2007
@@ -272,3 +272,5 @@
   * The device state functionality in the Local channel driver has been updated
      to indicate INUSE or NOT_INUSE when a Local channel is being used as opposed
      to just UNKNOWN if the extension exists.
+  * When originating a call using AMI or pbx_spool that fails the reason for failure
+     will now be available in the failed extension using the REASON dialplan variable.

Modified: trunk/main/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/main/pbx.c?view=diff&rev=81372&r1=81371&r2=81372
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Thu Aug 30 09:42:41 2007
@@ -5053,10 +5053,13 @@
 			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);




More information about the asterisk-commits mailing list