Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Building Telephony Systems With Asterisk (2005).pdf
Скачиваний:
45
Добавлен:
17.08.2013
Размер:
1.82 Mб
Скачать

Chapter 8

extensions.conf

[general]

static=yes

writeprotect=no

[globals]

TRUNK=Zap/g1

TRUNKMSD=1

[outgoing]

exten => _9.,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}}) ;if we dial 9, ; send to trunk

include => default

[default]

exten => s,1,Dial(Zap/g2,30)

exten => s,2,Voicemail(u1) exten => s,3,Hangup

exten => s,102,Voicemail(b1) exten => s,103,Hangup

exten => 0,1,Dial(Zap/g2) exten => 1,1,Dial(Zap/1) exten => 2,1,Dial(Zap/2) exten => 3,1,Dial(Zap/3)

exten => 8,1,VoicemailMain(s1)

exten => i,1,Goto(s,1) exten => t,1,Goto(s,1)

;dial all extensions for 30

;seconds

;send to VM if we don't pick up

;send to VM if we are busy

;if we dial 0, ring all phones

;if we dial 1, ring the office

;if we dial 2, ring the bedroom

;if we dial 3, ring the kitchen

;press 8 to check messages

;without requiring password

;if we are in an invalid or timed-out

;state, go to s,1 in this context

This is our entire dialplan. We can see that it is very simple: each phone has an extension, and there is an extension for all phones. Only incoming calls are going to go to voicemail if a phone is busy or not answered.

We will notice that any number that is dialed with 9 as the first digit will automatically be sent out the trunk. This is a very simple example of how a single pattern can accomplish many tasks. Since we are not very concerned about securing the trunk from internal extensions, it is alright to use this simple method of trunk access.

Conclusions

As we can see, Asterisk configurations can be very simple. Creating a PBX for a few extensions is easy. Moreover, it illustrates some points that we will also see later in configuring some other PBX systems.

119