app_mixmonitor: Set MIXMONITOR_FILENAME to correct value when wav49 is used

When opening a file for writing, Asterisk silently converts filenames
ending with 'wav49' to 'WAV.' We aren't taking that in to account when
setting the MIXMONITOR_FILENAME variable in MixMonitor.

* If the user wants to write to a wav49 file, make sure that it is
  reflected properly in MIXMONITOR_FILENAME.

* Add a note to the documentation describing this behavior.

* Add a note in main/file.c indicating that app_mixmonitor needs to be
  changed if the logic in build_filename was changed.

ASTERISK-24798 #close
Reported by: xrobau

Change-Id: I384691ce624eb55c80a125b9ca206d2d691c574c
This commit is contained in:
Sean Bright
2020-02-17 09:05:16 -05:00
parent 0d0f2b4569
commit cd8b27dcc2
3 changed files with 36 additions and 3 deletions

View File

@@ -315,6 +315,8 @@ static char *build_filename(const char *filename, const char *ext)
{
char *fn = NULL;
/* The wav49 -> WAV translation is duplicated in apps/app_mixmonitor.c, so
if you change it here you need to change it there as well */
if (!strcmp(ext, "wav49"))
ext = "WAV";