HowTo: Stream Music on Hold in FreePBX

Chris Sherwood 2 min read

The Music on Hold that comes with FreePBX isn’t spectacular.  If you would like to instead stream music on hold in FreePBX, this is very simple and easy to set up!

Find your Streaming Source

First, go to a website such as Shoutcast.com and find a stream that you like.  In Shoutcast, you need to click the ‘download’ link to download a .PLS file that contains the streaming audio URL.

Shoutcast station list with the download icon circled next to a Light Rock stream

Save that file to your computer and then open it in a text editor.  Copy the streaming URL out of the .PLS file and copy it to your clipboard.

.PLS playlist file in a text editor with the File1 stream URL highlighted

Add Streaming Source to FreePBX

Next, open the FreePBX admin interface and choose Settings > Music on Hold.  In the upper right-hand menu, choose ‘Add streaming category.’

FreePBX Music on Hold menu with Add Streaming Category highlighted

Enter anything you want in the description box.  For ‘Application,’ you will want to use the following string (and paste your streaming URL to the end):

/usr/bin/mpg123 -q -r 8000 -f 8192 --mono -s [streaming URL]

For instance, if your streaming URL is http://1.2.3.4:8080, your string would look like this:

/usr/bin/mpg123 -q -r 8000 -f 8192 --mono -s http://1.2.3.4:8080

Click ‘Submit Changes’ followed by ‘Apply Config’ to continue.

FreePBX Add Streaming Category with the mpg123 application string and stream URL

*** Note that this Application string requires the mpg123 application to be installed in Linux.  FreePBX distros have this installed by default, but if you have built Asterisk or FreePBX from source, it may not be installed.

Use Your New Streaming Hold Music!

Finally, you can set your new streaming hold music source anywhere you can set hold music, such as an Inbound Route or Queue.  To add it to an Inbound Route, select Connectivity > Inbound Routes and pick your desired Inbound Route.  For Music on Hold, drop down the box and choose your new streaming source.

FreePBX inbound route options with Music On Hold set to streaming-hold

Click ‘Submit’ followed by ‘Apply Config’ and you can now stream music on hold to the callers that come in on your Inbound Route!

How we can help

FreePBX Support

Get help with the FreePBX system you already have, billed by the hour.

How we can help

Phone Systems

Find the right business phone system: hosted, on-premises or cloud, with phones that ship ready to use.

How we can help

Kari's Law (E911)

Make sure your phone system meets the Kari's Law and RAY BAUM'S Act E911 rules.

Chris Sherwood

Chris Sherwood

Founder, Crosstalk Solutions

Chris founded Crosstalk Solutions in 2015. Before that, he worked as an IT administrator, a sales engineer and a director at a VoIP company. He has taught networking and VoIP on the Crosstalk Solutions YouTube channel for more than a decade.