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.
We need two registered users 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 users anatoliy and 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.
So, in our example when somebody dials 222, the call will be answered by the Answer application. The next executed extension will be the one which contains the GoTo application. Thanks to this application the call will be redirected to the extension s with priority 1. In this extension is included the Background application. So, the caller will hear the sound file played by this application. In our example the caller will hear the file demo-instruct. The message in the sound file could be something like this: Thank you for using our services. If you would like to be connected to an operator please press 1, press 2 for....etc, or some kind of a welcome message.
While the message runs, the user is allowed to enter an extension. The caller does not have to wait until the end of the message. If our caller press one, the call will be connected to the extension with the Dial application. Thanks to it the call will be connected to the user user1 through the IAX2 channel.
The supported format for the sound file is .gsm.
What will happen if the user does not press any key while the message runs? If the user does not press any key and the message finishes, then the next executed extension will be the special t extension(timeout extension). If such one does not exist then the line will be hung up.
If the caller enters an invalid or non-existing extension then the next executed extension will be the special extension i (invalid extension). If such one does not exist - the line will be hung up.
More about the invalid and timeout extensions you can read in our tutorial about the extensions.conf file.
The Background application is almost equal to the Playback application. The major difference between the them is that when you are using the Background application, the caller will be allowed to type an extension while the sound file still run. When you are using the Playback application, the caller will has to wait until the sound file finish and then he/she will has the right to type an extension.
We recommend you always to make an extension for hanging up in order to be sure that the Asterisk PBX will close the line after the conversation is over.
2. Screenshots of what you can see 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