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.
As you can see we have two extensions. One with the Dial application and the other one with the Hangup application.
Now, when somebody dials 112, the call will be answered by the Asterisk PBX. We do not need a separate extension for this purpose, because the Dial application has a built-in Answer.
When the conversation is over the Hangup application will be executed and the Asterisk PBX will hang up the line. We recommend you to use this extension always in order to be sure that the line will be hung up after the end of the conversation.
IMPORTANT: If you are using a CVS version after March 2004, than you have to know that you can set a special variable called PRI_CAUSE. This variable uses special number codes. Each number corresponds to a standard message or sound.
When you set this variable it is used by the Hangup application and when the Asterisk hung up the line the correspond message or sound will be send to the caller.
NOTE:This option is available only when you use the Hangup application with ZAP channel.
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