From: Matthew Jordan Date: Fri, 31 Jan 2014 23:34:00 +0000 (+0000) Subject: app_dial: Allow macro/gosub pre-bridge execution to occur on priorities X-Git-Tag: 12.1.0-rc1~3^2~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=127523631fd76718d594cf515c92310b94b71557;p=thirdparty%2Fasterisk.git app_dial: Allow macro/gosub pre-bridge execution to occur on priorities The parsing for the destination of the macro/gosub uses the '^' character to separate out context, extension, and priority. However, the logic for the macro/gosub execution was written such that it would only do the actual macro/gosub jump if a '^' character existed. This doesn't apply when the macro/gosub jump occurs in a priority/priority label. This patch changes the logic so that the parsing still occurs, but the jump will occur even for priorities/priority labels. (issue ASTERISK-23164) Review: https://reviewboard.asterisk.org/r/3154 ........ Merged revisions 407041 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 407074 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@407082 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_dial.c b/apps/app_dial.c index a85bfe454e..ed5d2858f2 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -2877,8 +2877,9 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast /* perform a transfer to a new extension */ if (strchr(macro_transfer_dest, '^')) { /* context^exten^priority*/ ast_replace_subargument_delimiter(macro_transfer_dest); - if (!ast_parseable_goto(chan, macro_transfer_dest)) - ast_set_flag64(peerflags, OPT_GO_ON); + } + if (!ast_parseable_goto(chan, macro_transfer_dest)) { + ast_set_flag64(peerflags, OPT_GO_ON); } } } else { @@ -2958,8 +2959,9 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast /* perform a transfer to a new extension */ if (strchr(gosub_transfer_dest, '^')) { /* context^exten^priority*/ ast_replace_subargument_delimiter(gosub_transfer_dest); - if (!ast_parseable_goto(chan, gosub_transfer_dest)) - ast_set_flag64(peerflags, OPT_GO_ON); + } + if (!ast_parseable_goto(chan, gosub_transfer_dest)) { + ast_set_flag64(peerflags, OPT_GO_ON); } } } else {