
Funny... I was doing pretty much the same thing! But I took a little twist.

After you have all the proper files installed to play, I ran yum -y update and it installed an even newer version of mpg123 1.6.1 along with a few other files. So my part assumes you have the proper files installed to have mpg123 working as above.

Oh yeah, one more thing... my code uses FLITE for text to speech. So search for the install instructions on this site before you proceed.
I wanted to be able to select a variety of music instead of just the same channel.

Note the channels I grabbed are just random and not low bitrates, so you may wish to change them.
Here's my
etc/asterisk/musiconhold.com
[80s]
mode=custom
application=/usr/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0
http://scfire-mtc-aa04.stream.aol.com:80/stream/1040
[Hitz]
mode=custom
application=/usr/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0
http://scfire-dtc-aa02.stream.aol.com:80/stream/1074
[Jazz]
mode=custom
application=/usr/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0
http://scfire-ntc-aa10.stream.aol.com:80/stream/1074
[KickinCountry]
mode=custom
application=/usr/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0
http://scfire-ntc-aa09.stream.aol.com:80/stream/1075
[MaxHits]
mode=custom
application=/usr/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0
http://91.121.201.60:80
[SwissGroove]
mode=custom
application=/usr/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0
http://82.197.167.134:80
[TheEagle-ClassicRock]
mode=custom
application=/usr/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0
http://64.72.118.64:8030
[Top40-Christmas]
mode=custom
application=/usr/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0
http://64.62.194.49:2792
[default]
mode=files
directory=/var/lib/asterisk/mohmp3/
random=yes
[none]
mode=files
directory=/dev/null
Then I modified my
/etc/asterisk/extensions_custom.conf
In the [from-internal-custom] section I added:
exten => 68742,1,Answer
exten => 68742,2,Flite("After the beep press the number of the music channel you wish to listen to. Or 9 for a list of channels.")
exten => 68742,3,Read(MusicCode,beep,1)
exten => 68742,4,GoTo(QueueMusic,s,${MusicCode})
exten => 68742,5,Hangup
Then I scrolled to the bottom of the file and added a new section
[QueueMusic]
exten => s,1,MusicOnHold(80s)
exten => s,2,MusicOnHold(Jazz)
exten => s,3,MusicOnHold(KickinCountry)
exten => s,4,MusicOnHold(Hitz)
exten => s,5,MusicOnHold(MaxHits)
exten => s,6,MusicOnHold(SwissGroove)
exten => s,7,MusicOnHold(TheEagle-ClassicRock)
exten => s,8,MusicOnHold(Top40-Christmas)
exten => s,9,Flite("Press 1 for eighties. 2 for Jazz. 3 for Kickin Country. 4 for Hitz. 5 for Max Hitz. 6 for Swiss Groove. 7 for The Eagle Clasic Rock. 8 for Top 40 Christmas. 9 to hear this list again.")
exten => s,10,goto(from-internal-custom,68742,2)
exten => s,11,Hangup
Then I saved all my files and did an "amportal restart" for the changes to take effect. Now you can dial
MUSIC or 68742 and it will ask you which channel you wish to listen to and play that stream. If you wish to change the names and such, just make sure you change them in all places. This is the first time I've ever written anything with asterisk, so feel free to correct me or make improvements. But it's a lot more information and ability than I have been able to find yet.

No error checking for wrong keys and such, cause I haven't read up that far yet. Maybe one day or someone else.
So that's my little twist on the Streaming MOH. Of course, after you have done the restart, you can go into your trunk configs and set the MOH option there to whatever streams you wish to use too.
Let me know what ya think!
-Marv
- Cool tips like this are available because Ward has been nice enough to setup this board. If you find this useful, drop him some loose change to help him get a better server going ( http://pbxinaflash.com/forum/misc.php?do=donate )