app_record: RECORDED_FILE variable not being populated
authorKevin Harwell <kharwell@digium.com>
Mon, 21 Sep 2015 23:06:15 +0000 (18:06 -0500)
committerKevin Harwell <kharwell@digium.com>
Mon, 21 Sep 2015 23:10:21 +0000 (18:10 -0500)
The RECORDED_FILE variable is empty unless a '%d' is specified in the filename.
This patch makes it so the variable is always set to the filename.

ASTERISK-25410 #close

Change-Id: I4ec826d8eb582ae2ad184e717be8668b74d37653

apps/app_record.c

index ed54a77..fcd8938 100644 (file)
@@ -294,9 +294,10 @@ static int record_exec(struct ast_channel *chan, const char *data)
                        }
                        count++;
                } while (ast_fileexists(tmp, ext, ast_channel_language(chan)) > 0);
-               pbx_builtin_setvar_helper(chan, "RECORDED_FILE", tmp);
        } else
                ast_copy_string(tmp, args.filename, sizeof(tmp));
+
+       pbx_builtin_setvar_helper(chan, "RECORDED_FILE", tmp);
        /* end of routine mentioned */
 
        if (ast_channel_state(chan) != AST_STATE_UP) {