It seems to me that you want to do
call hairpining over PRI B chanels but through a Call Manager.
This is not possible with only one PRI to call manager because;
1. MGCP gateway digital interface can only be seen as one route in the route group
on the call manager i.e CCM can span mutliple PRI's but not channels in a PRI so haipinng is not possible over the same PRI.
2. H323 gateways are seen as on route and the T1 channels to are not visible for span by CCM.
Options available would be .
1. Let CCM control both pri's from AS5300 via mgcp
2.Have all call to pstn go through the CCM to PRI 1 or 2
based on your route-pattern, filer and route groups.
3. You can also control all pbx PRI connection to the CCM through one extra T1 port
on the as5300 via mgcp.
All call incoming or outgoing will now flow through the call manager and
you can get your CDR records.