<div dir="ltr">If you have in musiconhold.conf cachertclasses=yes then it will only pull one stream. Below is what you can try:<div><br></div><div><div><br></div><div>musiconhold.conf</div><div>[general]</div><div>cachertclasses=yes ; use 1 instance of moh class for all users who are using it,</div><div>preferchannelclass=no ; Needed so that we use what's set in MusicOnHold() and not the channel default</div><div><br></div><div>[default]</div><div>mode=files</div><div>directory=moh</div><div><br></div><div><div>[my_station]<br></div><div>mode=custom</div><div>application=/etc/asterisk/my_station.sh<br></div></div><div><br></div>my_station.sh</div><div><div>#!/bin/bash</div><div><br></div><div>/usr/bin/ffmpeg  -i '<STREAM_URL_HERE>' -vn -ar 8000 -ac 1 -f s16le -</div><div><br></div><div><br></div><div>echo "[$(date +%F) $(date +%T)] $0" >> /tmp/streams_down #Log downed streams.</div><div>sleep $(( ( RANDOM % 60 )  )) #This is extremely important as if it's not here the repeat will lockup a core on the box</div><div><br></div><div><br></div>

<br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 16, 2018 at 5:34 PM, Glenn Geller (VDOPh) <span dir="ltr"><<a href="mailto:ggeller@vdo-ph.com" target="_blank">ggeller@vdo-ph.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Mike,<div><br></div><div>Technically, it's possible. It takes a bit of work to extract the right stream links from the playlist file, and some services hide this from sight, best they can.</div><div><br></div><div>We tried to do a similar thing, streaming <a href="http://smoothjazz.com" target="_blank">smoothjazz.com</a> radio through Askerisk, as MOH.</div><div><br></div><div>What we found was that the way Asterisk works (or worked originally, when we tested), it tries to open a new socket for each MOH "session", and they'd see multiple sessions from our IP address, and eventually block the IP. </div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>What we did to alleviate this, was install a locally controlled Icecast server used as a "relay", which pulls 1 stream from them, and allows us to pull multiple streams (relays) from the server... never been blocked since.</div><div><br></div><div>As far as the legality is concerned, technically ANY music for "public consumption" requires a performance license of some kind. However, as long as they'e not a huge company, and just using for hold music, or internal office music... should be fine.</div><div><br></div><div>Good luck!<br></div><div><div><div dir="ltr" class="gmail-m_2692192551964106440m_6056301554053554190gmail_signature"><br><font color="#222222" style="font-size:13px;border-collapse:collapse;font-family:arial,sans-serif"><b>Glenn Geller<br><br></b></font><p style="margin:0px"><strong style="border-collapse:separate;color:rgb(51,51,51);font-family:Geneva,Arial,Helvetica,sans-serif;font-weight:bold"><font size="3"><span style="line-height:21px">VDO-Ph International</span></font></strong></p></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, May 16, 2018 at 8:02 AM Mike Diehl <<a href="mailto:mdiehlenator@gmail.com" target="_blank">mdiehlenator@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Hi all,<br><br></div>I have a user who would like to stream their favorite radio station from iHeart radio for their music on hold.<br><br></div>It this TECHNICALLY possible?  If so, any pointers would be appreciated.<br><br></div>Is this LEGAL in the US?<br><br></div>Thanks in advance,<br><br></div>Mike.<span class="gmail-HOEnZb"><font color="#888888"><br></font></span></div><span class="gmail-HOEnZb"><font color="#888888">
-- <br>
______________________________<wbr>______________________________<wbr>_________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
Check out the new Asterisk community forum at: <a href="https://community.asterisk.org/" rel="noreferrer" target="_blank">https://community.asterisk.<wbr>org/</a><br>
<br>
New to Asterisk? Start here:<br>
      <a href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" rel="noreferrer" target="_blank">https://wiki.asterisk.org/<wbr>wiki/display/AST/Getting+<wbr>Started</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/<wbr>mailman/listinfo/asterisk-<wbr>users</a></font></span></blockquote></div>
<br>-- <br>
______________________________<wbr>______________________________<wbr>_________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
Check out the new Asterisk community forum at: <a href="https://community.asterisk.org/" rel="noreferrer" target="_blank">https://community.asterisk.<wbr>org/</a><br>
<br>
New to Asterisk? Start here:<br>
      <a href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" rel="noreferrer" target="_blank">https://wiki.asterisk.org/<wbr>wiki/display/AST/Getting+<wbr>Started</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/<wbr>mailman/listinfo/asterisk-<wbr>users</a><br></blockquote></div><br></div></div></div>