How to get a Call Log from Asterisk CLI?

When troubleshooting Asterisk, obtaining a call log is essential to analyze the specific routes, trunks, and inbound routes a call utilizes. To retrieve this information, use the following command. Ensure you execute this command prior to initiating the outbound or incoming call. Replace “DIALED-NUMBER” in the command with the actual dialed number or DID (Direct Inward Dialing) you wish to filter.

tail -f -n 50 /var/log/asterisk/full | grep "DIALED-NUMBER"