Asterisk: Background() greeting interfering with DTMF

If you are having issues with digits being cut while entering the extension on incoming calls the issue might be with the music interfering with DTMF being entered. Background will listen for DTMF tones while playing music in the background, like in the context below:


[menu]
exten => s,1,Answer()
exten => s,n,Set(TIMEOUT(response)=10)
exten => s,n,Set(TIMEOUT(digit)=5)
exten => s,n,Background(beep)
exten => s,n,Background(greeting7,m)
exten => s,n,WaitExten(4)
exten => s,n,Hangup

When trying to dial 4005 extension, asterisk accepted only last three digits, resulting in following error message


WARNING[24270]: pbx.c:5169 __ast_pbx_run: Invalid extension '005', but no rule 'i' or 'e' in context 'menu'

If this is the case you should use Read() instead Background(), example below:


[menu]
exten => s,1,Answer
exten => s,n,Read(LOKAL,greeting7,4,,5)
exten => s,n,Dial(SIP/${LOKAL},60,tTg)
exten => s,n,Hangup

Tags

Asterisk: Background() greeting interfering with DTMF