Port status and opening is done via the ICE client communicating with the ICE servers. If no good link can be made(ICE assures of this), then the Ice Connection state will change to failed in the RTCPeerConnection.
To see what ports are to be opened and working, you can look in the SDP that is exchanged between the parties.
EDIT:
To see the ports opened due to the candidates, you will have to parse the candidates lines. Generally, you will only be using UDP candidates.
Here is an example candidate.
a=candidate:1204296370 1 udp 2122260223 192.168.0.13 49353 typ host generation 0
Candidates are of the form
a=candidate:<ID> <component Type> <transport type> <priority ranking> <ip address> <port> <type>
You can also grab initially supported ports that are grabbed locally in the media lines(I added :
m=audio<media> 49353<port> RTP/SAVPF<proto> 111 103 104 0 8 106 105 13 126 <rtpformats>
Here is more on how to parse through WebRTC SDPs