Asterisk / Trixbox
    Setting Up MOH ( Music On Hold ) with Asterisk
    Music on Hold
    Provided By: MonkeyTech.Net for use by FaktorTel.
    Step 1:

    Firstly, check your version of mpg123

    I found I required Version 0.59r to work with asterisk and after reading some forums found, others have had the same problem.


    cd mpg123-0.59r
    make <<-- to see list of supported os
    make linux <<-- for linux systems
    make install
    ln -s /usr/local/bin/mpg123 /usr/bin/mpg123

    Step 2:

    Now make a dir for your music ( you can also stream a shoutcast stream, however, will get to that soon )

    cd /var/lib/asterisk/mohmp3/
    mkdir mymusic

    Place some mp3 files in the folder we just made.

    Step 3:

    Edit the "/etc/asterisk/zapata.conf " and make sure the following line is uncommented
    ( not sure if this is really required, but it won't hurt )


    Step 4:

    Now we need to tell Asterisk where to find the music to play while on hold

    Rename " musiconhold.conf "

    mv musiconhold.conf musiconhold.backup

    Create new " musiconhold.conf " with your text editor ( nano / pico )

    nano /etc/musiconhold.conf

    Add these lines:

    default => mp3:/var/lib/asterisk/mohmp3/mymusic,-z

    *Note: The " -z " flag plays files randomly remove, " -z " to play files in order

    For streaming audio on musiconhold

    Make another dir in /var/lib/asterisk/mohmp3/ called stream
    then create a empty file with a .mp3 extenstion


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

    nano /etc/musiconhold.conf and change the Default line above to something like this:

    default => mp3:/var/lib/asterisk/stream,

    make sure you add the URL to the shoutcast server you wish to use at asterisk prompt issue " reload " command or restart asterisk

    Using Module Format_mp3 instead of mpg123

    There are some issues with mp3 playback and mpg123 if you are having problems mite like to try this:

    cd /usr/src
    cvs login - the password is anoncvs.
    cvs checkout asterisk-addons
    cd asterisk-addons/format_mp3
    make install

    make sure " autoload " is enabled in /etc/asterisk/modules.conf

    Create Dir

    add Dir

    add mp3 files into that dir

    edit musiconhold.conf

    nano /etc/asterisk/musiconhold.conf

    uncomment the " default " context we made above. Make sure you have these lines:

    default => /var/lib/asterisk/moh-native

    *Note: The smaller the filesize the better. E.g. Dont need anything over 128k and really only needs to be mono.

    On your softphone you can place call on hold by pressing the " 1 " button under the display.

    If there are any problems or typos please let us know.

    We will have a voicemail howto coming soon. We are setting up a different speech synth program and will include that in the example.

    Click Here - top of page
Copyright © 2017 FaktorTel | Phone: 1300 731 625 | International: +61 7 3118 9598