Hi, this done quite easily when you've h.323 or sip to connect the GW, using-answer-address and translation-profile under the incoming DP, but if you're using MGCP I hope someone else can suggest something as I' unable to help with that.
Hope this helps, please rate post if it does!