For Incoming Calls, E1 Service Provider need to handle it.
For Outgoing Calls, You can still add both gateways as H323 or MGCP and insert it in the same RG with Circular Algorithm
and using Route Patterns you will route calls to destination whether it is the SIP Trunk or the H323/MGCP E1
so you will have to call flows
CUCM -- MGCP/H323 -- GW -- E1 -- PSTN
CUCM -- SIP Trunk -- CUBE -- SIP Trunk -- PBX
I hope i understood your question clearly ...
CCIE Collaboration #50401