Selecting SPA400 outbound port

Do you know if is possible to configure this scenario?

Using 2 SPA400 boxes and using 5 of 8 their possible PSTN lines. Routing wanted to be defined:

· Calls with a destination phone number starting in 7 must be routed to Port 1 (SPA400 1). If Port 1 is busy, then routed to Port 2.
· Calls with a destination phone number starting in 6 must be routed to Port 3, if busy, then to Port 4, if busy then must be routed to Port 5 (second SPA400)

Do you think is possible? I don’t know if SPA400 lets you select outbound port.
Regards