I think the easiest way to do this would be to use the router you terminate the SIP trunk on as an IP to IP gateway. SIP on one side and H.323 on the other.
You could probably get the Telco to use G.729 instead of G.711 for a codec and eliminate the need for the XCODE.
you should be able to use the 2821 for transcoding,
The Gateway you set up for connecting to the 2821 can be in its own device pool/Region. as long as you are using an XCODE media resource from the 2821 for the region the router will be used for the codec transcoding.
Good Luck.