Merged revisions 250786 via svnmerge from
authorJeff Peeler <jpeeler@digium.com>
Fri, 5 Mar 2010 01:05:46 +0000 (01:05 +0000)
committerJeff Peeler <jpeeler@digium.com>
Fri, 5 Mar 2010 01:05:46 +0000 (01:05 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r250786 | jpeeler | 2010-03-04 19:02:58 -0600 (Thu, 04 Mar 2010) | 9 lines

  Fix not being able to specify a URL in MOH class directory.

  Don't attempt to chdir on a URL!

  (closes issue #16875)
  Reported by: raarts
  Patches:
        moh-http.patch uploaded by raarts (license 937)
........

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

res/res_musiconhold.c

index 82e0534..676b018 100644 (file)
@@ -560,7 +560,7 @@ static int spawn_mp3(struct mohclass *class)
                ast_close_fds_above_n(STDERR_FILENO);
 
                /* Child */
-               if (strcasecmp(class->dir, "nodir") && chdir(class->dir) < 0) {
+               if (strncasecmp(class->dir, "http://", 7) && strcasecmp(class->dir, "nodir") && chdir(class->dir) < 0) {
                        ast_log(LOG_WARNING, "chdir() failed: %s\n", strerror(errno));
                        _exit(1);
                }