]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 309856 via svnmerge from
authorJonathan Rose <jrose@digium.com>
Mon, 7 Mar 2011 22:04:44 +0000 (22:04 +0000)
committerJonathan Rose <jrose@digium.com>
Mon, 7 Mar 2011 22:04:44 +0000 (22:04 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r309856 | jrose | 2011-03-07 16:02:12 -0600 (Mon, 07 Mar 2011) | 8 lines

  Bug fix for MixMonitor involving filenames with '.' not in the extension

  Closes issue #18391)
  Reported by: pabelanger
  Patches:
        bugfix.patch uploaded by jrose (license 1225)
  Tested by: jrose
........

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

apps/app_mixmonitor.c

index 9fb2c72b984549e451d2220890c0f078fadb4ffb..64ffa776b2835b89b5101b5b1f301a0f0cc1d80f 100644 (file)
@@ -283,6 +283,7 @@ static void *mixmonitor_thread(void *obj)
        struct ast_filestream **fs = NULL;
        unsigned int oflags;
        char *ext;
+       char *last_slash;
        int errflag = 0;
 
        ast_verb(2, "Begin MixMonitor Recording %s\n", mixmonitor->name);
@@ -314,7 +315,8 @@ static void *mixmonitor_thread(void *obj)
                                oflags = O_CREAT | O_WRONLY;
                                oflags |= ast_test_flag(mixmonitor, MUXFLAG_APPEND) ? O_APPEND : O_TRUNC;
 
-                               if ((ext = strrchr(mixmonitor->filename, '.')))
+                               last_slash = strrchr(mixmonitor->filename, '/');
+                               if ((ext = strrchr(mixmonitor->filename, '.')) && (ext > last_slash))
                                        *(ext++) = '\0';
                                else
                                        ext = "raw";