[SOLVED] Auto Attendant Question

I am setting up the auto attendant for my Asterisk system and I have a couple of questions. I have a menu system like the one below:

;IRV Main Day
exten => 275,1,Answer()
exten => 275,n,Wait(0.5)
exten => 275,n,Background(/var/lib/asterisk/sounds/custom/menu)
exten => 275,n,WaitExten(5)

exten => 1,1,Goto(callByExtension,s,1)

exten => 2,1,Directory(default,users,e)

exten => _XXX,1,Goto(users,${EXTEN},1)
exten => _XXX,n,Hangup()

exten => t,1,Playback(goodbye)
exten => t,n,Hangup()

This works so far, but there is a delay when the user chooses the 1 or 2 option. If the user dials a three digit extension, they are connected immediately. The problem is that we have three digit extensions beginning with 1 or 2. Should I make my options a different number, like 6 or 7, or should I say, “If you know your party’s extension, dial 1”. Then set up a sub-menu that says, “Please enter your party’s extension followed by the pound sign”.
If I choose the latter, how do I check for the pound sign?
Thank you,
Jason Baker
Glastender, Inc.

I believe the advice, when setting up a dialplan, is to reserve low numbers for menus and start extension numbers with something like 6 upwards.

That won’t help, in this case, because of the pattern _XXX.

Why did you use _XXX…Goto, rather than including the other context?

[quote]I believe the advice, when setting up a dialplan, is to reserve low numbers for menus and start extension numbers with something like 6 upwards.

That won’t help, in this case, because of the pattern _XXX.

Why did you use _XXX…Goto, rather than including the other context?[/quote]

We already have extensions with our current system which are numbered 100 - 300. I cannot change that.

I used _XXX Goto because I found it in an example and it worked. I have just started working with Asterisk, so obviously I’m open to recommendations. I’m trying to make my menu with as few options and sub menus as possible.

Thank you,
Jason Baker
Glastender, Inc.

The problem is that you have menu choices that begin with the same digit as an extension. Asterisk doesn’t know whether you are dialing an option or if you are going to dial an extension, so it waits until it times out. You should make your menu choices begin with a digit that is not the same digit as an extension.

I would also use _1XX, _2XX, and _3XX instead of _XXX. Otherwise, every digit press is a potential extension and you will get the delay.

[quote]The problem is that you have menu choices that begin with the same digit as an extension. Asterisk doesn’t know whether you are dialing an option or if you are going to dial an extension, so it waits until it times out. You should make your menu choices begin with a digit that is not the same digit as an extension.

I would also use _1XX, _2XX, and _3XX instead of _XXX. Otherwise, every digit press is a potential extension and you will get the delay.[/quote]

Thanks for the help everyone. I figured out a solution that I think works very well for this situation. When a caller calls into the main number, I want them to hear the main menu. They will be given options to press 1 to enter the persons extension, 2 for a company directory, 3 for sales, etc. They will not be able to simply enter the persons extension at will, they will need to enter the sub menu by pressing one first.
This allows me to use numbers 1 - 4 & 0 and there is no delay after pressing the option. Also, if a number outside of the accepted range in pressed, we go immediately to the invalid message. If the caller stays on the line past the timeout, they are taken to the operator.
After they press one for the extension, they get the opportunity to enter the users extension. It may seem like an extra step, but most people that call us don’t know who they are calling, so they will most likely listen to the menu and press the option for sales or service.

[day-menu]

;IRV Main Day
exten => s,1,Answer()
exten => s,n,Wait(0.5)
exten => s,n,Background(/var/lib/asterisk/sounds/custom/menu)
exten => s,n,WaitExten(5)

exten => 1,1,Goto(callByExtension,s,1)
exten => 1,n,Hangup()

exten => 2,1,Directory(default,users,e)
exten => 2,n,Hangup()

exten => 3,1,Goto(sales,s,1)
exten => 3,n,Hangup()

exten => 4,1,Goto(service,s,1)
exten => 4,n,Hangup()

exten => 0,1,Goto(users,111,1)
exten => 0,n,Hangup()

exten => _[56789],1,Goto(day-menu,i,1)
exten => _[56789],n,Hangup()

exten => i,1,Playback(pbx-invalid)
exten => i,n,Goto(day-menu,s,1)
exten => i,n,Hangup()

exten => t,1,Goto(users,111,1)
exten => t,n,Hangup()

[callByExtension]
exten => s,1,Answer()
exten => s,n,Wait(0.5)
exten => s,n,Background(/var/lib/asterisk/sounds/custom/menu2)
exten => s,n,WaitExten(5)

exten => _[3-9],1,Goto(callByExten,i,1)
exten => _[3-9],n,Hangup()

exten => _[12]XX,1,Goto(users,${EXTEN},1)
exten => _[12]XX,n,Hangup()

exten => i,1,Playback(pbx-invalid)
exten => i,n,Goto(day-menu,s,1)
exten => i,n,Hangup()

exten => t,1,Goto(callByExtension,s,1)
exten => t,n,Hangup()

[quote]The problem is that you have menu choices that begin with the same digit as an extension. Asterisk doesn’t know whether you are dialing an option or if you are going to dial an extension, so it waits until it times out. You should make your menu choices begin with a digit that is not the same digit as an extension.

I would also use _1XX, _2XX, and _3XX instead of _XXX. Otherwise, every digit press is a potential extension and you will get the delay.[/quote]

Thanks for the help everyone. I figured out a solution that I think works very well for this situation. When a caller calls into the main number, I want them to hear the main menu. They will be given options to press 1 to enter the persons extension, 2 for a company directory, 3 for sales, etc. They will not be able to simply enter the persons extension at will, they will need to enter the sub menu by pressing one first.
This allows me to use numbers 1 - 4 & 0 and there is no delay after pressing the option. Also, if a number outside of the accepted range in pressed, we go immediately to the invalid message. If the caller stays on the line past the timeout, they are taken to the operator.
After they press one for the extension, they get the opportunity to enter the users extension. It may seem like an extra step, but most people that call us don’t know who they are calling, so they will most likely listen to the menu and press the option for sales or service.

[day-menu]

;IRV Main Day
exten => s,1,Answer()
exten => s,n,Wait(0.5)
exten => s,n,Background(/var/lib/asterisk/sounds/custom/menu)
exten => s,n,WaitExten(5)

exten => 1,1,Goto(callByExtension,s,1)
exten => 1,n,Hangup()

exten => 2,1,Directory(default,users,e)
exten => 2,n,Hangup()

exten => 3,1,Goto(sales,s,1)
exten => 3,n,Hangup()

exten => 4,1,Goto(service,s,1)
exten => 4,n,Hangup()

exten => 0,1,Goto(users,111,1)
exten => 0,n,Hangup()

exten => _[56789],1,Goto(day-menu,i,1)
exten => _[56789],n,Hangup()

exten => i,1,Playback(pbx-invalid)
exten => i,n,Goto(day-menu,s,1)
exten => i,n,Hangup()

exten => t,1,Goto(users,111,1)
exten => t,n,Hangup()

[callByExtension]
exten => s,1,Answer()
exten => s,n,Wait(0.5)
exten => s,n,Background(/var/lib/asterisk/sounds/custom/menu2)
exten => s,n,WaitExten(5)

exten => _[3-9],1,Goto(callByExten,i,1)
exten => _[3-9],n,Hangup()

exten => _[12]XX,1,Goto(users,${EXTEN},1)
exten => _[12]XX,n,Hangup()

exten => i,1,Playback(pbx-invalid)
exten => i,n,Goto(day-menu,s,1)
exten => i,n,Hangup()

exten => t,1,Goto(callByExtension,s,1)
exten => t,n,Hangup()