• News
  • Idefisk
  • Tools
  • Tutorials
  • Forum
  • Reviews
  • VoIP Providers
  • Archives
  • Gallery
ZOIPER SIP softphone
Back to Tutorials

6.1.2.104. WaitExten (dialplan application)

1. WaitExten - this application gives you an extra time for entering an extension.

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

 


Syntax:

WaitExten([seconds][|options])

 


List with the possible options

m[(x)] - this option allows you to play music on hold to the caller while waiting for an extension. The x in the parenthesis is to allow you to specify a music on hold class. This is an optional argument.

 


Purpose and usage

The purpose of this application is to give you the possibility to dial a new extension. In other words, you dial one extension and thanks to the WaitExten application, you can go to another one. You can limit the time, which the caller has, to enter the new extension. Also, you can play music on hold while waiting for the new extension.

This application could be used for something like a menu. For example, you can have one number for the incoming calls. You can give this number to all your customers. Then, when they dial this number, they could receive information about the internal numbers of your departments or the numbers of your services. Then with the WaitExten application you will give them the chance to dial some of this numbers.

Below, we will give you an example.

 


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.

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

iaxoperatoruser.jpg

So, we have registered the user operator

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.


extensions.conf Configurations

Now lets take a look at the extensions.conf file.

extwaitexten.jpg

On the picture above you can see our extensions.conf file.

When somebody dials 1111, the call will be answered by the Answer application. The next executed extension will be the one which contains the Playback application. Thanks to it, the caller will hear a welcome message. The message could inform the user about the possible options. For example, it could be something like this: Thank you for using our services! If you would like to contact with the operator please dial 1112, if you would like to check a voicemail please dial 1113. The message has to be put in the directory /var/lib/asterisk/sounds. This is the directory by default. You can change it in the asterisk.conf file.

You can omit the Playback application and you can put the sound file in the music on hold directory. By default it is /var/lib/asterisk/mohmp3. You can change it in the asterisk.conf file. The file format has to be .mp3.

When the sound message finishes, the next executed extension will be the one with the WaitExten application. As arguments in its brackets we have set the following: 15|m.
15 - the user has maximum 15 seconds to enter an extension.
m - this means, that a music on hold will be played while waiting for the extension.

As you can see the WaitExten application gives you the possibility to play music on hold. So, you can omit the Playback application and you can put the sound message in the music on hold directory. By default it is /var/lib/asterisk/mohmp3. You can change it in the asterisk.conf file. The file format has to be .mp3.

If the caller dials 1112, the call will be connected to this extension. In our case this will cause the dialing of the user operator through the IAX2 channel. This will be realized by the Dial application.
Thanks to the Hangup application, the line will be hang up, when the conversation is over.

If the caller dials 1113, the call be handled by the VoiceMailMain application. It will bring to the user, the possibility to enter in the Asterisk`s voicemail system. There, the caller could check its mailbox.

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

 


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

cli1112waitexten.jpg

cli1113waitexten.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. Uploaded files

extensions.conf
iax.conf

 


5. Similar dial plan applications

Wait
WaitForRing
WaitForSilence
WaitMusicOnHold

 

 
User Comments
manouchk (manouchk at gmail dot com)
07 January 2008 13:32:45
a bit late, hope you solved your problem!

exten => s,2,DigitTimeout,1 ; Initially a 1 second pause during dialing will be treated as 'finished dialing'

cf
http://www.voip-info.org/wiki-Asterisk+cmd+WaitExten
gina (gparadise at yahoo dot com)
21 March 2007 07:18:48
interesting
Jon (jonsol at gmail dot com)
13 March 2007 18:30:06
How can you break the wait time, I mean, if I put 5 secs to put a value and I already defined that this value must end with '#', so if I put 12#, how can I go next with the dialplan without have to wait the rest of the remaining time? Because the regular expression was already matched it
 
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:

  • 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
  • Grandstream GXP-2020
    added 15/Oct/2007 18:17

Latest Comments:

  • i agry ur sip dialar ...
    tutorial: Idefisk - IAX2 softphone
  • It happened that a Dog <a href="http://w...
    section: voip hardware
  • It happened that a Dog <a href="http://w...
    section: voip hardware
  • thinks i installation <A href=\"http:...
    tutorial: Installation on CentOS
  • uh, why not just use the asterisk packag...
    tutorial: Installation on Debian
 
contact us at: support@asteriskguru.com - asterisKGuru.com © all rights reserved   |   *asterisk is registered trademark of © Digium™