Record() ended in timeout or pound pressing? How to know?

Greetings everyone!

I’m not sure if this should be here or in support forum,

Is there a way to know how the record ended? (pressed #, silence detected, maximum lenght)

So that we know if the caller said all he wanted to, ask for a re-recording in case maxduration was reached or whatever…

too bad it does not work like the priority jumping thing

exten => rec,1,playback(please-say-blablab)
exten => rec,2,record(aaaaa:gsm|4|9)
exten => rec,3,goto(nextstep,s,1) ; pressed #
exten => rec,103,goto(rec,1) ; timeout max
exten => rec,104,goto(rec,1) ; silence / He got distracted and didn’t say anything

I know we can allways ask, press 1 to hear your voice, 2 to confirm the recording, 3 to re-record, but its boring for the user to do it at every single step.

We can also ask for them to press double pounds ##

exten => rec,1,record(aaaaa:gsm|3|9)
exten => rec,2,waitexten(1)

exten => t,1,goto(retry,1)
exten => retry,1,playback(please-say-again)
exten => retry,2,goto(rec,1)

exten => #,1,goto(buff,s,1)

exten => s,1,waiexten(1)
exten => #,1,goto(next,s,1) ; in case caller pressed ## just after record timeout
exten => t,1,goto(nextstep,s,1)

exten => s,1,whatever…

But thats weird too, isn’t there a returned variable or anything?


Oh, btw.
If anyone comes looking for the same answer, just use

exten => Monitor() ; to start recording
exten => BackgroundDetect ( set a minumum speech time and the disered silence after that as if it were the silence detect of record() )
exten => # = StopMonitor()