Reply
 
Thread Tools Display Modes
  #1  
Old 01-21-08, 09:35 PM
darmock darmock is offline
Guru
 
Join Date: Oct 2007
Location: Florida
Posts: 1,210
MP3 Music On Hold
It seems that some people are having problem playing Music on hold that is formatted in MP3. Below is a short howto to make it work reliably

Caveat

You will need PIAF 1.1 with update-source run then update-scripts and then update-fixes (in this order please)

1. Download the following rpm's

http://ftp.belnet.be/packages/dries....c5.rf.i386.rpm
http://ftp.belnet.be/packages/dries....c5.rf.i386.rpm

This just happens to be the place I downloaded from your mileage may vary.


2. Install the rpms

rpm -ivh lame*.rpm


3. Delete the rpm's

rm -vf lame*.rpm (use this with caution because of the -f flag!)


4. Open /etc/php.ini in your favourite editor and locate the line

upload_max_filesize = 2M

(line 528 there abouts)


And change it to

upload_max_filesize = 100M

5. Save the file
6. Reboot
7. After the reboot you will need to log onto freepbx and choose music on hold

8. Now the fun part.... I simply deleted all of the included wav files..... Once you have done that click the browse button and find one of your "own non copyrighted" MP3's and select it.

9. Click the upload button and WAIT... you should see a the message Done in the bottom left hand corner of the browser.

10. Click enable random play

11. Click the orange reload button in the middle near the top.

12. give it a try.

When I was looking to see why Digium decided to make wav the default standard I found a lot of people were PO'd! I thought lets see what happens when I try to upload an MP3 file through FreePBX.... Initially I got an error saying unable to find lame!!!! Gee that was my first clue.

The real magic seems to be in compiling asterisk addons yourself (instead of letting a corporate entity do it for you) inside of the addon package there is a wonderful thing called format_mp3 which, on the surface, does not seem to be related to playing mp3's but..... PIAF users get this feature by default and the missing piece was lame.

Also I did not have to modify any of my MP3 tracks by ripping them etc. Plus the supposed processor hit that other PBX guys give as the reason that it was removed is less than 1.4% with 8 lines on hold...... Hmmm makes one wonder about the real reason? Anyone say RIAA? Anti Piracy......



If you use copyrighted material for your music on hold you will go to jail for 1000 years and pay millions in fines so fair warning. Remember in the eyes of the law in the US a 0.99 song is worth beheading you over!




Sorry I rant at times

Tom

Last edited by darmock : 01-22-08 at 12:52 PM. Reason: spelling 8)
Reply With Quote
  #2  
Old 01-22-08, 08:36 AM
jvangent100 jvangent100 is offline
Junior Member
 
Join Date: Jan 2008
Posts: 9
I use streaming music with Piaf, but had to get an old mpg123 rpm, as compiling mpg123 059r under centos 5.1 fails.

Works pretty well, running it of a internal shoucast server. Tried mplayer as well, but no luck against mms.
Reply With Quote
  #3  
Old 01-22-08, 09:30 AM
phinphan phinphan is offline
Senior Member
 
Join Date: Oct 2007
Posts: 262
jvangent100 - any chance of a simple howto on getting streaming to work? I have tried numerous methods so far without success.
Reply With Quote
  #4  
Old 01-22-08, 11:42 AM
jvangent100 jvangent100 is offline
Junior Member
 
Join Date: Jan 2008
Posts: 9
I had this working on my old Asterisk@home box, when I moved to PIAF, there was one challenge, mpg123 isn't included, that was the PGM that worked for me at the old box. I tried to get it at www.mpg123.de, but it wouldn't complile on Centos 5.1, it did compile successfully on Cent OS 4.5.

So I did a search on google and found a precompiled RPM of MPG123. You apparently need 0.59R (which is rather old). After that it was easy, these instructions are also on nerd vittles site somewhere

You need to add directory in /var/lib/asterisk/mohmp3

mkdir /var/lib/asterisk/mohmp3/stream

then create an empty mp3 file with

touch /var/lib/asterisk/mohmp3/stream/stream.mp3

Then edit the musiconhold.conf file

nano /etc/asterisk/musiconhold.conf

under the [classes] heading add:

stream => mp3:/var/lib/asterisk/mohmp3/stream,http://stream.com:8002/

where the stream.com:8002 is of course the streaming host and the port.

I use this from an internal shoutcast server, works fine.

You will have to google for the precomiled version of mpg123, I'm not at home, so I cannot provide a link to it.

Last edited by jvangent100 : 01-22-08 at 11:52 AM.
Reply With Quote
  #5  
Old 01-22-08, 05:32 PM
tel0p tel0p is offline
Guru
 
Join Date: Nov 2007
Location: Seattle, WA
Posts: 195
mpg123
I'm using mpg123 version 1.0.1 without issue.
Similar to the above instructions, except i'm editing /etc/asterisk/musiconhold_custom.conf, which looks like..
Code:
[default]
mode=custom
directory=/var/lib/asterisk/mohmp3/stream

;24k SOMA.FM Groove Salad
application=/usr/local/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0 http://160.79.128.242:8004/
Reply With Quote
  #6  
Old 02-19-08, 05:33 PM
telemach telemach is offline
Member
 
Join Date: Oct 2007
Posts: 36
so if I would like to play some music to my callers using AGI script
and stream_file method what tool do I need ? mpg123 does not seem to install and does not come included
Reply With Quote
  #7  
Old 02-24-08, 06:04 AM
wardmundy wardmundy is offline
Nerd Uno
 
Join Date: Oct 2007
Posts: 3,881
You can download MPG123 from here. Then rpm -ivh mpg*.
Reply With Quote
  #8  
Old 02-25-08, 12:10 AM
jeremywillden jeremywillden is offline
Guru
 
Join Date: Feb 2008
Posts: 145
Has anyone tried the latest mpg123?
I ran
yum list | grep mpg123
and found that there's a precompiled version available through yum for PiaF distros. Has anyone tried it, instead of pulling down the really old version?
Jeremy

UPDATE:
I tried it and with version 1.2.0 of mpg123 (what I got with a yum install tonight) works great, as well. I suggest, though, that you put your additions in the musiconhold_custom.conf instead of musiconhold.conf.

How I did it (mostly from Ward's instructions on nerdvittles, updated a bit with stuff from tel0p above, the http link in the code is where the stream comes from):
Installed mpg123:
yum -y install mpg123 mpg123-devel

Added the following to musiconhold_custom.conf:
[stream]
mode=custom
dir=/var/lib/asterisk/mohmp3/stream
application=/usr/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0 http://160.79.128.242:8004/

Added the dummy files while logged in as asterisk (not root):
mkdir /var/lib/asterisk/mohmp3/stream
touch /var/lib/asterisk/mohmp3/stream/stream.mp3

I used ngrep (packet sniffer) and determined that it only connects to the stream when someone is actually on hold (nice not to chew up your bandwidth and the streaming server's when not required).

ngrep -Wbyline host ip.address.of.server

Good luck!

Last edited by jeremywillden : 02-25-08 at 01:17 AM. Reason: Found more information
Reply With Quote
  #9  
Old 03-05-08, 08:06 AM
telemach telemach is offline
Member
 
Join Date: Oct 2007
Posts: 36
BTW : Do you have an idea how to gain the volume for files streamed/played to caller via AGI script and MP3Player ??? This is a problem for me as I can't modify files on remote server and volume is too low.
Reply With Quote
  #10  
Old 03-05-08, 08:50 AM
jroper jroper is offline
Guru
 
Join Date: Oct 2007
Posts: 3,333
Hi

You would have to pull the files into a sound editor and increase the amplitude.

Alternatively, you could do it with sox at the command line. type man sox for more instructions.

Joe
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:58 PM.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright ©2007-2008, Ward Mundy & Associates