• Idefisk
  • Tools
  • Tutorials
  • Reviews
  • VoIP Providers
  • Archives
ZOIPER softphone
Back to Tutorials

6.1.2.33. HasNewVoicemail (dialplan application)

1. HasNewVoicemail - this application allows you to go to your mailbox if you have a new message there.

NOTE: This application is valid for Asterisk version 1.0.9 and above.

 


Syntax:

HasNewVoicemail(vmbox[@vm-context][|variable])

 


List with the possible options

@vmcontext - an optional argument. It shows the context in voicemail.conf in which the voice mailbox is created.
variable - an optional argument. It can be a number. With this number you specify the number of the new letters in the INBOX folder, at which the execution to jump at extension n+101(n is the priority of the current extension).

 


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.

 


Prerequisites

To use this application you need a working Asterisk PBX with registered users in iax.conf, sip.conf or mgcp.conf(It depends on which protocol you would like to use) and made extensions. Also you have to create a mailbox in the voicemail.conf file

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.

iaxoneuser.jpg

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.

voicemailc1.jpg

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 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.


extensions.conf Configurations

exthasvoice1.jpg

On the picture above you can see our 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 HasNewVoicemail application. As arguments in its brackets we have written the following: 1515@testmail|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. 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 HasVoicemail application is that this application does not have the parameter folder. So you cannot change the folder, where you want, the application to check for new messages. The folder by default is INBOX and you cannot change this. With the HasVoicemail application, the checked folder could be changed. So, for example you can set the Work folder instead of the INBOX one.

 


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

idevoice.jpg

clivoice3.jpg

clivoice4.jpg


 


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

 


4. Similar dial plan applications

Voicemail()
HasVoicemail()
VoiceMailMail()
MailboxExists()

 

 
User Comments
Darnell (darnellmiley at hotmail dot de)
25 November 2021 11:44:44
This website was... how do I say it? Relevant!! Finally I have found something which helped me. Many thanks! betflix
Saundra (saundra_abercrombie at web dot de)
25 November 2021 11:17:29
I have been surfing online more than 2 hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. In my view, if all webmasters and bloggers made good content as you did, the internet will be much more useful than ever before. betflik
Rebekah (rebekah dot basaldua at yahoo dot de)
15 November 2021 09:08:58
I simply could not leave your web site before suggesting that I actually enjoyed the standard information a person supply on your guests? Is gonna be back incessantly to check up on new posts ______
Deanna (deannapearse at gmail dot com)
05 November 2021 06:42:50
This article is genuinely a good one it helps new the web visitors, who are wishing in favor of blogging. betflix
Mellisa (mellisadresdner at gmail dot com)
03 November 2021 06:30:04
This article presents clear idea in support of the new visitors of blogging, that in fact how to do blogging and site-building. _____ betflik
May (mayguay at gawab dot com)
31 October 2021 16:10:14
I got this site from my buddy who told me on the topic of this site and now this time I am browsing this website and reading very informative articles at this place. betflix22.com
Gay (gay dot agnew at aol dot com)
30 October 2021 17:06:36
My family members every time say that I am wasting my time here at net, but I know I am getting experience everyday by reading thes nice articles. ______
Olen (olenfloyd at gmail dot com)
14 September 2021 14:29:52
When I initially commented I clicked the "Notify me when new comments are added" checkbox and now each time a comment is added I get several emails with the same comment. Is there any way you can remove people from that service? Thanks a lot! ______
Cortez (cortezramsden at gmail dot com)
03 September 2021 14:16:02
Thanks for sharing your thoughts on ASTERISK. Regards betflik
viagra fast shipping overnight (mzdrosauraiazgkwo at lobumisan dot gq)
22 July 2020 17:01:25
viagra fast shipping overnight http://viacheapusa.com/
 
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.
Image Verification:
 

Latest Headlines:

  • T.38 faxing with Zoiper 2.15 is now easier than ever
    section: voip software
  • Asterisk 1.4.21 Released
    section: Asterisk
  • Asterisk 1.4.20 Released
    section: Asterisk
  • Asterisk 1.4.20-rc2 Released
    section: Asterisk
  • Asterisk 1.4.20-rc1 Now Available
    section: Asterisk
  • News Archives (older news)

Latest Tutorials:

  • Sending Fax from Zoiper to Zoiper using T.38
    added 08/Dec/2008 18:16
  • VMAuthenticate (dialplan application)
    added 01/Mar/2008 15:57
  • Siptronic ST-530
    added 06/Nov/2007 17:57
  • Siemens C455 IP hardphone
    added 05/Nov/2007 10:24
  • Zoiper
    added 22/Oct/2007 17:53

Latest Comments:

  • https://donde-ver-ant-man-y-la-avispa-qu...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://donde-ver-scream-6-tyt.statuspag...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://donde-ver-guardianes-de-la-noche...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://donde-ver-demon-slayer-villa-de-...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://www.reddit.com/r/BenavidezvPlant...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
 
contact us at: support@asteriskguru.com - asterisKGuru.com © all rights reserved   |   *asterisk is registered trademark of © Digium™