i do not think you can do prefix rerite on the IOS GK unless you doing nne standar eup like you configure the same router to be a GK and GW and then once the call sent to the local regisered GW you can change the digits
but again in your case can you chnage it on the receving GW in the inbound direction if yes this will be easier !!
again not 100% sure
you may try GK with coexisting CUBE
example:
voice service voip
allow-connections h323 to h323
!
interface Loopback0
ip address 17.x.x.1 255.255.255.255
h323-gateway voip interface
h323-gateway voip id ZoneHQ ipaddr 17.x.x.1 1719
h323-gateway voip h323-id CUBE
h323-gateway voip bind srcaddr 17.x.x.1
gatekeeper
zone local ZoneHQ domain.com 17.x.x.1 outvia ZoneHQ <--- The "outvia" argument
zone remote Zone1 domain.com 17.x.x.3 1719 outvia ZoneHQ
zone prefix ZoneHQ 1...
zone prefix Zone1 2...
no shutdown
The "outvia" argument causes GK to process calls through the CUBE when going TO a particular destination zone.
Inbound DP when calling from CUCM, Outbound when calling to CUCM
dial-peer voice 101 voip
destination-pattern 1...$ <--- Matches DNIS to one side on outbound calls, ANI from otherside on inbound calls
voice-class h323 1
session target ras
dtmf-relay h245-signal
in these dial-peers you can change the digits and see if its gonna meet your requirments or not
have a look at the bellow link for more detail about GK wiht IPtoIPGW CUBE