1) I thought of this, but I have hundreds of DID, (around 600 at the moment) and maintaining that mapping in the dialplan would be a mess. AFTER I know what gateway the call arrived on, I have a database for each gateway that helps me process from there.
You have cases where the same DID maps differently for one gateway or another? If not, why is the gateway part of the database query?
2) Yes, separate profiles would work, but does sound gross. I'm going to swap my ports around and see if that clears things up...
-pete