Music on Hold via LINE IN on the Sound Card

Discussion in 'General' started by Megabyte, Aug 7, 2009.

  1. Megabyte

    Mar 28, 2009
    Likes Received:
    Hi i was installing an elastix system in one of my clients and he told me the he wanted to hear a radio station and put some mp3 cds for his music on hold, in the pbx i made a little research and i got it right now working, i hope those configs can be usefull for the community to use it.

    1.Add the following to /etc/asterisk/musiconhold_custom.conf


    2.In SSH, type: mkdir /var/lib/asterisk/mohmp3/radio

    With that step we create a folder in that directory because in that way it will show us that category in the gui in music on hold and you can select it whenever you want.

    vim /var/lib/ece-playlinein and place the following two lines in the file:
    /usr/bin/arecord -q -c 1 -r 8000 --buffer-size=2048 -f S16_LE -t raw

    3.Type the following to set ownership:
    cd /var/lib
    chown asterisk:asterisk ece-playlinein
    chmod 777 ece-playlinein

    4.Type the following in SSH:
    groupadd -g 525 audio
    usermod -G audio root
    usermod -G audio asterisk

    5.vim /usr/sbin/amportal and add the following lines at the bottom:
    chown asterisk /dev/tty9
    chown -R root:audio /dev/snd
    chmod -R a+rwX /dev/snd

    7.Reboot the system: shutdown -r 0

    8.Upon system startup, type in SSH: alsamixer. Go to each channel and push the M button to unmute it. Also, hit the arrow up to get some volume in.

    In the console you can use "alsamixer -V capture" and go to the Line IN channel and hit the spacebar to unmute. 1.Hit the escape button to exit.

    Note: i recomended that you upload a last one mp3 file to the created folder.

    Go in to the GUI and select the radio class music as your default music on hold.

    Now make a test call and put yourself on hold and you should hear the music that you plugged in to Line IN on your sound card.

    I tested it an it is in production in two system right now.
  2. ramoncio

    May 12, 2010
    Likes Received:
    Nice solution, thanks for sharing here!
  3. rafael

    May 14, 2007
    Likes Received:
    Nice :)

    +1 to your karma
  4. Patrick_elx

    Dec 14, 2008
    Likes Received:
    This system is fine for playing music on hold from the line in, but I'm looking for a slight different way of using it.

    I would like to monitor different radio channels from an IVR menu.
    One option would be to go to the app_rpt route, but it does need zaptel to compile, and at every Elastix update I have to recompile everything. I also do not need transmit function at this time.

    The other way, is to plug a few USB sound card, plug in the line IN the different radios.

    When the user is in the IVR he should have the choice of which channel to listen to, and then when he's listening to the channel, he should be able to press some key to switch channel or go back to another ivr menu.

    If I understand well, MOH can only be used in a queue/hold forever, but then I haven't found an option for the caller to press a key to exit to another destination.

    The easy way to play a file with caller input in the gui is to use announcement, but how could I link an announcement to the sound card feed?

    There's probably also a way to create a misc destination/context/application?

    And last, how to manage multiple sound card with these options?

    Any thoughts?

Share This Page