--- app.c 2006-08-22 10:40:57.000000000 -0500 +++ app_new.c 2006-08-22 10:55:04.000000000 -0500 @@ -103,14 +103,24 @@ "ludicrous time" (essentially never times out) */ int ast_app_getdata(struct ast_channel *c, char *prompt, char *s, int maxlen, int timeout) { - int res,to,fto; + int res=0,to,fto, result=0; /* XXX Merge with full version? XXX */ if (maxlen) s[0] = '\0'; if (prompt) { - res = ast_streamfile(c, prompt, c->language); - if (res < 0) - return res; + char *front; + char *temp = ast_strdupa(prompt); + while(!res && (front = strsep(&temp, "&"))) { + if( (res = ast_streamfile(c, front, c->language)) ) { + res = 0; + break; + } + if(!res && !result) + result = ast_waitstream(c, AST_DIGIT_ANY); + if(result) + break; + ast_stopstream(c); + } } fto = c->pbx ? c->pbx->rtimeout * 1000 : 6000; to = c->pbx ? c->pbx->dtimeout * 1000 : 2000; @@ -120,6 +130,11 @@ if (timeout < 0) fto = to = 1000000000; res = ast_readstring(c, s, maxlen, to, fto, "#"); + if(result) { + char tmp[256]; + snprintf(tmp, sizeof(tmp), "%c%s", result, s); + snprintf(s, sizeof(tmp), "%s", tmp); + } return res; }