You can use the CLI command 'show risdb query sip' to check the status of SIP Trunks on Cisco Unified Communications Manager (Unified CM, CUCM).
Example:
admin:show risdb query sip
----------- SIP Information -----------
Number of SIP entries: 1
SIP Name, IPorDNS, Ipv6Addr, Description, DeviceType, ProductId, InPortNumber, OutPortNumber, InTransportType, OutTransportType, Status, RemotePeer, Size, IPorDNS, Port, PeerStatus
CMS160_secureTrunk, 192.168.100.100, , , 131, 0, 5061, 5061, 3, 3, 1, len: 1
192.168.100.110, 5061, 1,
The Status column (in red) corresponds to the "Service Status" field visible near the top of CCMAdmin's SIP Trunk page.
0 - No service (The Trunk peer is reachable via TCP, but SIP Options ping is failing)
1 - Full service (All Trunk peers are up and SIP Options ping is successful)
2 - Partial service (A subset of Trunk peers are unreachable)
3 - Unknown (The Trunk peer is unreachable via TCP, or SIP Options ping is not enabled)
The PeerStatus column (in blue) corresponds to the "Status" field for each peer on the SIP Trunk page (near the bottom).
0 - Down
1 - Up
When "PeerStatus" is 0, you can check the "Status Reason" on the SIP Trunk page, but this information is not available in the output from 'show risdb query sip'. If you want to know more about the "Status Reason" field, please check the following document.
Calls through Session Initiation Protocol (SIP) Trunk Failure
※ Please note that if the RIS Data Collector service is not running, or is not behaving correctly due to a software defect, this command may not return accurate data.