Hands-on Lab - Implementing Advanced Dial Plans and Features

Introduction

In this hands-on lab, you will implement advanced dial plans and features in Asterisk. By the end of this lab, you will be able to:

This practical exercise will provide you with the skills needed to develop sophisticated dial plans and leverage Asterisk's powerful features to meet various telecommunication needs.

Step-by-Step Instructions

1. Create Complex Dial Plans

Edit Extensions Configuration

Open the extensions configuration file:

sudo nano /etc/asterisk/extensions.conf

Add the following dial plan for advanced call routing:

[internal]
; Extension 1001
exten => 1001,1,NoOp()
same => n,Dial(SIP/1001,20)
same => n,Voicemail(1001@default,u)
same => n,Hangup()

; Extension 1002
exten => 1002,1,NoOp()
same => n,Dial(SIP/1002,20)
same => n,Voicemail(1002@default,u)
same => n,Hangup()

; Extension 1003
exten => 1003,1,NoOp()
same => n,Dial(SIP/1003,20)
same => n,Voicemail(1003@default,u)
same => n,Hangup()

; Extension 1004
exten => 1004,1,NoOp()
same => n,Dial(SIP/1004,20)
same => n,Voicemail(1004@default,u)
same => n,Hangup()

; Conference Room
exten => 2000,1,Answer()
same => n,MeetMe(2000)
same => n,Hangup()

; External Call
exten => _9.,1,NoOp()
same => n,Dial(SIP/${EXTEN:1}@provider)
same => n,Hangup()

Reload Asterisk Configuration

Access Asterisk CLI:

sudo asterisk -r

Reload the configurations:

dialplan reload
exit

2. Implement Call Queues

Edit Queues Configuration

Open the queues configuration file:

sudo nano /etc/asterisk/queues.conf

Add the following configuration:

[support]
musicclass=default
announce=queue-support
strategy=ringall
timeout=15
retry=5
maxlen=0
wrapuptime=0
announce-frequency=30
periodic-announce=queue-periodic
periodic-announce-frequency=60
member => SIP/1001
member => SIP/1002
member => SIP/1003
member => SIP/1004

Configure Dial Plan for Call Queue

Open the extensions configuration file:

sudo nano /etc/asterisk/extensions.conf

Add the following dial plan for the call queue:

[internal]
exten => 3000,1,Answer()
same => n,Queue(support)
same => n,Hangup()

Reload Asterisk Configuration

Access Asterisk CLI:

sudo asterisk -r

Reload the configurations:

dialplan reload
queue reload
exit

3. Implement IVR (Interactive Voice Response)

Edit Extensions Configuration

Open the extensions configuration file:

sudo nano /etc/asterisk/extensions.conf

Add the following IVR configuration:

[ivr]
exten => s,1,Answer()
same => n,Background(welcome)
same => n,WaitExten()

exten => 1,1,Goto(internal,1001,1)
exten => 2,1,Goto(internal,1002,1)
exten => 3,1,Goto(internal,1003,1)
exten => 4,1,Goto(internal,1004,1)
exten => 9,1,Goto(external,s,1)

exten => i,1,Playback(invalid)
same => n,Goto(ivr,s,1)

Reload Asterisk Configuration

Access Asterisk CLI:

sudo asterisk -r

Reload the configurations:

dialplan reload
exit

4. Test Advanced Dial Plans and Features

Test Call Queues

Dial `3000` from any SIP client and verify that the call is placed in the support queue.

Test IVR

Dial the main number configured for IVR and test the different options to ensure proper call routing.

Conclusion

By following these detailed hands-on labs, you will build a comprehensive understanding of Asterisk, starting from basic installation and configuration to advanced telecommunication solutions. Each lab builds upon the previous one, ensuring a smooth learning curve and avoiding redundancy.