]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Make ParkAndAnnounce return to priority + 1 when return context is not defined
authorMatthew Jordan <mjordan@digium.com>
Sun, 24 Feb 2013 15:33:32 +0000 (15:33 +0000)
committerMatthew Jordan <mjordan@digium.com>
Sun, 24 Feb 2013 15:33:32 +0000 (15:33 +0000)
The ParkAndAnnounce application documentation for the optional return_context
parameter states the following:

return_context
    The goto-style label to jump the call back into after timeout. Default
    'priority+1'.

Unfortunately, the application was sending the channel back into the dialplan
at 'priority', which is the ParkAndAnnounce application call. This causes an
infinite loop of the channel constantly being parked, announced, timed out,
parked, announced, timed out... while fun, especially for those callers you
wish to drive to the end of madness, this was not the intent of the
application.

(closes issue ASTERISK-20113)
Reported by: serginuez
patches:
  app_parkandannounce.diff uploaded by serginuez (License 6405)

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

apps/app_parkandannounce.c

index 5207a7441e467bd096de24bf15bbf167f43b03af..a20a4cbc08bdc0f598299211ec5d8389af134653 100644 (file)
@@ -129,6 +129,8 @@ static int parkandannounce_exec(struct ast_channel *chan, const char *data)
        if (!ast_strlen_zero(args.return_context)) {
                ast_clear_flag(chan, AST_FLAG_IN_AUTOLOOP);
                ast_parseable_goto(chan, args.return_context);
+       } else {
+               chan->priority++;
        }
 
        ast_verb(3, "Return Context: (%s,%s,%d) ID: %s\n", chan->context, chan->exten,