Source:
extensions.class.phpThis document covers the
extensionbase class and allext_*subclasses used to generate Asterisk dialplan applications in FreePBX.
- Base Class —
extension - Call Flow & Routing
- Looping
- Channel Operations
- Variable & Data Operations
- Caller ID
- SIP Headers
- AstDB (Asterisk Database)
- Voicemail
- Queue Management
- Conferencing
- Recording & Monitoring
- CDR (Call Detail Record)
- Playback & Prompts
- Music on Hold
- AGI (Asterisk Gateway Interface)
- Speech Recognition
- Fax
- Call Completion
- Messaging
- Authentication & Privacy
- Call Pickup & Spy
- Parking
- DTMF
- AMD (Answering Machine Detection)
- DISA (Direct Inward System Access)
- Paging
- MySQL
- Dictation
- Debugging & Logging
- Miscellaneous
The base class from which most ext_* classes inherit.
| Property | Type | Description |
|---|---|---|
$data |
mixed |
Generic data payload passed via the constructor. |
Constructor: __construct($data = '')
Methods:
| Method | Description |
|---|---|
output() |
Returns $this->data as raw dialplan output. |
incrementContents($value) |
Hook for incrementing priority references. Returns true (no-op in base). |
Usage:
$ext->add('from-internal', 's', '', new extension('NoOp(hello)'));Generates the Asterisk Goto() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$pri |
mixed |
(required) | Priority or label to jump to. |
$ext |
string|false |
false |
Extension to jump to. Required if $context is set. |
$context |
string|false |
false |
Context to jump to. |
Output: Goto([context,][ext,]pri)
Example:
new ext_goto('1', 's', 'ext-did');
// Output: Goto(ext-did,s,1)Generates the Asterisk GotoIf() application for conditional branching.
| Parameter | Type | Default | Description |
|---|---|---|---|
$condition |
string |
(required) | The condition expression. |
$true_priority |
string |
(required) | Destination if condition is true. |
$false_priority |
string|false |
false |
Destination if condition is false. |
Output: GotoIf(condition?true_priority[:false_priority])
Example:
new ext_gotoif('$["${COUNT}" > "5"]', 'over5', 'under5');
// Output: GotoIf($["${COUNT}" > "5"]?over5:under5)Generates the Asterisk GotoIfTime() application for time-based branching.
| Parameter | Type | Default | Description |
|---|---|---|---|
$condition |
string |
(required) | Time condition (e.g., 08:00-17:00,mon-fri,*,*). |
$true_priority |
string |
(required) | Destination if condition matches. |
Note: For Asterisk ≥ 1.6, pipe (
|) delimiters are automatically converted to commas (,).
Output: GotoIfTime(condition?true_priority)
Generates the Asterisk Gosub() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$pri |
mixed |
(required) | Priority to call. |
$ext |
string|false |
false |
Extension. Required if $context is set. |
$context |
string|false |
false |
Context. |
$args |
string |
'' |
Arguments to pass to the subroutine. |
Output: Gosub([context,][ext,]pri(args))
Example:
new ext_gosub('1', 's', 'sub-record-check', 'in,${EXTEN}');
// Output: Gosub(sub-record-check,s,1(in,${EXTEN}))Generates the Asterisk GosubIf() application for conditional subroutine calls.
| Parameter | Type | Default | Description |
|---|---|---|---|
$condition |
string |
(required) | The condition expression. |
$true_priority |
string |
(required) | Subroutine destination if true. |
$false_priority |
string|false |
false |
Subroutine destination if false. |
$true_args |
string |
'' |
Arguments for the true branch. |
$false_args |
string |
'' |
Arguments for the false branch. |
Output: GosubIf(condition?true_priority(true_args)[:false_priority(false_args)])
Generates the Asterisk Return() application to return from a Gosub.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Optional return value. |
Output: Return(data)
Generates the Asterisk StackPop() application. Removes the top entry from the gosub stack without returning.
Output: StackPop()
Generates a Gosub() call that emulates the deprecated Macro() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$macro |
string |
(required) | Macro name. |
$args |
string |
'' |
Arguments. |
Note:
Macro()is deprecated in Asterisk. This class automatically converts toGosub(macro-<name>,s,1(args)).
Output: Gosub(macro-<macro>,s,1(args))
Generates a return from a macro subroutine (deprecated macro compatibility).
Note: Automatically converted to
Return(${GOSUB_RETVAL})since Macro is deprecated.
Output: Return(${GOSUB_RETVAL})
Generates the Asterisk ExecIf() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$expr |
string |
(required) | Condition expression. |
$app_true |
string |
(required) | Application to run if true. |
$data_true |
string |
'' |
Data for the true application. |
$app_false |
string |
'' |
Application to run if false (Asterisk ≥ 1.6). |
$data_false |
string |
'' |
Data for the false application. |
Output: ExecIf(expr?app_true(data_true)[:app_false(data_false)])
Generates the Asterisk TryExec() application. Attempts to execute an application; if it doesn't exist, continues without error.
| Parameter | Type | Default | Description |
|---|---|---|---|
$try_application |
string |
'' |
Application string to try. |
Note: This class extends
extensions(the container class) rather thanextension— likely a bug in the original code.
Output: TryExec(try_application)
Generates the Asterisk Transfer() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$number |
string |
(required) | Destination to transfer to. |
Output: Transfer(number)
Generates the Asterisk While() application to begin a loop.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Loop condition expression. |
Output: While(data)
Generates the Asterisk EndWhile application to end a While loop.
Output: EndWhile
Generates the Asterisk ExitWhile application to break out of a While loop.
Output: ExitWhile
Generates the Asterisk ContinueWhile application to skip to the next loop iteration.
Output: ContinueWhile
Generates the Asterisk Dial() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$number |
string |
(required) | Dial string (e.g., SIP/100). |
$options |
string |
"tr" |
Dial options. |
Output: Dial(number,options)
Example:
new ext_dial('SIP/100&SIP/101', '30,tTr');
// Output: Dial(SIP/100&SIP/101,30,tTr)Generates the Asterisk Originate() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$tech_data |
string |
(required) | Technology/data for the channel (e.g., SIP/100). |
$type |
string |
(required) | Type: exten or app. |
$arg1 |
string |
(required) | First argument (context or app name). |
$arg2 |
string |
(required) | Second argument (extension or app data). |
$arg3 |
string |
'' |
Third argument (priority). |
Output: Originate(tech_data,type,arg1,arg2,arg3)
Generates the Asterisk Bridge() application to bridge channels.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Bridge arguments. |
Output: Bridge(data)
Generates the Asterisk Answer application.
Output: Answer
Generates the Asterisk Hangup() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Optional hangup cause code. |
Output: Hangup(data)
Generates the Asterisk Busy() application to indicate busy and wait.
| Parameter | Type | Default | Description |
|---|---|---|---|
$time |
string |
'20' |
Seconds to wait before hanging up. |
Output: Busy(time)
Generates the Asterisk Congestion() application to indicate congestion.
| Parameter | Type | Default | Description |
|---|---|---|---|
$time |
string |
'20' |
Seconds to wait before hanging up. |
Output: Congestion(time)
Generates the Asterisk Ringing() application to indicate ringing.
Output: Ringing()
Generates the Asterisk Progress application to send early media progress.
Output: Progress
Generates the Asterisk Wait() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Number of seconds to wait. |
Output: Wait(data)
Generates the Asterisk WaitExten() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$seconds |
string |
"" |
Seconds to wait for extension input. |
$options |
string |
"" |
Additional options (e.g., music-on-hold class). |
Output: WaitExten(seconds,options)
Generates the Asterisk WaitForSilence() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Parameters (silence threshold, iterations, timeout). |
Output: WaitForSilence(data)
Generates the Asterisk Set() application to set a channel variable.
| Parameter | Type | Default | Description |
|---|---|---|---|
$var |
string |
(required) | Variable name. |
$value |
string |
'' |
Value to assign. |
Output: Set(var=value)
Alias for ext_setvar. Exists because SetVar() was renamed to Set() in Asterisk 1.2.
Generates the Asterisk Set() application with the global flag.
| Parameter | Type | Default | Description |
|---|---|---|---|
$var |
string |
(required) | Global variable name. |
$value |
string |
(required) | Value to assign. |
Output: Set(var=value,g)
Generates a Set() call that sets a hash variable. Extends ext_setvar.
| Parameter | Type | Default | Description |
|---|---|---|---|
$hash |
string |
(required) | Hash name. |
$var |
string |
(required) | Key within the hash. |
$value |
string |
'' |
Value to assign. |
Output: Set(HASH(hash,var)=value)
Generates the Asterisk ClearHash() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$hash_name |
string |
(required) | Hash name to clear. |
Output: ClearHash(hash_name)
Sets the channel language.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Language code (e.g., en, fr). |
Output: Set(CHANNEL(language)=data)
Sets the digit timeout for the channel.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Timeout in seconds. |
Output: Set(TIMEOUT(digit)=data)
Sets the response timeout for the channel.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Timeout in seconds. |
Output: Set(TIMEOUT(response)=data)
Sets the Caller ID name.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Caller ID name to set. |
Output: Set(CALLERID(name)=data)
Sets the Caller ID presentation.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Presentation value (e.g., allowed_not_screened). |
Note: Uses
SetCallerPres()for Asterisk < 1.6,Set(CALLERPRES()=...)for ≥ 1.6.
Output: Set(CALLERPRES()=data) (Asterisk ≥ 1.6)
Sets the Caller ID name presentation.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Presentation value. |
Output: Set(CALLERID(name-pres)=data)
Sets the Caller ID number presentation.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Presentation value. |
Output: Set(CALLERID(num-pres)=data)
Looks up the Caller ID name from the AstDB cidname family and sets it if found.
Output: ExecIf($["${DB(cidname/${CALLERID(num)})}" != ""]?Set(CALLERID(name)=${DB(cidname/${CALLERID(num)})}))
Looks up the Caller ID name via TXTCIDNAME function.
| Parameter | Type | Default | Description |
|---|---|---|---|
$cidnum |
string |
(required) | Caller ID number to look up. |
Output: Set(TXTCIDNAME=${TXTCIDNAME(cidnum)})
Adds a SIP header to the outgoing INVITE.
| Parameter | Type | Default | Description |
|---|---|---|---|
$header |
string |
(required) | Header name. |
$value |
string |
(required) | Header value. |
Output: SIPAddHeader(header: value)
Gets a SIP header value and assigns it to a variable.
| Parameter | Type | Default | Description |
|---|---|---|---|
$value |
string |
(required) | Variable name to store the value. |
$header |
string |
(required) | Header name to retrieve. |
Output: SIPGetHeader(value=header)
Removes a SIP header.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Header name pattern to remove. |
Output: SIPRemoveHeader(data)
Adds an Alert-Info SIP header (commonly used for distinctive ring).
| Parameter | Type | Default | Description |
|---|---|---|---|
$value |
string |
(required) | Alert-Info value. |
Output: SIPAddHeader(Alert-Info: value)
Retrieves a value from the Asterisk database.
| Parameter | Type | Default | Description |
|---|---|---|---|
$varname |
string |
(required) | Variable to store the result. |
$key |
string |
(required) | Database key (family/key format). |
Output: Set(varname=${DB(key)})
Stores a value in the Asterisk database.
| Parameter | Type | Default | Description |
|---|---|---|---|
$key |
string |
(required) | Database key (family/key format). |
$data |
string |
(required) | Value to store. |
Output: Set(DB(key)=data)
Deletes a key from the Asterisk database.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Database key to delete (family/key format). |
Output: Noop(Deleting: data ${DB_DELETE(data)})
Deletes an entire family/tree from the Asterisk database.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Database family to delete. |
Output: dbDeltree(data)
Stores a value in the Asterisk database using family/key format.
| Parameter | Type | Default | Description |
|---|---|---|---|
$family |
string |
(required) | Database family. |
$key |
string |
(required) | Database key. |
$value |
string |
(required) | Value to store. |
Output: Set(DB(family/key)=value)
Generates the Asterisk VoiceMail() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Mailbox and options (e.g., 100@default,u). |
Output: VoiceMail(data)
Generates the Asterisk VoiceMailMain() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Mailbox and options. |
Output: VoiceMailMain(data)
Checks if a voicemail box exists and sets VMBOXEXISTSSTATUS.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Mailbox to check (e.g., 100@default). |
Output: Set(VMBOXEXISTSSTATUS=${IF(${VM_INFO(data,exists)}?SUCCESS:FAILED)})
Generates the Asterisk VMAuthenticate() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$mailbox |
string |
'' |
Mailbox for authentication. |
$options |
string |
'' |
Options (e.g., s for skip). |
Output: VMAuthenticate(mailbox[,options])
Generates the Asterisk Queue() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$queuename |
string |
(required) | Queue name. |
$options |
string |
(required) | Queue options. |
$optionalurl |
string |
(required) | Optional URL. |
$announceoverride |
string |
(required) | Announcement override file. |
$timeout |
string |
(required) | Timeout in seconds. |
$agi |
string |
'' |
AGI script to run. |
$macro |
string |
'' |
Macro to run. |
$gosub |
string |
'' |
Gosub to run. |
$rule |
string |
'' |
Queue rule. |
$position |
string |
'' |
Position in queue. |
Output: Queue(queuename,options,URL,announceoverride,timeout,AGI,macro,gosub,rule,position)
Generates the Asterisk QueueLog() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$queue |
string |
(required) | Queue name. |
$uniqueid |
string |
(required) | Unique call ID. |
$agent |
string |
(required) | Agent interface. |
$event |
string |
(required) | Event name. |
$additionalinfo |
string |
'' |
Additional info. |
Output: QueueLog(queue,uniqueid,agent,event,additionalinfo)
Generates the Asterisk AddQueueMember() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$queue |
string |
(required) | Queue name. |
$channel |
string |
(required) | Channel/interface to add. |
Output: AddQueueMember(queue,channel)
Generates the Asterisk RemoveQueueMember() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$queue |
string |
(required) | Queue name. |
$channel |
string |
(required) | Channel/interface to remove. |
Output: RemoveQueueMember(queue,channel)
Generates the Asterisk PauseQueueMember() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$queue |
string |
(required) | Queue name. |
$agent |
string |
(required) | Agent interface. |
$event |
string |
'' |
Reason/event. |
$additionalinfo |
string |
'' |
Additional info. |
Output: PauseQueueMember(queue,agent,event,additionalinfo)
Generates the Asterisk UnpauseQueueMember() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$queue |
string |
(required) | Queue name. |
$agent |
string |
(required) | Agent interface. |
$event |
string |
(required) | Reason/event. |
$additionalinfo |
string |
'' |
Additional info. |
Output: UnpauseQueueMember(queue,agent,event,additionalinfo)
Generates the Asterisk ConfBridge() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$confno |
string |
(required) | Conference number/name. |
$options |
string |
'' |
Bridge profile options. |
$pin |
string |
'' |
PIN for the conference. |
Output: ConfBridge(confno,options,pin)
Generates either MeetMe() or ConfBridge() depending on the ASTCONFAPP configuration.
| Parameter | Type | Default | Description |
|---|---|---|---|
$confno |
string |
(required) | Conference number. |
$options |
string |
'' |
Conference options. |
$pin |
string |
'' |
Conference PIN. |
Note: When
ASTCONFAPPisapp_confbridge, MeetMe-only options are automatically stripped.
Output: MeetMe(confno,options,pin) or ConfBridge(confno,options,pin)
Helper Method: in_ast_var_range($pos, $range) — Checks if a character position falls within an Asterisk variable range.
Generates the Asterisk MeetMeAdmin() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$confno |
string |
(required) | Conference number. |
$command |
string |
(required) | Admin command (e.g., K for kick). |
$user |
string |
'' |
User number. |
Output: MeetMeAdmin(confno,command,user)
Generates the Asterisk Record() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Filename and options. |
Output: Record(data)
Generates the Asterisk MixMonitor() application for call recording.
| Parameter | Type | Default | Description |
|---|---|---|---|
$file |
string |
(required) | Filename to record to. |
$options |
string |
"" |
Recording options (e.g., a for append). |
$postcommand |
string |
"" |
Command to execute after recording. |
Output: MixMonitor(file,options,postcommand)
Generates the Asterisk StopMonitor() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Optional parameters. |
Output: StopMonitor(data)
Generates the Asterisk StopMixMonitor() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Optional parameters. |
Output: StopMixMonitor(data)
Generates the Asterisk PauseMonitor() application.
Output: PauseMonitor()
Generates the Asterisk UnPauseMonitor() application.
Output: UnPauseMonitor()
Generates the Asterisk ResetCDR() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Options. |
Output: ResetCDR(data)
Disables CDR for the current channel.
Note: For Asterisk ≥ 12.0, outputs
Set(CDR_PROP(disable)=true). For older versions, outputsNoCDR().
Output: Set(CDR_PROP(disable)=true) (Asterisk ≥ 12.0)
Generates the Asterisk ForkCDR() application.
Output: ForkCDR()
Generates the Asterisk Playback() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Sound file(s) to play. |
Output: Playback(data)
Generates the Asterisk Background() application (plays sound while accepting DTMF input).
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Sound file(s) to play. |
Output: Background(data)
Generates the Asterisk BackgroundDetect() application for background sound detection.
| Parameter | Type | Default | Description |
|---|---|---|---|
$filename |
string |
(required) | Sound file to play. |
$silence |
int|null |
null |
Silence threshold in ms. |
$min |
int|null |
null |
Minimum talking duration in ms. |
$max |
int|null |
null |
Maximum talking duration in ms. |
Output: BackgroundDetect(filename[,silence][,min][,max])
Generates the Asterisk Read() application to read DTMF input.
| Parameter | Type | Default | Description |
|---|---|---|---|
$astvar |
string |
(required) | Variable to store input. |
$filename |
string |
'' |
Prompt file to play. |
$maxdigits |
string |
'' |
Maximum digits to accept. |
$option |
string |
'' |
Options (e.g., s for skip). |
$attempts |
string |
'' |
Number of attempts. |
$timeout |
string |
'' |
Timeout in seconds. |
Output: Read(astvar,filename,maxdigits,option,attempts,timeout)
Generates the Asterisk SayDigits() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Digits to say. |
Output: SayDigits(data)
Generates the Asterisk SayNumber() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
(required) | Number to say. |
$gender |
string |
'f' |
Gender for language-specific pronunciation. |
Output: SayNumber(data,gender)
Generates the Asterisk SayAlpha() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
String to spell out. |
Output: SayAlpha(data)
Generates the Asterisk SayPhonetic() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
String to speak phonetically. |
Output: SayPhonetic(data)
Generates the Asterisk SayUnixTime() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Unix timestamp and format options. |
Note: Backslashes are automatically stripped for Asterisk ≥ 1.6 compatibility.
Output: SayUnixTime(data)
Generates the Asterisk Echo() application (echo audio for testing).
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Options. |
Output: Echo(data)
Generates the Flite() application (text-to-speech using Flite).
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Text to speak. |
Output: Flite('data')
Generates the Festival() application (text-to-speech using Festival).
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Text to speak. |
Output: Festival(data)
Generates the Asterisk Playtones() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Tone definition string. |
Output: Playtones(data)
Generates the Asterisk StopPlaytones application.
Output: StopPlaytones
Generates the Asterisk MusicOnHold() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Music class and options. |
Output: MusicOnHold(data)
Sets the music-on-hold class for the channel.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Music class name. |
Output: Set(CHANNEL(musicclass)=data)
Generates the Asterisk StartMusicOnHold() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Music class. |
Output: StartMusicOnHold(data)
Generates the Asterisk StopMusicOnHold() application.
Output: StopMusicOnHold()
Generates the Asterisk AGI() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
AGI script path and arguments. |
Note: If FastAGI is enabled in FreePBX Core, the script path is automatically prepended with
agi://127.0.0.1/unless it already uses anagi://URI.
Output: AGI(data) or AGI(agi://127.0.0.1/data)
Generates the Asterisk DeadAGI() application (AGI for dead/hungup channels).
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
AGI script path and arguments. |
Output: DeadAGI(data)
Generates the Asterisk SpeechCreate() application to initialize a speech engine.
| Parameter | Type | Default | Description |
|---|---|---|---|
$engine |
string|null |
null |
Speech engine name. |
Output: SpeechCreate([engine])
Generates the Asterisk SpeechStart() application.
Output: SpeechStart()
Generates the Asterisk SpeechLoadGrammar() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$grammar_name |
string |
(required) | Grammar identifier. |
$path_to_grammar |
string |
(required) | Path to the grammar file. |
Output: SpeechLoadGrammar(grammar_name,path_to_grammar)
Generates the Asterisk SpeechUnloadGrammar() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$grammar_name |
string |
(required) | Grammar to unload. |
Output: SpeechUnloadGrammar(grammar_name)
Generates the Asterisk SpeechActivateGrammar() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$grammar_name |
string |
(required) | Grammar to activate. |
Output: SpeechActivateGrammar(grammar_name)
Generates the Asterisk SpeechDeactivateGrammar() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$grammar_name |
string |
(required) | Grammar to deactivate. |
Output: SpeechDeactivateGrammar(grammar_name)
Generates the Asterisk SpeechBackground() application (speech recognition with background audio).
| Parameter | Type | Default | Description |
|---|---|---|---|
$sound_file |
string |
(required) | Sound file to play. |
$timeout |
int|null |
null |
Recognition timeout. |
Output: SpeechBackground(sound_file[,timeout])
Generates the Asterisk SpeechProcessingSound() application (plays a sound while processing speech results).
| Parameter | Type | Default | Description |
|---|---|---|---|
$sound_file |
string |
(required) | Sound file to play during processing. |
Output: SpeechProcessingSound(sound_file)
Generates the Asterisk SpeechDestroy() application to destroy a speech engine instance.
Output: SpeechDestroy()
Sets the maximum number of DTMF digits before the speech engine stops recognition.
| Parameter | Type | Default | Description |
|---|---|---|---|
$digits |
int |
(required) | Maximum DTMF digits. |
Note: Call before
ext_speechbackground. Recognized DTMF is returned in${SPEECH_TEXT(0)}.
Output: Set(SPEECH_DTMF_MAXLEN=digits)
Sets the DTMF terminator character for speech recognition.
| Parameter | Type | Default | Description |
|---|---|---|---|
$terminator |
string |
(required) | Terminator character (default in Asterisk is #). |
Note: Call before
ext_speechbackground. By default#is the terminator; override this if you need to recognize#as input.
Output: Set(SPEECH_DTMF_TERMINATOR=terminator)
Generates the NVFaxDetect() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Detection parameters. |
Note: Pipe (
|) delimiters are automatically converted to commas (,).
Output: NVFaxDetect(data)
Generates the ReceiveFAX() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Filename and options. |
Output: ReceiveFAX(data)
Generates the rxfax() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Filename and options. |
Output: rxfax(data)
Generates the SendFAX() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Filename and options. |
Output: SendFAX(data)
Generates the Asterisk CallCompletionRequest() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Options. |
Output: CallCompletionRequest(data)
Generates the Asterisk CallCompletionCancel() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Options. |
Output: CallCompletionCancel(data)
Generates the Asterisk MessageSend() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$to |
string |
(required) | Destination URI. |
$from |
string|null |
null |
From URI. |
Output: MessageSend(to[,from])
Generates the Asterisk Authenticate() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$pass |
string |
(required) | Password or file path. |
$options |
string |
'' |
Options (e.g., a for absolute path, d for database, r for remove). |
Output: Authenticate(pass,options)
Generates the Asterisk PrivacyManager() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Options (max retries, min length, context). |
Output: PrivacyManager(data)
Generates the Asterisk LookupBlacklist() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Options. |
Output: LookupBlacklist(data)
Generates the Zapateller() application (SIT tone to deter telemarketers).
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Options. |
Output: Zapateller(data)
Generates the Asterisk Pickup() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Extension and context to pick up. |
Output: Pickup(data)
Generates the Asterisk DPickup() (Directed Pickup) application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Extension and context to pick up. |
Output: DPickup(data)
Generates the Asterisk ChanSpy() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$prefix |
string |
'' |
Channel name prefix to spy on. |
$options |
string |
'' |
Spy options (e.g., qw for quiet whisper). |
Output: ChanSpy(prefix[,options])
Generates the Asterisk ChanIsAvail() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$chan |
string |
(required) | Channel(s) to check. |
$options |
string |
'' |
Options. |
Output: ChanIsAvail(chan,options)
Generates the Asterisk Park() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Options: [timeout][,return_context[,return_exten[,return_priority[,options[,parking_lot_name]]]]] |
Output: Park(data)
Generates the Asterisk ParkedCall() application to retrieve a parked call.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Parking lot extension. |
Output: ParkedCall(data)
Generates the Asterisk ParkAndAnnounce() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Parameters: announce:announce1[:...],timeout,dial,return_context |
Output: ParkAndAnnounce(data)
Generates the Asterisk SendDTMF() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$digits |
string |
(required) | DTMF digits to send. |
Output: SendDTMF(digits)
Generates the Asterisk AMD() application.
Output: AMD()
Generates the Asterisk DISA() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Password and context (e.g., no-password,from-internal). |
Output: DISA(data)
Generates the Asterisk Page() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Channels and options. |
Output: Page(data)
Generates the MYSQL(Connect ...) dialplan command.
| Parameter | Type | Default | Description |
|---|---|---|---|
$connid |
string |
(required) | Variable for connection ID. |
$dbhost |
string |
(required) | Database hostname. |
$dbuser |
string |
(required) | Database username. |
$dbpass |
string |
(required) | Database password. |
$dbname |
string |
(required) | Database name. |
$charset |
string |
'' |
Character set (Asterisk ≥ 1.8). |
Output: MYSQL(Connect connid dbhost dbuser dbpass dbname [charset])
Generates the MYSQL(Query ...) dialplan command.
| Parameter | Type | Default | Description |
|---|---|---|---|
$resultid |
string |
(required) | Variable for result ID. |
$connid |
string |
(required) | Connection ID variable name. |
$query |
string |
(required) | SQL query (may contain Asterisk variables). |
Output: MYSQL(Query resultid ${connid} query)
Generates the MYSQL(Fetch ...) dialplan command.
| Parameter | Type | Default | Description |
|---|---|---|---|
$fetchid |
string |
(required) | Variable for fetch status. |
$resultid |
string |
(required) | Result ID variable name. |
$vars |
string |
(required) | Variables to populate with row data. |
Output: MYSQL(Fetch fetchid ${resultid} vars)
Generates the MYSQL(Clear ...) dialplan command.
| Parameter | Type | Default | Description |
|---|---|---|---|
$resultid |
string |
(required) | Result ID variable name to clear. |
Output: MYSQL(Clear ${resultid})
Generates the MYSQL(Disconnect ...) dialplan command.
| Parameter | Type | Default | Description |
|---|---|---|---|
$connid |
string |
(required) | Connection ID variable name. |
Output: MYSQL(Disconnect ${connid})
Generates the Asterisk Dictate() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Base directory for dictation files. |
Output: Dictate(data)
Generates the Asterisk Noop() application (no-op, useful for debugging/comments in dialplan).
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Message string. |
Output: Noop(data)
Conditional Noop() that only generates output when NOOPTRACE is enabled and meets the trace level threshold.
| Parameter | Type | Default | Description |
|---|---|---|---|
$string |
string |
(required) | Trace message. |
$level |
int |
3 |
Trace level (output only if NOOPTRACE ≥ level). |
Output: Noop([TRACE](level) string) — or false if tracing is disabled/below threshold.
Note: Returning
falsefromoutput()suppresses the dialplan line entirely.
Generates the Asterisk DumpChan application (dumps channel information to the console).
Output: DumpChan
Generates the Asterisk Log() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$level |
string |
(required) | Log level (ERROR, WARNING, NOTICE, DEBUG, VERBOSE). |
$msg |
string |
(required) | Log message. |
Output: Log(level,msg)
Generates the Asterisk Stasis() application for ARI (Asterisk REST Interface) integration.
| Parameter | Type | Default | Description |
|---|---|---|---|
$app_name |
string |
(required) | Stasis application name. |
$args |
string |
'' |
Arguments to pass to the application. |
Output: Stasis(app_name,args)
Generates the Asterisk System() application to execute system commands.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
System command to execute. |
Output: System(data)
Generates the Asterisk UserEvent() application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$eventname |
string |
(required) | Event name. |
$body |
string |
"" |
Event body/data. |
Output: UserEvent(eventname[,body])
Generates the VQA() (Voice Quality Analyzer) application.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
VQA parameters. |
Output: VQA(data)
Generates a barge-in application for Zap/DAHDI channels.
| Parameter | Type | Default | Description |
|---|---|---|---|
$data |
string |
'' |
Channel to barge into. |
Version behavior:
- Asterisk < 12.5: Outputs
DAHDIBarge(data)orZapBarge(data)depending on the channel driver.- Asterisk ≥ 12.5: Outputs
Noop(Using zapbarge or DAHDibarge has been removed)and logs a deprecation warning.
Output: DAHDIBarge(data) / ZapBarge(data) / Noop(Using zapbarge or DAHDibarge has been removed)