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

6.1.2.40. MailboxExists (dialplan application)

1. MailboxExists - this application allows you to check whether certain mailbox exists or not.

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

 


Syntax:

MailboxExists(mailbox[@context])

 


Purpose and usage

The purpose and usage of this application is to check whether a certain mailbox exists or not. If the mailbox exists then the next executed extension will be the one with priority n+101, where n is the priority of the current extension. If such mailbox does not exist, he next executed extension will be the one with priority n+1.

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


extensions.conf Configurations

extmailexist.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 MailboxExists application.

This application can take two arguments. The first one is the number of the mailbox. The second one is the context, in the voicemail.conf file, at which this mailbox is created. The mailbox number is obligatory. The context parameter is optional. If you set only the mailbox number then this number will be search at all contexts in the voicemail.conf file. If you set add a context after the mailbox number, this number will be search only within this context.

In our example we have set as arguments in the brackets of the application the following: 1515@testmail. 1515 is the mailbox number. @testmail is the context in the voicemail.conf file, in which the mailbox is set.

In case that this number exists the next executed extension will be the one with priority 103. This extension contains the SentText application. Thanks to it the caller will receive a message. In our case this message has the following text: The mailbox 1515 exists. Then the line will be hung up thanks to the Hangup application.

If the mailbox number does not exist the next executed extension will be the one with priority 3. It also contains the SentText application. Thanks to it, the text message There is no such mailbox, will be displayed on the screen of the caller. Then the line will be hung up by the next extension by the help of the Hangup application.

 

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

1) Mailbox exists
climailexist.jpg

idemailexst.jpg

2) Mailbox does not exist
climailexist1.jpg

idemailexst1.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 dialplan applications

Voicemail()
HasNewVoicemail()
VoiceMailMail()
HasVoicemail()

 

 
User Comments
SiamXXXOnline (admin at siamxxxonline dot com)
08 September 2022 18:41:21
https://siamxxxonline.com
no doctor viagra without a doctor prescription (franklyn dot rhyne80 at viagra1 dot icu)
01 July 2020 22:24:47
no doctor viagra without a doctor prescription https://viatribuy.com/
Maxim (info at zelpribor dot ru)
18 February 2018 00:13:13
Вам не нужно будет объезжать десятки организаций, тратить свое драгоценное время и деньги, оплачивать командировки, услуги транспортной компании для поверки измерительных приборов!
 
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://git-ce.rwth-aachen.de/mbd/kiste_...
    tutorial: Basic Information
  • https://git-ce.rwth-aachen.de/mbd/kiste_...
    tutorial: Basic Information
  • https://www.thebeachlittlehampton.co.uk/...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://www.viessmann-community.com/t5/R...
    tutorial: Asterisk Installation
  • https://d2l.msu.edu/d2l/eP/presentations...
    tutorial: Asterisk Realtime configuration
 
contact us at: support@asteriskguru.com - asterisKGuru.com © all rights reserved   |   *asterisk is registered trademark of © Digium™