Gosub

Since N/A AGI Commands Found this useful? Upvote it. ×

Cause the channel to execute the specified dialplan subroutine.

Last reviewed 2026-04-14

gosub context extension priority optional-argument
Description

Cause the channel to execute the specified dialplan subroutine, returning to the dialplan with execution of a Return().

Arguments
  • context required
  • extension required
  • priority required
  • optional-argument

User Notes

No notes yet. Be the first to contribute a tip or example.

Contribute a note

Share a tip, gotcha, or practical example. Keep it under 2000 characters. No questions (use the Asterisk community forums for support). Wrap code in backticks.

Moderated before publishing. Email never shown.