I’m trying to setup a simple Asterisk system for my house so that when I call in from the outside I can be presented with a menu (for checking voicemail, getting weather updates, etc).
The idea is that while my home phone is ringing, the caller can press 9 which will then Goto(password-menu,s,1) and ask for the password. This works, but I think something gets screwed up because if they enter the wrong password I want them to be able to immediately re-enter it. What happens is that I think Background() is causing the entered digits to jump to other (invalid/nonexistant) extensions.
What am I doing wrong? Is there any easier way to ask for a simple password (with ability to re-enter if incorrect)?
[password-menu]
exten => s, 1, Set(ATTEMPTS=0)
exten => s, 2, Background(enter-password)
exten => s, 3, Read(PASSWORD,, 4,, 2)
exten => s, 4, GotoIf($[ ${PASSWORD } = 1111]?mainmenu, s, 1: 5)
exten => s, 5, Background(im-sorry)
exten => s, 6, Background(please-try-again)
exten => s, 7, Goto(3)
[mainmenu]
exten => s, 1, Background(main-menu)
exten => s, n, Background(to-log-in-to-voice-mail)
exten => s, n, Background(press-2)
exten => s, n, Background(to-hear-callerid)
exten => s, n, Background(press-3)
exten => s, n, Background(star-for-menu-again)