Two fundamental aspects which you should verify regarding the registration of an MGCP endpoint:-
Firstly always ensure that the hostname configured on the IOS gateway is exactly the same as the name you configured the MGCP endpoint as within CCM.
For example, IOS hostame is VG1 and IOS ip domain-name is domain.com, then the actual MGCP name should be configured as VG1.domain.com
Secondly if the gateway is configured correctly, such that the configuration is downloaded from CallManager and the controller, serial interface and voice port have been appropriately configured. Then verify the ISDN status 'show isdn status', is the status showing TEI_Assigned, if this is the case then this is the immediate cause for the gateway not registering and you need to raise the issue with your telco.
In order to successfully register the L2 status should indicated Multiple_Frame_Established, and the D-Channel can backhaul to CCM.
These are the paths to get to each CCX logs through CLI. They may be helpful if you are having issues accessing RTMT or downloading logs through it.
If you want to download them you have to prefix "file get " and you can add one of the options (re...