<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<style type="text/css">
<!--
body{margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:10px;}
-->
</style>
</head>
<body marginleft="10" marginright="10" margintop="10" marginbottom="10">
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">I am having trouble getting streaming MOH to work. As far as I can tell I have everything configured properly but there is only silence. Your help is appreciated. I am running Asterisk 1.8.11-cert10 with mpg123 1.12.1 to play the stream (I have tried madplay, and mpg321, and I compiled streamplayer as well with the same results). I started by finding a
working stream and tested this from the shell (and Winamp just to be sure):</font></div>
<br />
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">/usr/bin/mpg123 -q -r 8000 -f 8192 --mono -s </font><font face="Calibri" size="+0" color="#0000FF" style="font-family:Calibri;font-size:11pt;color:#0000FF;"><u><a href="http://208.77.21.15:11510" target="_blank">http://208.77.21.15:11510</a></u></font></div>
<br />
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">It begins dumping the stream to the screen so I feel pretty confident this is working.</font></div>
<br />
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">In musiconhold.conf I have:</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">[default]</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">mode=files</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">directory=moh</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">sort=random</font></div>
<br />
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">[test]</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">mode=custom</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">; Note that with mode=custom, a directory is not required, such as when reading</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">; from a stream.</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">;directory=/var/lib/asterisk/mohmp3</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">application=/usr/bin/mpg123 -q -r 8000 -f 8192 --mono -s <a href="http://208.77.21.15:11510" target="_blank">http://208.77.21.15:11510</a></font></div>
<br />
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">CLI> moh reload</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">CLI> moh show classes</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">Class: default</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;"> Mode: files</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;"> Directory: moh</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">Class: test</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;"> Mode: custom</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;"> Directory: nodir</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;"> Application: /usr/bin/mpg123 -q -r 8000 -f 8192 --mono -s <a href="http://208.77.21.15:11510" target="_blank">http://208.77.21.15:11510</a></font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;"> Format: slin</font></div>
<br />
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">After the moh reload I see the mpg123 process running:</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">ps aux | grep mpg</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">myuser 10183 0.0 0.0 14184 1020 ? S 07:07 0:00 /usr/bin mpg123 -q -r 8000 -f 8192 --mono -s <a href="http://208.77.21.15:11510" target="_blank">http://208.77.21.15:11510</a></font></div>
<br />
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">Then in extensions.conf I added:</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">exten => 1234,1,NoOp()</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">same => n,Answer()</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">same => n,MusicOnHold(test)</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">same => n,Hangup()</font></div>
<br />
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">CLI> dialplan reload</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">Then I dial:</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;"> == Using SIP RTP CoS mark 5</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;"> == Using UDPTL CoS mark 5</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;"> -- Executing [1234@features:1] NoOp("SIP/mysip_4405-0000001f", "") in new stack</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;"> -- Executing [1234@features:2] Answer("SIP/mysip-0000001f", "") in new stack</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;"> -- Executing [1234@features:3] MusicOnHold("SIP/mysip-0000001f", "test") in new stack</font></div>
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;"> -- Started music on hold, class 'test', on channel 'SIP/mysip-0000001f'</font></div>
<br />
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">I hear just dead air. I have tried different settings for buffering the stream, other stream sources, other players, defining a directory with a 0 byte file as some tutorials suggest, streaming to a file, etc but always with the same results. Dead silence. Thank you for your help.</font></div>
<br />
<div align="left" style="line-height:115%;vertical-align:115%;text-align:left;"><font face="Calibri" size="+0" color="#000000" style="font-family:Calibri;font-size:11pt;color:#000000;">Chet Stevens</font></div>
</body>
</html>