[asterisk-commits] oej: branch oej/cancel_answer_elsewhere r73097 - /team/oej/cancel_answer_else...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 3 08:34:55 CDT 2007


Author: oej
Date: Tue Jul  3 08:34:54 2007
New Revision: 73097

URL: http://svn.digium.com/view/asterisk?view=rev&rev=73097
Log:
Untested additional feature (idea from Frank Sautter, implementation by moi)

New dial flag to always enable the Answered Elsewhere header in SIP to avoid "missed calls"
on the display. This is useful for dialplans when dialling continues in other steps in a followme-
like fashion.

Maybe this could be implemented in Queue and app_followme() too, but that's something I
happily leave in the hands of BJ... :-)


Modified:
    team/oej/cancel_answer_elsewhere/apps/app_dial.c

Modified: team/oej/cancel_answer_elsewhere/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/cancel_answer_elsewhere/apps/app_dial.c?view=diff&rev=73097&r1=73096&r2=73097
==============================================================================
--- team/oej/cancel_answer_elsewhere/apps/app_dial.c (original)
+++ team/oej/cancel_answer_elsewhere/apps/app_dial.c Tue Jul  3 08:34:54 2007
@@ -99,6 +99,8 @@
 "  Options:\n"
 "    A(x) - Play an announcement to the called party, using 'x' as the file.\n"
 "    C    - Reset the CDR for this call.\n"
+"    c    - If DIAL cancels this call, always set the flag to tell the channel\n"
+"           driver that the call is answered elsewhere.\n"
 "    d    - Allow the calling user to dial a 1 digit extension while waiting for\n"
 "           a call to be answered. Exit to that extension if it exists in the\n"
 "           current context, or the context defined in the EXITCONTEXT variable,\n"
@@ -253,6 +255,7 @@
 	OPT_CALLER_PARK =	(1 << 26),
 	OPT_IGNORE_FORWARDING = (1 << 27),
 	OPT_CALLEE_GOSUB =	(1 << 28),
+	OPT_CANCEL_ELSEWHERE =  (1 << 29),
 };
 
 #define DIAL_STILLGOING			(1 << 30)
@@ -276,6 +279,7 @@
 AST_APP_OPTIONS(dial_exec_options, {
 	AST_APP_OPTION_ARG('A', OPT_ANNOUNCE, OPT_ARG_ANNOUNCE),
 	AST_APP_OPTION('C', OPT_RESETCDR),
+	AST_APP_OPTION('c', OPT_CANCEL_ELSEWHERE),
 	AST_APP_OPTION('d', OPT_DTMF_EXIT),
 	AST_APP_OPTION_ARG('D', OPT_SENDDTMF, OPT_ARG_SENDDTMF),
 	AST_APP_OPTION('f', OPT_FORCECLID),
@@ -1317,6 +1321,7 @@
 			goto out;
 		if (opts.flags) {
 			ast_copy_flags(tmp, &opts,
+				       OPT_CANCEL_ELSEWHERE |
 				       OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
 				       OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
 				       OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
@@ -1565,7 +1570,7 @@
 			ast_parseable_goto(peer, opt_args[OPT_ARG_GOTO]);
 			peer->priority++;
 			ast_pbx_start(peer);
-			hanguptree(outgoing, NULL, 0);
+			hanguptree(outgoing, NULL, ast_test_flag(&opts, OPT_CANCEL_ELSEWHERE ? 1 : 0));
 			if (continue_exec)
 				*continue_exec = 1;
 			res = 0;
@@ -1803,7 +1808,7 @@
 		ast_indicate(chan, -1);
 	}
 	ast_channel_early_bridge(chan, NULL);
-	hanguptree(outgoing, NULL, 0);
+	hanguptree(outgoing, NULL, ast_test_flag(&opts, OPT_CANCEL_ELSEWHERE) ? 1 : 0);
 	pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);
 	senddialendevent(chan, pa.status);
 	ast_debug(1, "Exiting with DIALSTATUS=%s.\n", pa.status);




More information about the asterisk-commits mailing list