Background() not detecting DTMF digits

I have set up a simple Auto Attendant similar to the example in Chapter 15 of the “Definitive Guide”, 4th edition, but the Background() function does not seem to be detecting DTMF digits. The digits are detected and acted upon only after the complete file has been played. So, for example, in menu options 2 and 3 in my extensions.conf (below), I cannot interrupt playback of the sound clip. Any ideas what the problem might be?

[general]

[globals]

[Incoming]
exten => s,1,Verbose(1, Call from caller ${CALLERID(all)} received)
same => n,Answer()

; sets the inter-digit timer
same => n,Set(TIMEOUT(digit)=2)

; wait one second to establish audio
same => n,Wait(1)

; play greeting
same => n,Background(greeting)

; play menu
same => n(menuprompt),Background(menu)
same => n,WaitExten(5) ; 5 second timeout

exten => 1,1,Verbose(1, Option 1 selected)
same => n,VoiceMail(500@default,u)
same => n,Verbose(1, Voicemail exited - hanging up)
same => n,Hangup()

exten => 2,1,Verbose(1, Option 2 selected)
same => n,Background(mus_morning_coffee)
same => n,Goto(s,menuprompt)

exten => 3,1,Verbose(1, Option 3 selected)
same => n,Background(mus_cold_day)
same => n,Goto(s,menuprompt)

exten => 4,1,Verbose(1, Option 4 selected)
same => n,Playback(goodbye)
same => n,Verbose(1, Hanging up)
same => n,Hangup()

exten => i,1,Verbose(1, Invalid selection)
same => n,Playback(invalid_selection)
same => n,Goto(s,menuprompt)

exten => t,1,Verbose(1, Menu timeout)
same => n,Playback(timeout)
same => n,Goto(4,1)

Everything looks fine to me.

Personally I’d get rid of the Wait(1) line and modify your greeting line to be silence/1&greeting to combine the two.

Have you debugged that your PBX is getting the DTMF you are sending?

Thank you for the sanity-check. When I run “dahdi_monitor -v” I see the DTMF tones being received, and they are detected by WaitExten() but not by Background(). Also, when I go into ComedianMail via VoiceMailMain() I see the same behavior - the DTMF is only recognized if it is received after the entire menu prompt has been played. The playback can be interrupted by * or # but not by [0-9].

I’m not a DAHDI guy sorry, Maybe one of the other posters on the forum will be able to help you.

You can try enabling DTMF logging in logger.conf and restarting, See if you get DTMF logged inside asterisk when you press buttons on your phone.

console => notice,warning,error,dtmf

You can try enabling DTMF logging in logger.conf …

That’s helpful as I didn’t know I could do that. It’s probably something wrong with my dahdi configuration then, as asterisk is logging [0-9,#,*] when Background() is not running, but is only logging * and # while Background() is running.