How to set a complete voice mail system with an asterisk on Ubuntu

Voicemail is required to allow the caller to leave a message if the recipient does not answer. How to configure it with asterisk on Ubuntu? That’s what this article is about. We will explain step by step how to do it. Let’s go!

Norton Secure VPN 2023 for up to 5 Devices
19,99 $

Basic setup

Voice mail

You must first go to the …etc/asterisk directory. The configuration file is voicemail.conf.

Now we are going to make a copy to have a backup in case something goes wrong

We can now start creating our voicemail. To do this the command looks like this: mailbox_number => password, name, email. So we have:

  1. The voicemail number: this is the number of the voiceMail() command. This number will be used to register a user in the sip.conf or iax.conf file.
  2. Password: this is the password required for registering a user in sip.conf or iax.conf.
  3. name: is the name attached to the mailbox
  4. Email: this is the place of transfer of messaging notifications.

That’s about all the configurations we need for now. Exit the file by saving it with the wq command.

Checking the settings

Return to the console level then reload your voicemail.conf file.

Now let’s take a look inside! Enter the command: voicemail show users.

Well everything is perfect! the mailbox has been successfully created. Now for the next step, it’s about understanding how the messaging system works and where messages are created in your system.

Mail files

In order to locate the mail files, let’s go into the..asterisk/voicemail/ directory and display the detailed content using the ls -la command.

We can notice that a default folder was automatically created because we used the default configuration. It is in this default folder that our mail files will be located.

Now it’s good to know all this, but we are far from having finished our configurations 😎 . Now let’s talk about the dial plan.

Add voicemail to dial plan

For this step, let’s start by highlighting the applications that we will need. Let’s go ! Let’s switch to command mode in asterisk then enter the command: core show applications like mail

We have 3 main applications:

MailboxExists: it checks whether or not a mailbox exists in the dynamic environment!

VoiceMail: You need it to leave a voice message to your correspondent, i.e. the one who is calling you.

VoiceMailMain: This is the main voice mail application. It allows you to properly administer and manage your mailboxes.

Start by taking a closer look at the Voicemail app. specifically the configuration syntax. Enter the following command then press Enter:

Which gives us:

Now let’s access the configuration file: extensions.conf. The settings are already there, so we will just comment on them. To do this, let’s go back to main mode and enter the following tree structure: ../asteirsk/extensions.conf .

  1. A timeout to the dialing application of 5s, i.e. if a person tries to dial the user Mathias, this will be done for max 5 seconds. If no one answers the extension with the next priority level should be executed. The failover can also occur because of network issues preventing the creation of a communication channel with the application.
  2. In the previous case we are therefore automatically directed in “B” to voicemail 100, with a default context. That said, you can remove the default! Then hang up!

We can do similar implementations for the second user james!

Notice

As argument VoiceMail() takes 100 and 200 for users Mathias and James. We could have saved time by using the exten variable which contains them. Like this :

Now let’s go to the asterisk console and test everything:

  • In the console enter the command: dialplan reload
  • Then make the call, in my case Mathias call James
  • And finally you can just hang up by clicking on the red cross or by pressing #.

Let’s go into more detail and see what happens during the process after the 5s of no response:

  1. There is a call in “A” from voicemail 100
  2. Then in “B” we have directly the introductory message of the genre: “Welcome to the voicemail of Mr…”
  3. Then in “C” we have the beep which marks the start of the recording of voice messages in different formats!
  4. And finally the user ended the call by pressing #

Access to voicemail

Now we have a perfectly working voicemail, however we still cannot retrieve voicemail or even change voicemail options. To do this, let’s see the application in more detail.

VoiceMailMain(). Let’s try setting up James’s email. What will mainly interest us is the syntax and the available options. In the console, enter the command core show application VoiceMailMain.

Now let’s go back to main mode and go to the extensions.conf file. We are going to add a new extension and the hangup app.

Now let’s test: Let’s call James’s voicemail directly

  1. You must enter the password and then validate.
  2. The system makes us understand that we have 4 new messages.
  3. Finally, it lists the possibilities of access to the different options according to the 1234 numbers.

Here is your voicemail is now configured 🙂! But you can continue to explore the different options and app arguments.

See as well :

Partager

Post Récent

How to Fix the Windows 11 Update Error

The Windows 11 update error can occur for several reasons, such as corrupted files, connectivity issues, or conflicts with third-party…

il y'a 2 months

How to resolve the error “You don’t currently have permission to access this folder” in Windows 10 and 11

The "You don’t currently have permission to access this folder" error often appears when you try to access a folder…

il y'a 2 months

How to Fix the Flutter Error ‘This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered’

When developing Flutter applications, it's common to encounter errors related to SDK version compatibility. One of these common errors is…

il y'a 3 months

Windows cannot be installed on this disk: the hardware of this computer might not support booting from this disk

During the installation of Windows, you may encounter an error indicating that the selected disk is not compatible with the…

il y'a 4 months

Windows could not start the Windows Update service on the local computer

The error "Windows could not start the Windows Update service on the local computer" occurs when the operating system fails…

il y'a 4 months

The Missing Windows Update Service on Windows 10 or 11

The Windows Update Service is essential for keeping your system up to date with the latest security and performance improvements.…

il y'a 4 months