]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_dial: Allow macro/gosub pre-bridge execution to occur on priorities
authorMatthew Jordan <mjordan@digium.com>
Fri, 31 Jan 2014 23:18:17 +0000 (23:18 +0000)
committerMatthew Jordan <mjordan@digium.com>
Fri, 31 Jan 2014 23:18:17 +0000 (23:18 +0000)
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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@407041 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_dial.c

index ac0574cb31eef297378e49bf91fe066c8c3cafb0..dd41ec0857f9dc4f79493a51600e7330c8f59a87 100644 (file)
@@ -2760,8 +2760,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*/
                                                replace_macro_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);
                                        }
                                }
                        }
@@ -2872,8 +2873,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*/
                                                replace_macro_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);
                                        }
                                }
                        }