I think you need to state your question a little more clearly. A couple of gateways between the two switches will allow you to transport between the two switches but probably is not the most efficient way to use IP.
When thinking of VoIP a class based architecture loses some of its meaning as packet based voice does not need some of the same mechanisms. i.e. If I have to LEC switches connected to each other via IP and allow voice traffic over this connection I do not have to send the traffic to the tandem office. This is what most carriers initially targeted. Bypassing Tandem switches and other IXC carriers allowed folks to make money by keeping most of the money rather than paying it to the IXC.