IVR detect the # key to bypass MixMonitor

Hi guys, I’m trying to create a simple IVR to allow callers to press the # key if they don’t wish to be recorded but my knowledge with Asterisk is limited.

I experimented with Read and ExecIf functions but they don’t seem to be adequate so I used WaitExtend and GotoIf instead but to no avail.

I can’t figure out how to continue the dialplan after the # key is pressed or if I’m going in the right direction at all.

Any advice or pointers would be much appreciated !

Here’s what I came up with (Asterisk 11.13) I get the error

WARNING pbx_extension_helper: No application ‘’ for extension (incoming-test, #, 4)

same => 1,Answer()
same => n,Background(/path/to/announce)
same => n,WaitExten()
exten => #,1,Goto(donotrecord)
same => n,MixMonitor(/path/to/recordings)
same => n,Goto(dial)
same => n(donotrecord),Noop()
same => n,Goto(dial)

This line is not reachable, because it is preceded by an unconditional GoTo and is not, itself, a branch target.

You might find Read better.

With WaitExten, you really need a dedicated context, and you would need a “t” extension to catch the nothing entered case (although I haven’t tried this myself).

I would strongly suggest making a voice announcement as to whether recording is enabled, as one could easily assume that recording was off, when it was not, and, for example, I don’t imagine that would be acceptable for PCI DSS.

This is over seven years old and main stream support for Asterisk 11 ended over five years go, although it is unlikely that this is relevant here.

You have the ‘exten => #,1…’ line in the wrong place which prevents the dialplan from continuing beyond ‘WaitExten’.
It should be at the bottom after ‘same => n,Goto(dial)’ and probably with a new added line ‘same => n,Goto(dial)’ after it.