@vmcontext - an optional argument. It shows the context in voicemail.conf in which the voice mailbox is created. folder - an optional argument. It is separated from the previous one by the ":" character. variable - an optional argument. It can be a number. With this number you specify the number of the new letters in the folder at which the execution to jump at extension n+101(n is the priority of the current extension). This option is separated from the previous one by the "|" character.
Purpose and usage
The purpose and usage of this application is to check whether you have a new voice messages in your mailbox or not. If you have new messages the next executed extension will be the one with priority n+101, where n is the priority of the current extension.
Below, we will show you how you can use this application.
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 one registered user 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 user user1
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.
voicemail.conf Configurations
We have to create a mailbox in one context in the voicemail.conf file. Below we will show you a screenshot from our voicemail.conf file.
The way of creating an 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 numbers. They are 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, in the context [testmail] we will create a mailbox for the user Anatoliy Kun with mailbox number 1515 and password 1111.
We are ready with our voicemail box. Now, lets take a look at the extensions.conf file.
In our example when somebody dials 5456, the call will be answered by the Answer application. The next executed extension will be the one which contains the Authenticate application. We have to use it, because of security measurements. The password in our case is 1111.
The next extension is the one with the HasVoicemail application. As arguments in its brackets we have written the following: 1515@testmail:INBOX|1. 1515 is the mailbox which we would like to check for new messages. @testmail is the context in the voicemail.conf file, where the mailbox number is set. INBOX is the folder where the application will looking for new messages. The digit 1 is the number of new messages, in the folder INBOX, at which the next executed extension has to be n+101(n is the priority of the current extension). The application will cause jumping to the extension with priority n+101 only if there is at least one new message. If there are no new messages the execution will continue with the next extension by priority.
So in our case if there are no new messages in the folder INBOX, the next executed extension will be the one with the SendText application. This application will send a message, to the caller, with the following text: There are no new voicemails in your box. Then the line will be hung up thanks to the Hangup application.
If there is at least one message in the folder INBOX, then the next executed extension will be the one with priority n+101. In our case this extension contains the VoiceMailMain application. It has a s option set, so no password will be required and the user will hear directly the instructions from the voicemail system.
In order to be sure that the Asterisk PBX will hang up the line, after the conversation is over, it is a good idea to make an extension for hanging up the line.
The difference between this application and the HasNewVoicemail application is that this application has the parameter folder. So you can change the folder, where you want the application to check for new messages. For example you can set the Work folder instead of the INBOX one. With the HasNewVoicemail application, the checked folder, by default, is the INBOX one and you cannot change this.
2. Screenshots of what you can see on your Idefisk and on the CLI of the Asterisk PBX
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