Skip to content

ReadExten()

Synopsis

Read an extension into a variable.

Description

Reads a '#' terminated string of digits from the user into the given variable.

Will set READEXTENSTATUS on exit with one of the following statuses:

  • READEXTENSTATUS

    • OK - A valid extension exists in ${variable}.

    • TIMEOUT - No extension was entered in the specified time. Also sets ${variable} to "t".

    • INVALID - An invalid extension, ${INVALID_EXTEN}, was entered. Also sets ${variable} to "i".

    • SKIP - Line was not up and the option 's' was specified.

    • ERROR - Invalid arguments were passed.

Syntax

ReadExten(variable,[filename,[context,[option,[timeout]]]])
Arguments
  • variable

  • filename - File to play before reading digits or tone with option 'i'

  • context - Context in which to match extensions.

  • option

    • s - Return immediately if the channel is not answered.

    • i - Play filename as an indication tone from your indications.conf or a directly specified list of frequencies and durations.

    • n - Read digits even if the channel is not answered.

    • p - The extension entered will be considered complete when a '#' is entered.

  • timeout - An integer number of seconds to wait for a digit response. If greater than '0', that value will override the default timeout.

Generated Version

This documentation was generated from Asterisk branch 18 using version GIT