This is fairly easy. Let's say you have an access code of 9 followed by 10 digits for all calls.
dial-peer voice 1 voip
description to pbx
session protocol sip
destination-pattern 9..........
codec g711ulaw
no vad
dtmf-relay rtp-nte
preference 0 (default)
dial-peer voice 2 pots
destination-pattern 9..........
port 0/0/0:15
preference 1
If you leave out the preference, these will have the same destination pattern and the gateway will load balance between them by default. By putting a higher preference value on the POTS dial peer it will not be routed to unless the first dial peer fails.
hth,
nick