diff --git a/apps/app_mixmonitor.c b/apps/app_mixmonitor.c index ca3a23991b..26ebd14c5f 100644 --- a/apps/app_mixmonitor.c +++ b/apps/app_mixmonitor.c @@ -280,6 +280,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); @@ -311,7 +312,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";