Index: apps/app_dictate.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_dictate.c,v retrieving revision 1.4 diff -u -r1.4 app_dictate.c --- apps/app_dictate.c 6 Jun 2005 22:39:31 -0000 1.4 +++ apps/app_dictate.c 16 Sep 2005 15:05:47 -0000 @@ -34,7 +34,7 @@ static char *tdesc = "Virtual Dictation Machine"; static char *app = "Dictate"; static char *synopsis = "Virtual Dictation Machine"; -static char *desc = " Dictate([])\n" +static char *desc = " Dictate([[|]])\n" "Start dictation machine using optional base dir for files.\n"; @@ -67,7 +67,7 @@ static int dictate_exec(struct ast_channel *chan, void *data) { - char *mydata, *argv[2], *path = NULL, filein[256]; + char *mydata, *argv[3], *path = NULL, filein[256],*filename = ""; char dftbase[256]; char *base; struct ast_flags flags = {0}; @@ -98,7 +98,9 @@ } else { base = dftbase; } - + if (argc && argv[1]){ + filename = argv[1]; + } oldr = chan->readformat; if ((res = ast_set_read_format(chan, AST_FORMAT_SLINEAR)) < 0) { ast_log(LOG_WARNING, "Unable to set to linear mode.\n"); @@ -109,12 +111,18 @@ ast_answer(chan); ast_safe_sleep(chan, 200); for(res = 0; !res;) { - if (ast_app_getdata(chan, "dictate/enter_filename", filein, sizeof(filein), 0) || - ast_strlen_zero(filein)) { - res = -1; - break; + if (strlen(filename)<1) + { + if (ast_app_getdata(chan, "dictate/enter_filename", filein, sizeof(filein), 0) || + ast_strlen_zero(filein)) { + res = -1; + break; + } + } + else { + snprintf(filein,sizeof(filein),"%s", filename); + filename = ""; } - mkdir(base, 0755); len = strlen(base) + strlen(filein) + 2; if (!path || len > maxlen) {