I have the same setup. Gateways that keep changing I.P. addresses every few hours.
All what you need is a gatekeeper, on a public fix I.P. for all the gateways to register with.
Then, the gatekeeper will keep a running list of the I.P. of the gateways,refrehing every few minutes (time to live).
I works great, and after a while,you do not even know where your gateways are at. All what you care is that you dial and the call goes trought.