问题
[out]
exten=>_X.,1,Answer()
exten=>_X.,n,Background(hello)
exten=>_X.,n,WaitExten(5)
exten=>1,1,Goto(check,s,1)
Audio menu are playing, but when I press 1, sound stop and after few second check command run. How to quickly respond to a user request?
回答1:
You are doing begginer error which described in almost any asterisk book for beginer.
I recommend you read "Asterisk The Future of Telephony" by O'Relly.
This exact error is simple:
- in your dialplan you have extension _X., which mean "any number starting with digit.
 - you ask asterisk waitfor extension selected in this context.
 - you are pressing digit, but acordinly to context you may want enter 1111(also fit you context). So asterisk wait upto TIMEOUT(digits) until you enter next digit.
 - your timeout is 5 second, so it go ext 1 in 5 second.
 
[Syntax]
BackGround(filename1[&filename2[&...]][,options[,langoverride[,context]]])
You can use other context for matching.
来源:https://stackoverflow.com/questions/54944814/asterisk-keys-dont-work-on-background-command-just-after-background