s - without this option a message will be played. The message by default is: "Please leave your message after the tone. When done, hang up, or press the pound key." If you set this option, the message won&#8217;t be played.u - If you set this option, an unavailable message will be played. The message by default is: "The person at extension <dialled extension> is unavailable". Also you will hear and the instructions: "Please leave your message after the tone. When done, hang up, or press the pound key."b - If you set this option, a busy message will be played. The message by default is: "The person at extension <dialled extension> is on the phone." Also you will hear and the instructions: "Please leave your message after the tone. When done, hang up, or press the pound key."su - You will hear the unavailable message: "The person at extension <dialled extension> is unavailable". The instruction message will be skipped.sb - You will hear the busy message: "The person at extension <dialled extension> is on the phone". The instruction message will be skipped.

Purpose and usage

As you can conclude from the name of the application, it is used for a voice messages.

You can use the Voicemail application for making and leaving voice messages. The messages are stored in a special folder with the name of the context created in voicemail.conf and the name(or number) of the called user. In this folder, a subdirectory with the name INBOX will be created. The location of the special folder by default is in the /var/spool/asterisk/voicemail directory.Example:

/var/spool/asterisk/voicemail/voicemail-context/username/INBOX

Let&#8217;s say that somebody tries to call you, but you are not available at the moment or perhaps you have already a call and you are busy. This is the ideal situation to use the voiceMail application.

Below we will show you in details how to configure your system to do this.

To see how the application works we recommend to use our IAX softphone Idefisk. You can download it from here. Please also read our tutorial to learn how to configure it to work with Asterisk PBX.

Asterisk PBX configurations

NOTE: This is only an example of what for you can use this application. Of course you can use it and for other things.

iax.conf Configurations

We need three registered users in iax.conf file. This is because we are going to use the IAX2 protocol. If you want to use other protocol such as SIP or MGCP, you have to do the configurations below respectively in sip.conf or mgcp.conf.

So, we have registered the users user1, anatoliy and ivan.

Type=friend means that this user can make and receive calls. Host=dynamic means that the IP is not static but dynamic through a DHCP server. Allow=all means that the line which this user will use, could support all audio codecs. Context=test - this shows that this user is working with the extensions in this context of the configuration file extensions.conf.

We will create a context named [testmail]. In this context we will define three mailboxes. The way of creating a mailbox is the following:

First you write the mailbox number. It is not necessary to be a number it could be also a name. In our case it would be a name. It is followed by the => character. After this character, the first argument is the desired password for the mailbox. The password is followed by the name and family name of the user and then his/her e-mail address. You can add and some other options, but we do not need them now. You can learn more about this options in our voicemail.conf tutorial.

In our example we will create three mailboxes. One for the user anatoliy, one for the user user1 and one for the user ivan. This mailboxes will be in the context [testmail]

We are ready with our voicemail boxes. Now, lets take a look at the extensions.conf file.

In our example when somebody dials 5454, the call will be answered by the Answer application. The next executed extension will be the one which contains the Dial application. It will try to connect the user anatoliy through the IAX2 channel.

We will use the GoToIf application to determine the dial status of the call. For the purpose we need also the variable ${DIALSTATUS}. The first extension after the one with Dial application, will check whether the called person is available.

If the person is unavailable, then the execution will continue with the extension with priority 7. This extension contains the VoiceMail application. In its brackets we have set the following: uanatoliy@testmail. The first letter - u means that a message for an unavailable condition has to be played. The message by default is: The person at extension is unavailable". The word anatoliy is for the mailbox which we have set in the voicemail.conf. The last part is @testmail. This shows the context in voicemail.conf, in which the mailbox anatoliy is configured.

So, the caller will hear a message and he/she will be allowed to record a message and to store it in the mailbox of anatoliy. The message will be stored in the directory /var/spool/asterisk/voicemail/testmail/anatoliy/INBOX. In order to send the message in the mailbox, the caller has to hang up the line or to press the pound key(#), when he/she finishes with the recording of the message.

If the GoToIf check show that the user is available, then the next application with priority 4 will be executed. This one will check, whether the line is busy or not.

If the line is busy, then the execution will continue with the extension with priority 9. This extension contains again the VoiceMail application. In its brackets we have set the following: banatoliy@testmail. The first letter - b means that a message for busy condition has to be played. The message by default is: The person at extension is on the phone. The word anatoliy is for the mailbox which we have set in the voicemail.conf. The last part is @testmail. This shows the context in voicemail.conf, in which the mailbox anatoliy is configured.

The caller will hear the message, that the called person is busy and he/she will be allowed to record a message and to store it in the mailbox of anatoliy. The message will be stored in the directory /var/spool/asterisk/voicemail/testmail/anatoliy/INBOX. In order to send the message in the mailbox, the caller has to hang up the line or to press the pound key(#), when he/she finishes with the recording of the message.

Now, if the user is available and the line is free and the called person does not answer within 5 seconds, the next executed extension will be the one with priority 5. This one contains another copy of the VoiceMail application.

As arguments in its brackets we have set the following: anatoliy@testmail. There is no first letter which means that a message with instructions has to be played. The message by default is: Please leave your message after the tone. When done, hang up, or press the pound key. The word anatoliy is for the mailbox which we have set in the voicemail.conf. The last part is @testmail. This shows the context in voicemail.conf, in which the mailbox anatoliy is configured.

Again the user will be allowed to record a message after the signal. The message will be stored in the directory /var/spool/asterisk/voicemail/testmail/anatoliy/INBOX. In order to send the message in the mailbox, the caller has to hang up the line or to press the pound key(#), when he/she finishes with the recording of the message.

NOTE: Please, pay attention that between the option flags and the voicemail number there is no separator. That is why the voicemails cannot start with "s", "u", "b" or any combination of these three letters.

Maybe you have noticed that between the extensions with priority 5, 7 and 9, we have extensions with the GoTo application. It cause the jumping to the last extension with priority 10 which has the Hangup application. Thanks to it the line will be hung up. This is necessary, because otherwise the three VoiceMail application will be executed subsequently. In this way the effect from the GoToIf applications will be lost.

2. Screenshots of what you can see on the CLI of the Asterisk PBX

1) Screenshot for available user, which do not answer

2) Screenshots for unavailable user

3. Additional information

For more information about extensions.conf you can check here.
For more information about iax.conf you can check here.

This application is tested with our IAX softphone Idefisk. You can download it from here. For more information about this softphone please read our tutorial.

If you would like to test this application with the SIP channel you can read our tutorials about the SIP Softphones to learn how to configure them to work with Asterisk PBX

Winstonbloon (onlinecasinos-x dot com at gmail dot com)23 February 2017 11:33:06thanks due to the fact that this significant edifying website, living up the momentous position check out this <a href=http://onlinecasinos-x.com>online casinos</a> offers , buy <a href=http://www.sextoysfun.net>sex toys</a>

AdqDTP (pdominguez at adquem dot com)11 June 2009 22:46:51Hi, i want to add a message for 2 options in the voicemail config, 1 for goto the wellcome menu and other for call the operator, how can i do it?

Thanks in advance

Lacho (support at asteriskguru dot com)12 October 2005 12:51:17Yes, 7NSA. Unfortunately the voicemails cannot start with "s", "u", "b" or any combination of these three letters.

7NSA (asteriskguru dot com at knoppix dot ca)11 October 2005 07:11:47Since there is no seperator in between flags and boxnumber@context, names should not start with 's', 'u', or 'b' ???

Any comments on this?

Add Comment

Name:

Email:

Comment:

In order to prevent automatic posting on our website, we kindly request you to type in the number you see in the picture below.