* You are viewing the archive for the ‘Dialplan Basics’ Category

Asterisk ExecIf

Execif Executes a dialplan application if some condition is met. e.g.

If expr is true, execute and return the result of appiftrue(args).

If expr is true, but appiftrue is not found, then the application will return a non-zero value.

Syntax

ExecIf(expression?appiftrue[:...][:appiffalse[:...]])

Arguments

  • expression
  • execapp
    • appiftrue
    • appiffalse

 

User provided example:

;;; DTMF Testing software to test IVR system
;;;
exten => 1234,1,Answer()
same => n,Read(value,pleasePress1forSupportPress2forHelp,1,,10)
same => n,NoOp(${value})
same => n,ExecIf($[${value}=1]?Goto(suppot,1))
same => n,ExecIf($[${value}=2]?Goto(help,1))
same => n,Hangup()

exten=> support,1,Answer()
same => n,NoOp(you are at support section)
same => n,Hangup()

exten=> help,1,Answer()
same => n,NoOp(you are at help section)
same => n,Hangup()

Asterisk Dialstatus

The DIALSTATUS channel variable is created when you attempt to connect to another device or endpoint and bridge the call with the Dial Application. It contains the status of the call reflected in one of the following values:

  • CHANUNAVAIL
  • CONGESTION
  • NOANSWER
  • BUSY
  • ANSWER
  • CANCEL
  • DONTCALL – For the Privacy and Screening Modes. Will be set if the called party chooses to send the calling party to the ‘Go Away’ script.
  • TORTURE – For the Privacy and Screening Modes. Will be set if the called party chooses to send the calling party to the ‘torture’ script.
  • INVALIDARGS

 

Asterisk Transfer

Synopsis

Transfer caller to remote extension.

Description

Requests the remote caller be transferred to a given destination. If TECH (SIP, IAX2, LOCAL etc) is used, only an incoming call with the same channel technology will be transfered. Note that for SIP, if you transfer before call is setup, a 302 redirect SIP message will be returned to the caller.

The result of the application will be reported in the The result of the application will be reported in the None – TRANSFERSTATUS channel variable:

  • TRANSFERSTATUS –
    • SUCCESS – Transfer succeeded.
    • FAILURE – Transfer failed.
    • UNSUPPORTED – Transfer unsupported by channel driver.

Syntax

Transfer([Tech]destination)
Arguments
  • dest
    • Tech
    • destination