If you hope to connect elastix with FXO gateway, and FXO registers to elastix, you can refer to the file:http://blog.voptech.com/configuring-voptech-vg-gateway-for-elastix/
But if you hope to realize the function like this:
Extension 7001 just can call out through FXO 1, and any calls from FXO 1 will make 7001 ring directly;
Extension 7002 just can call out through FXO 2, and any calls from FXO 2 will go to IVR.
You can refer to the below suggestions:
In the elastix side:
1. you can edit the trunk VOPTechVG, we need to delete the outbound caller ID:
2. in the inbound route, we need to create one new rule:
when elastix receives the call, and its DID is 887, the call will go to the extension 7001.
In the gateway side:
1. you can change the routing like this:
so any calls from 7001 will go out through the FXO 1;
any calls from 7002 will go out through the FXO 2.
2. In the FXO 1, you can use 887 as the binding number.
so that when you dial the PSTN line of FXO 1, the gateway will send the number 887 to elastix.
in the FXO 2, we donot change anything, and just keep it default.