You have an asterisk system that works and you want to play online radio station as Music on Hold; And when you have the radio stream as music on hold, you want to setup it to have a number that people can call in to listen to live radio talk shows, or anything like your playlist, live music, live church services, etc.
This article provides information to help you configure music on hold using mp3 live stream radio and set up a number that people can call to listen to live radio.
To set up live radio music on hold in asterisk using this article, you need to install mpg123 and edit the musiconhold.conf file
On Ubuntu, to install mpg123 application, type the command below and hit enter.
sudo apt install mpg123
Type the command below and press Enter to open the Music On Hold file.
sudo nano /etc/asterisk/musiconhold.conf
To have the live radio at http://sc2b-sjc.1.fm:7040 as music on hold, change the default class to look like below.
[default] mode=custom application=/usr/bin/mpg123 -q -s --mono -r 8000 -f 800 -b 0 -@ http://sc2b-sjc.1.fm:7040/
Disclaimer: The radio link is provided for convenience and educational purposes only. I found it on google, tested it and confirm that it works today September 15, 2020 but it is not an endorsement; And I cannot be responsible for any illegal use of the content of your Music On Hold.
To have the local playlist at /var/lib/asterisk/mp3/playlist.m3u as music on hold, change the default class to look like below.
[default] mode=custom application=/usr/bin/mpg123 -q -s --mono -r 8000 -f 800 -b 0 -@ /var/lib/asterisk/mp3/playlist.m3u
When you’re done, press Ctrl + X, type y, and then press Enter.
To listen to live radio via number 8080, you must edit the extensions.conf file. To do this, type the command below and press Enter to open the extensions file.
sudo nano /etc/asterisk/extensions.conf
add the information below in your context.
exten => 8080,1,Answer() same => n,MusicOnHold(default)
Mine looks like below:
[htop_internal] exten => 8080,1,Answer() same => n,MusicOnHold(default)
Whenever someone dials the number 8080, they listen to live radio.
What To Read Next
- How to install jitsi meet server on ubuntu
- Error 1020 access denied
- Error 1020 Access Denied with Split PIA VPN Tunnel
- How to configure DHCP server in pfsense
Don’t forget to subscribe to our newsletter to receive all updates and be eligible for our giveaway.