Crazy DAHDI/Analog routing best practices

Hello all, long time listener fist time caller. I’ve put several asterisk/freepbx systems in place, but I did one for an associate last night that had me pretty stumped.

I’m running piaf purple, and the piaf dahdi module on a TDM410 clone card.

So here’s the skinny…He has 4 analog lines but because he lives in the sticks we have very few options for his business voice…so AT&T is it. Here’s a run down of the lines;

G0 - ending 2334 - local calls only, inbound and outbound - MAIN #
G1 - ending 3399 - local + LD, FAX line, outbound only
G1 - ending 3948 - local + LD, Magic jack line, inbound and outbound
G2 - ending 9440 - inbound online on a distinctive ring controller, not actually an outbound line

Ok, so what I have set up so far is putting each of the dahdi channels into groups (the G# above). When I set my outbound routes I prefer not to use a “9” but for LD I had since all of the outbound lines can dial locally. So if the user presses 9+11 digits it will route to Group 1 channels. What I cant seem to get right is the roll over from Group 0 to Group 1 for local calls. All outbound 7 or 10 digit calls should be able to use group 0 or 1…but I cant seem to get that tuned in just right. Anyone have suggestions on a best practice on this convoluted set up? Unfortunately I would normally say SIP TRUNK! and tell him to ditch AT&T but unfortunately he only has 5mb DSL internet at his home office, so options are limited.