Index: apps/app_mixmonitor.c =================================================================== --- apps/app_mixmonitor.c (revision 309634) +++ apps/app_mixmonitor.c (working copy) @@ -280,6 +280,7 @@ struct ast_filestream **fs = NULL; unsigned int oflags; char *ext; + char *last_slash; int errflag = 0; struct ast_format format_slin; @@ -312,8 +313,9 @@ if (!*fs && !errflag && !mixmonitor->mixmonitor_ds->fs_quit) { 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";