PSTN passthrough on Asterisk?

One customer has such requirement: make both PSTN call and VoIP call from analog conventional phone through Asterisk.

For example, analog phone connects to digium FXS port, dial ‘0’ the call will be routed to PSTN through another FXO port on Asterisk; dial ‘9’ the call will go to IP world (SIP, IAX, etc…).

Is it possible with Digium card and Asterisk?

Yes, it is.

exten => _0.,1,Dial(ZAP/…)
exten => _1.,1,Dial(SIP/…)