B.49. Goto()

Jumps to a specified priority, extension and context.
Goto([[context,]extension,]priority)
Goto(named_priority)
Hands the currently active channel to the specified priority (and optionally, extension and context).
Optionally, a named priority may be specified to access a labelled priority. Named priorities work only in the current extension.
Always returns 0, even if the target is invalid.
exten => 123,1,Answer()
exten => 123,2,Set(COUNT=1)
exten => 123,3,SayNumber(${COUNT})
exten => 123,4,Set(COUNT=$[ ${COUNT} + 1 ])
exten => 123,5,Goto(3)

; das gleiche mit einer benannten Priorität:
exten => 124,1,Answer()
exten => 124,2,Set(COUNT=1)
exten => 124,3(announcement),SayNumber(${COUNT})
exten => 124,4,Set(COUNT=$[ ${COUNT} + 1 ])
exten => 124,5,Goto(announcement)

Note

Internal help for this application in Asterisk 1.4:
  -= Info about application 'Goto' =- 

[Synopsis]
Jump to a particular priority, extension, or context

[Description]
  Goto([[context|]extension|]priority): This application will cause the
calling channel to continue dialplan execution at the specified priority.
If no specific extension, or extension and context, are specified, then this
application will jump to the specified priority of the current extension.
  If the attempt to jump to another location in the dialplan is not successful,
then the channel will continue at the next priority of the current extension.
diff output to internal help in Asterisk 1.2:
- none -