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