After configuring audiocodes to work with asterisk, one thing need to be done properly, to make audiocodes just route the ip call to PSTN the way asterisk want it.
on my case here, I have my asterisk adding prefix 011 and 012 before sending it to any FXO gateway attached to my asterisk, the problem is audiocodes by default will use hunting system and use any available FXO to make a call, which I dont want it to be happen as every port is attached to different provider and I want the call to be routed properly to save the cost (and cost calculation is done on asterisk).
two configurations need to be done on audiocodes for this case :
1. Protocol Management -> Manipulation Tables -> IP Tel Destination Numbers, below is the screen shot.
2. Protocol Management -> Routing Tables -> IP to Hunt Group routing, below is the screen shot.
by looking at both screen shot above, we will get the idea easily.