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 three 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, user1 and user2.
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 112 the first executed application will be Answer. Then the caller will hear a playtone for a congestion condition. We will achieve this with two extensions. The first one contains the Playtones application and the second one the Congestion application. It is very important to use these two applications together. If you use only one of them the result wonít be the desired one. For example if you use only Playtones you wonít here a signal. Again if you use only Congestion u wonít hear a signal.
NOTE: Please, pay attention that we are talking about the IAX2 channel. If you are going to use the SIP channel you donít need to use the Playtones application. The Congestion application is enough to hear the congestion signal. So, this depends on the used channel.
In the brackets of the Playtones application we have written congestion. This is a standard playtone. You can change its parameters in the indications.conf file. However we recommend you to leave the settings by default.
We advise you to set a delay as argument in the brackets of the Congestion application. If you leave the brackets empty the congestion signal will continue endlessly or until the caller hang up the phone. In our case we have set 10 seconds. When this time expires, the next extension will be executed, if such one exists.
NOTE: When you are going to use the Playtones application, you always have to use the Answer application before that. Otherwise you wonít be able to hang up the line from your softphone and you will be constrained to restart it.
You cannot use Playback or Background application for indicating congestion condition because they do not support arbitrary tones.
Donít forget that it is always a good idea to make an extension for hanging up. In this way you will be sure that after the conversation is over the Asterisk PBX will close the line.
Finally, you can make an extension which to send a text message to the caller. The message in our case is We cannot handle your call at the moment! Please try again later.
It is very important to remember that the extension for the message should be before the extension with the Congestion application. Otherwise, if you set it after the Congestion application, the message wonít appear. The reason is that the Congestion application will hang up the line immediately after the time in the brackets expire.
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.
For more information about indications.conf you can check here.
For more information about the SendText application you can check here.
For more information about the Busy application you can check here.
For more information about the Playtones application 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