With this application you can play a sound file. You can also control it by using the keyboard of the phone. You can forward, rewind, stop and pause the message.
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.
In our example when somebody dials 222, the call will be answered by the Answer application. Then the caller will hear the sound file. In our example the file is demo-instruct. Then the call will be connected to the user user1 through the IAX2 channel.
Now, lets take a look at the arguments of the ControlPlayback application. The first option, separated from the filename by the "|" character, is with how many ms the sound file will go forward or rewind, when you press the corresponding key.
With the next argument you can set the key for the fast forwarding operation. By default this key is set to the "*"(asterisk key). In our case we have set it to 3. This argument is separated from the previous again with the "|" character.
With the third argument you can set the key for the rewind operation. By default this key is set to the "#"(pound key). In our case we have set it to 1. This argument is separated from the previous again with the "|" character.
With the fourth argument you can set the key for the stop operation. This argument is separated from the previous again with the "|" character.
With the last argument you can set the key for the pause operation. In our case this is 2. This argument is separated from the previous again with the "|" character.
About the sound files - the directory where the application will try to find the files by default is /var/lib/asterisk/sounds. It cannot be changed.
NOTE: Please, pay attention that the name of the sound file is written without the extension. For example: You have to write trading-desk, nottrading-desk.gsm
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
Vazquez Lance (rachaelrogers350 at yahoo dot com) 16 July 2020 14:07:31 As I was just concerning to stop, I came across your article. And oh young man did I fix my issue! The particular depth and understanding of the topic an individual have is so uncommon now! Only https://restoringallthings.org and you apparently know what an individual write about. We canīt stand useless content which will be definitely not that!
Parthena (z4cwwln9ee8 at yahoo dot com) 18 November 2016 02:44:37 Your posting really <a href="http://ovjhtt.com">sttghairened</a> me out. Thanks!
Storm (2rvz7hv7sd at hotmail dot com) 07 November 2016 07:49:17 I really apiptcraee free, succinct, reliable data like this.