Table of Contents

extensions.conf

Kontexty

Extensions

Priority

Číslované priority:

exten => 123,1,Answer()
exten => 123,2,do something
exten => 123,3,do something else
exten => 123,4,do one last thing
exten => 123,5,Hangup()

Nečíslované priority:

exten => 123,1,Answer()
exten => 123,n,do something
exten => 123,n,do something else
exten => 123,n,do one last thing
exten => 123,n,Hangup()

'same =>' operator

exten => 123,1,Answer()
   same => n,do something
   same => n,do something else
   same => n,do one last thing
   same => n,Hangup()

Priority labels

exten => 123,n(label),application()

Applications

Progress()

Answer()

Hangup()

Playback()

Background(), WaitExten()

[TestMenu]
exten => start,1,Answer()
   same => n,Background(main-menu)   ;přehraje soubor main-menu, přičemž očekává volbu
   same => n,WaitExten(5)            ;čeká na volbu dalších 5s  

SayDigits()

Goto()

[TestMenu]
exten => start,1,Answer()
   same => n,Background(main-menu)
   same => n,WaitExten(5)

exten => 1,1,Playback(digits/1)
   same => n,Goto(TestMenu,start,1)

exten => 2,1,Playback(digits/2)
   same => n,Goto(TestMenu,start,1)

Dial()

Destination
;vyzvoneni jednoho kanalu
exten => 104,1,Dial(SIP/0004F2001122)

; vyzvoneni nekolika kanalu soucasne (spojka &)
exten => 105,1,Dial(DAHDI/1&SIP/0004F2001122&IAX2/Softphone)

; vyzvoneni extenze na vzdalenem systemu
exten => 500,1,Dial(IAX2/guest@misery.digium.com/s)
Timeout
exten => 201,1,Dial(DAHDI/1,10)          ;zkousi zvonit 10s
   same => n,Playback(vm-nobodyavail)
   same => n,Hangup()
Option
exten => 201,1,Dial(DAHDI/1,10,m)
   same => n,Playback(vm-nobodyavail)
   same => n,Hangup()
URI

Invalid Entries and Timeouts

[TestMenu]
exten => start,1,Answer()
   same => n,Background(main-menu)
   same => n,WaitExten(5)

exten => 1,1,Playback(digits/1)
   same => n,Goto(TestMenu,start,1)

exten => 2,1,Playback(digits/2)
   same => n,Goto(TestMenu,start,1)

exten => i,1,Playback(pbx-invalid)
   same => n,Goto(TestMenu,start,1)

exten => t,1,Playback(vm-goodbye)
   same => n,Hangup(

Proměnné

Global variables

[globals]
LEIF=SIP/0000FFFF0001
JIM=SIP/0000FFFF0002
RUSSELL=SIP/0000FFFF0003

[LocalSets]
exten => 100,1,Dial(${LEIF})
exten => leif,1,Dial(${LEIF})

exten => 101,1,Dial(${JIM})
exten => jim,1,Dial(${JIM})

exten => 102,1,Dial(${RUSSELL})
exten => russell,1,Dial(${RUSSELL

Channel variables

exten => 202,1,Set(MagicNumber=42)
   same => n,SayNumber(${MagicNumber})

Environment variables

Pattern Matching

Proměnná ${EXTEN}

exten => _XXX,1,Answer()
   same => n,SayDigits(${EXTEN})

Úpravy proměnné:

Includes

[interni]
...

[externi]
...

[mezinarodni]
...

[tisnova_volani]
...

[zamestnanci]
include => interni
include => externi
include => tisnova_volani

[manageri]
include => interni
include => externi
include => mezinarodni
include => tisnova_volani

Aplikace změn

*CLI> dialplan reload

nebo:

$ sudo /usr/sbin/asterisk -rx “dialplan reload”