Most of us have been taught that off of an auto attendant, we could do something simple like ??? and transfer that to $KEY. Easy enough. However, that does NOT account for INVALID extensions. People do make mistakes, and thusly, dial the wrong things, it happens.
How do we prevent that?
1) connect your ??? off of your main menu to a GENERIC ACTION, that copies $KEY to $CP0.
2) Connect that generic action to a TEST VARIABLE (under condition actions).
2a) Make sure the variable to match is $CP0 (in this case)
3) Connect the things you want to test (extension/hg/mailbox) to a TRANSFER to $CP0
4) Connect the NO MATCH to..wherever you want in the case of a bad extension.
I have mine going to a increment and test counter that gives you 3 chances. On FALSE, it asks you to try again in another ??? menu.
If TRUE (you've had 3 chances), it transfer you to the operator. Below is a mock up of the module.