]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix issue with streaming MOH failing if nobody is listening.
authorJoshua Colp <jcolp@digium.com>
Thu, 12 Mar 2009 16:29:19 +0000 (16:29 +0000)
committerJoshua Colp <jcolp@digium.com>
Thu, 12 Mar 2009 16:29:19 +0000 (16:29 +0000)
When a music class is setup to actually provide music on hold
from a stream we need to constantly read audio from it since it
will constantly be providing audio. This is now done despite there
being no channels listening to it.

(closes issue #14416)
Reported by: caspy

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181655 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_musiconhold.c

index a1400476c609cc6f00bd3d09ba99607e7fdc5698..0f248ded1f33d61a0d57ead2afac2f5311e1b057 100644 (file)
@@ -557,11 +557,11 @@ static void *monmp3thread(void *data)
                        }
                        res = 8 * MOH_MS_INTERVAL;      /* 8 samples per millisecond */
                }
-               if (AST_LIST_EMPTY(&class->members))
+               if (strncasecmp(class->dir, "http://", 7) && AST_LIST_EMPTY(&class->members))
                        continue;
                /* Read mp3 audio */
                len = ast_codec_get_len(class->format, res);
-               
+
                if ((res2 = read(class->srcfd, sbuf, len)) != len) {
                        if (!res2) {
                                close(class->srcfd);