For FXS gateways, connect an analog phone to the FXS port, dial the number *158#, and you will hear the LAN port IP.
For FXO gateways, connect a PSTN line to the FXO port, dial the PSTN line number from your mobile phone, press '*158#' when you hear the IVR, then dial the extension number, and you will hear the LAN port IP.
Note: If the FXO gateway is set to auto dial, this method will not work.
To debug calls or voice problems, you can go to web page 'Call Control->Diagnostics' page. And select debug logs whatever you want.
SIP Stack: logs of SIP stack.
SIP Message: logs of SIP message like Register, INVITE request etc.
FXS/FXO: logs of FXS or FXO port
GSM: logs of GSM modules
DSP: capture PCM packets.
Voice: SIP and RTP capture, you can open the capture by Wireshark program.