I, invalid extension and macros

I have this in my dialplan so phones can call each other by 3 digit extension:

and the macro “staff”

[code][macro-staff]

exten => s,1,Dial(SIP/${ARG1},20,Tt)
exten => s,2,Voicemail(${ARG1},u) ; Unavailable message
exten => s,102,Voicemail(${ARG1},b) ; Busy message - Remember they can record Name, Busy, and Unavailable

include => badext

[/code]

and badext context:

[code][badext]

exten => i,1,Playback(pbx-invalid)
exten => i,2,Goto(incoming,main,1)

exten => t,1,Playback(vm-goodbye)
exten => t,2,Hangup()[/code]

[size=150]If someone dials a bad 3 digit extension they get busy signal. How can I gracefully handle this situation?[/size]

Nobody has a better way to do this or a way to catch invalid extensions?

I have been experimenting with something like this:

That seems to catch all kinds of random legitimate calls though. I thought Asterisk selected rules by choosing the most specific first…?

You may want to look at the “i” exten

I looked at it, but there was an article saying that it doesn’t work in some cases and I assume that I am one of them.

I am using the i extension in my example and it doesn’t work. The macro catches the extension and tries to dial it before i can come into play.

sorry, hehe I didnt read that far down. I have had to make each digit do something else before too, where i didnt work. but you just have to do one, then copy and paste it.

Bah, copy and paste?!?!? Are we computer scientists or what? :wink: