

Mv *.wav /var/lib/asterisk/moh/ mv *.FFmpeg is a free and open-source collection of tools for handling multimedia files. pcm files to your moh directory and restart asterisk: Moving the new files and restarting asterisk mp3 extension to whatever sound file extension you have. With ffmpeg you should be able to convert almost any type of sound file. NOTE: If your filenames have spaces in them, you’ll need to modify the command to something like this: The resulting WAV and PCM u-Law files will be larger then the original mp3, but that’s no big deal.įor f in `ls *.mp3` do FILE=$(basename $f. These files will sound fine down a phone line. On FreeBSD /usr/local/etc/asterisk/nfĬommand line for encoding all your mp3’s in some directory using ffmpeg to a mono WAV and PCM u-Law file of 64kbits/s at 8000Hz sample rate. This configuration will also play the files in random order.Īdd the following to nf configuration file. To make asterisk natively play files in /var/lib/asterisk/moh This information is useful if you don’t want to use a third party application such as mpg123 or you find using other applications to play MOH causes problems because you run asterisk on FreeBSD or something other then Linux. First one will be a WAV and the other a u-Law PCM all one step using ffmpeg.Īsterisk will choose the best file to play determined by the codec used on the channel. Here we’ll convert all the mp3 files in one directory into two files. Letting asterisk play native file seems to be the best practice for MOH (MusicOnHold). Converting Asterisk Music On Hold files using ffmpeg
