[svn-commits] mmichelson: trunk r188544 - /trunk/apps/app_dial.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Apr 15 10:25:02 CDT 2009


Author: mmichelson
Date: Wed Apr 15 10:24:50 2009
New Revision: 188544

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=188544
Log:
Make the cancellation of the dial timeout on a call forward optional.

This introduces the 'z' option to app_dial. With it set, a call forward
will cancel any timeout originally set for this instance of the Dial
application.

AST-207


Modified:
    trunk/apps/app_dial.c

Modified: trunk/apps/app_dial.c
URL: http://svn.digium.com/svn-view/asterisk/trunk/apps/app_dial.c?view=diff&rev=188544&r1=188543&r2=188544
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Wed Apr 15 10:24:50 2009
@@ -369,6 +369,9 @@
 				<option name="X">
 					<para>Allow the calling party to enable recording of the call by sending
 					the DTMF sequence defined for one-touch automixmonitor in <filename>features.conf</filename>.</para>
+				</option>
+				<option name="z">
+					<para>On a call forward, cancel any dial timeout which has been set for this call.</para>
 				</option>
 				</optionlist>
 			</parameter>
@@ -502,6 +505,7 @@
 #define OPT_CANCEL_ELSEWHERE ((uint64_t)1 << 34)
 #define OPT_PEER_H           ((uint64_t)1 << 35)
 #define OPT_CALLEE_GO_ON     ((uint64_t)1 << 36)
+#define OPT_CANCEL_TIMEOUT   ((uint64_t)1 << 37)
 
 enum {
 	OPT_ARG_ANNOUNCE = 0,
@@ -554,6 +558,7 @@
 	AST_APP_OPTION('W', OPT_CALLER_MONITOR),
 	AST_APP_OPTION('x', OPT_CALLEE_MIXMONITOR),
 	AST_APP_OPTION('X', OPT_CALLER_MIXMONITOR),
+	AST_APP_OPTION('z', OPT_CANCEL_TIMEOUT),
 END_OPTIONS );
 
 #define CAN_EARLY_BRIDGE(flags,chan,peer) (!ast_test_flag64(flags, OPT_CALLEE_HANGUP | \
@@ -712,7 +717,7 @@
  * the outgoing channel without properly deleting it.
  */
 static void do_forward(struct chanlist *o,
-	struct cause_args *num, struct ast_flags64 *peerflags, int single)
+	struct cause_args *num, struct ast_flags64 *peerflags, int single, int *to)
 {
 	char tmpchan[256];
 	struct ast_channel *original = o->chan;
@@ -789,6 +794,9 @@
 		ast_channel_update_redirecting(in, apr);
 
 		ast_clear_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE);
+		if (ast_test_flag64(peerflags, OPT_CANCEL_TIMEOUT)) {
+			*to = -1;
+		}
 
 		ast_channel_unlock(in);
 		ast_channel_unlock(c);
@@ -942,7 +950,7 @@
 				continue;
 			/* here, o->chan == c == winner */
 			if (!ast_strlen_zero(c->call_forward)) {
-				do_forward(o, &num, peerflags, single);
+				do_forward(o, &num, peerflags, single, to);
 				continue;
 			}
 			f = ast_read(winner);
@@ -1735,7 +1743,7 @@
 		outbound_group = ast_strdupa(outbound_group);
 	}
 	ast_channel_unlock(chan);	
-	ast_copy_flags64(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID | OPT_CALLER_HANGUP | OPT_IGNORE_FORWARDING | OPT_IGNORE_CONNECTEDLINE);
+	ast_copy_flags64(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID | OPT_CALLER_HANGUP | OPT_IGNORE_FORWARDING | OPT_IGNORE_CONNECTEDLINE | OPT_CANCEL_TIMEOUT);
 
 	/* loop through the list of dial destinations */
 	rest = args.peers;




More information about the svn-commits mailing list