■mpg123をインストールする(CentOS5.4の場合)
○RPMforgeリポジトリをyumで使えるようにする
[root@localhost ~]# rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
[root@localhost ~]# rpm -ivh http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
○mpg123パッケージの確認を行う
[root@localhost ~]# yum info mpg123
Loaded plugins: fastestmirror, kmod
Loading mirror speeds from cached hostfile
* addons: ftp.riken.jp
* base: ftp.riken.jp
* epel: ftp.kddilabs.jp
* extras: ftp.riken.jp
* rpmforge: apt.sw.be
* updates: ftp.riken.jp
Available Packages
Name : mpg123
Arch : i386
Version : 1.12.0
Release : 1.el5.rf
Size : 549 k
Repo : rpmforge
Summary : MPEG audio player
URL : http://mpg123.org/
License : GPL/LGPL
Description: Real time command line MPEG audio player for Layer 1, 2 and Layer3.
:
: Available rpmbuild rebuild option :
: --define 'audio {alsa,esd,jack,nas,oss,portaudio,sdl}'
○インストールを行う
[root@localhost ~]# yum install mpg123
Dependencies Resolved
=========================================================================================================
Package Arch Version Repository Size
=========================================================================================================
Installing:
mpg123 i386 1.12.0-1.el5.rf rpmforge 549 k
Transaction Summary
=========================================================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 549 k
Is this ok [y/N]: y
Downloading Packages:
mpg123-1.12.0-1.el5.rf.i386.rpm | 549 kB 00:02
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : mpg123 1/1
Installed:
mpg123.i386 0:1.12.0-1.el5.rf
Complete!
(参考)
http://centossrv.com/rpmforge.shtml
◆ musiconhold.conf を編集し、mp3ファイルのあるディレクトリを指定する
# vi /etc/asterisk/musiconhold.conf
<例>
[default]
;mode=files ←コメントアウト
mode=mp3
random=yes
;directory=/var/lib/asterisk/moh ←コメントアウト
directory=/var/lib/asterisk/moh/mp3
(注意)/var/lib/asterisk/moh/mp3は、ユーザーasteriskとグループasteriskが読み出せるようにしておくこと!
◆ musiconhold.conf をリロードする
# asterisk -r
localhost*CLI> moh reload
以上