on epygi FXO gateway:
1.- route all sip traffic using the call routing rules
2.- outgoing call: On the Epygi box, you need to go to Telephony-> Call Routing Table, and add a rule to send all calls to the FXO ports. it should be something like "prefix=*, call type=FXO, Any Port". In that case Elastix will send the PSTN number to Epygi box, and it will route that directly to through one of available FXO ports.
3.- for Incoming calls: FXO settings have assign a routing pattern to the FXO (in my case i give them a 656 value to all call coming on all FXO ports and on the routing rules there was one for that pattern and it will send the call to a SIP destination with out a user name and password and that will send all traffic to the Elastix box.
Using the Elastix Without Tears Installation Guide (the Epygi FXO gateway is configured as a Sipura SPA3000 as a PSTN) and for incoming call one inbound route with any DID/ any CID did the tick and it was also necessary to allow anonymous inbound SIP call on Elastix General Settings menu