OK. This might take me a bit to explain.
There's probably an easier way to do this. I tend to overthink things.
I'll base this example on the NPA dialing plan since I don't know the South African dial plan.
1: Create a loop back trunk.
2: program an ARS route that uses that trunk group. Set up the Digit mod to absorb 1 and insert the extensions account code "<a>".
example account code: 9999
3: Set up your outbound ARS to use 9999+1+10 digits. Absorb 4 digits. Do this for each outbound trunk group you need. Use different ARS access codes. 9999, 9998,9997, etc.
4: assign default account codes to each phone. The account code will need to match whatever ARS trunk group they need to use.
5: How it works:
a: when the user dials 9 the call is routed through the loopback trunk group.
b: the digit mod table absorbs the 9 and inserts the account code.
c: The system now sees the call as 9999+<11 digits>
d: The call is now routed out the trunk group based on ARS digits dialed. 9999+<11 digits> is now routed out the trunk group you need it to.
Ralph