Index: apps/app_dial.c =================================================================== --- apps/app_dial.c (revision 102967) +++ apps/app_dial.c (working copy) @@ -115,6 +115,8 @@ " extension associated with the channel using a dialplan 'hint'.\n" " For example, some PSTNs do not allow CallerID to be set to anything\n" " other than the number assigned to the caller.\n" +" F(context^exten^pri) - When the caller hangs up - transfer the called party\n" +" to the specified context and extension and continue execution\n" " g - Proceed with dialplan execution at the current extension if the\n" " destination channel hangs up.\n" " G(context^exten^pri) - If the call is answered, transfer the calling party to\n" @@ -262,12 +264,13 @@ OPT_CALLEE_GOSUB = (1 << 28), OPT_CALLEE_MIXMONITOR = (1 << 29), OPT_CALLER_MIXMONITOR = (1 << 30), + OPT_CALLEE_GO_ON = (1 << 31), }; -#define DIAL_STILLGOING (1 << 31) -#define DIAL_NOFORWARDHTML ((uint64_t)1 << 32) /* flags are now 64 bits, so keep it up! */ -#define OPT_CANCEL_ELSEWHERE ((uint64_t)1 << 33) -#define OPT_PEER_H ((uint64_t)1 << 34) +#define DIAL_STILLGOING ((uint64_t)1 << 32) +#define DIAL_NOFORWARDHTML ((uint64_t)1 << 33) /* flags are now 64 bits, so keep it up! */ +#define OPT_CANCEL_ELSEWHERE ((uint64_t)1 << 34) +#define OPT_PEER_H ((uint64_t)1 << 35) enum { OPT_ARG_ANNOUNCE = 0, @@ -277,6 +280,7 @@ OPT_ARG_MUSICBACK, OPT_ARG_CALLEE_MACRO, OPT_ARG_CALLEE_GOSUB, + OPT_ARG_CALLEE_GO_ON, OPT_ARG_PRIVACY, OPT_ARG_DURATION_STOP, OPT_ARG_OPERMODE, @@ -292,6 +296,7 @@ AST_APP_OPTION_ARG('D', OPT_SENDDTMF, OPT_ARG_SENDDTMF), AST_APP_OPTION('e', OPT_PEER_H), AST_APP_OPTION('f', OPT_FORCECLID), + AST_APP_OPTION_ARG('F', OPT_CALLEE_GO_ON, OPT_ARG_CALLEE_GO_ON), AST_APP_OPTION('g', OPT_GO_ON), AST_APP_OPTION_ARG('G', OPT_GOTO, OPT_ARG_GOTO), AST_APP_OPTION('h', OPT_CALLEE_HANGUP), @@ -1869,9 +1874,15 @@ ast_set2_flag(peer, autoloopflag, AST_FLAG_IN_AUTOLOOP); /* set it back the way it was */ } if (res != AST_PBX_NO_HANGUP_PEER) { - if (!ast_check_hangup(chan)) - chan->hangupcause = peer->hangupcause; - ast_hangup(peer); + if (!ast_check_hangup(peer) && ast_test_flag64(&opts, OPT_CALLEE_GO_ON) && !ast_strlen_zero(opt_args[OPT_ARG_CALLEE_GO_ON])) { + replace_macro_delimiter(opt_args[OPT_ARG_CALLEE_GO_ON]); + ast_parseable_goto(peer, opt_args[OPT_ARG_CALLEE_GO_ON]); + ast_pbx_start(peer); + } else { + if (!ast_check_hangup(chan)) + chan->hangupcause = peer->hangupcause; + ast_hangup(peer); + } } } out: