Dial extension upfront before ringing

Is it possible to configure an asterisk dialplan to execute the following:

xxx-xxx-xxxx goes to [context_general]

xxx-xxx-xxxx1 goes to [context_1]

xxx-xxx-xxxx2 goes to [context_2]

Note that I would like to avoid a recorded menu. The caller should dial
the general number (provided by the SIP provider) followed by a digit before
dialing. I guess that this would require the SIP provider to pass
additional info to asterisk when setting up the call. It may sound
outrageous, but I remember that Austrian POTS in the 1980s would do

There is no problem in doing it from the Asterisk point of view.