diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-15 15:24:50 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-15 15:24:50 +0000 |
commit | 63308097d4363328acdd935b255cf84bb105ecb8 (patch) | |
tree | e8c6f6cf8b8c3aa5b83eb1e51317b5a041e4d8c2 /apps/app_dial.c | |
parent | 2da92f10a04234b3ada012e2a4d8f7600d5feb2d (diff) |
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
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@188544 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r-- | apps/app_dial.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c index 573e4c54c..ea4c5ba23 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -370,6 +370,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") <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> <parameter name="URL"> @@ -502,6 +505,7 @@ enum { #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_OPTIONS(dial_exec_options, BEGIN_OPTIONS 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 @@ static void senddialendevent(const struct ast_channel *src, const char *dialstat * 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 @@ static void do_forward(struct chanlist *o, 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 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, 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 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags 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; |