Hands-on Lab - Building a Custom Voicemail Application with Asterisk

Introduction

In this hands-on lab, you will build a custom voicemail application using Asterisk. By the end of this lab, you will be able to:

This practical exercise will provide you with the skills needed to create and manage customized voicemail solutions using Asterisk.

Step-by-Step Instructions

1. Configure Voicemail in Asterisk

Edit Voicemail Configuration File

Open the voicemail configuration file:

sudo nano /etc/asterisk/voicemail.conf

Add the following configuration:

[default]
1001 => 1234,User One,user1@yourdomain.com
1002 => 1234,User Two,user2@yourdomain.com

Save and Exit

Press Ctrl+O to save the file. Press Enter to confirm. Press Ctrl+X to exit the nano editor.

2. Configure Dial Plan for Voicemail

Edit Extensions Configuration

Open the extensions configuration file:

sudo nano /etc/asterisk/extensions.conf

Add the following dial plan for voicemail:

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

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

Reload Asterisk Configuration

Access Asterisk CLI:

sudo asterisk -r

Reload the configurations:

dialplan reload
voicemail reload
exit

3. Test Voicemail Setup

Leave a Voicemail

Dial 1002 from any SIP client and let it go to voicemail. Leave a voicemail message for extension 1002.

Retrieve Voicemail

Dial *97 from extension 1002. Enter the password 1234 when prompted. Listen to the voicemail message left for extension 1002.

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.