Dialplan, How play sequence of files and read to variable

I need to play sequence of files while waiting for DTMF input from a caller. if caller send DTMF the play stop and assigns the result to a variable. how do that with dialplan?

I continue to look for best wat to do that. have sombody to help?

I try:

+Background: is not work with Read. the only way is trap the key by i and ${INVALID_EXTEN} once for Context.
+BackgroundDetect(): i not see any way to trap key to variable
+Read(,filename,): it’s read only after play end.
+Playback(filename[,options]): i not see any way to trap key to variable
+MP3Player(): i not see any way to trap key to variable

So what the best way to do that?

That’s not true, check better, if you enter all the requested digits (Read’s third parameter) or you press # the application will stop immediatly.

Regards.

Marco Bruni

[quote=“mbruni”][quote]
+Read(,filename,): it’s read only after play end.
[/quote]
That’s not true, check better, if you enter all the requested digits (Read’s third parameter) or you press # the application will stop immediatly.

Regards.

Marco Bruni[/quote]

OK, now I face with more challenge: I need to play sequence of files while coller can stop it by send someDTMF. and I need to send this to AGI?