Stripping leading inbound digits

Any suggestions how I can strip off leading digits on an inbound call much like i would on an outbound call?

Some calls from an external PBX into my asterisk installs are prefixed by 99XXXX (993031), i’d like to strip off the 99 to make it easier to match the last 4 digits with my dialplans.

thanks!

two ways

in your inbound context:

exten => s,1,Set(DIALED_NUMBER=${EXTEN:2})

or just use the pattern match to match on the last 4:

exten => _1234,1,…

we use the second option as we get ANIDNIS* and it works perfectly.