How to find a log of calls message a specific extension in Asterisk
asterisk
Question says it all. Trying to view a log of calls to/from an extension using Asterisk.
Thanks in advance.
Best Answer
You can find the call detail record logs by inspecting the files /etc/asterisk/cdr.conf and /etc/asterisk/cdr_custom.conf (and any local files which they include) to determine where the log files are, or whether they're enabled. You can then view the call detail records.
By default, the records will be at /var/log/asterisk/cdr-csv/Master.csv. The above files will contain hints of any changes made locally to the logging configuration.
I ended up reading the source for the handle_request_invite function from chan_sip.c mentioned in the error message. That function calls get_destination (in the same file) to resolve the destination address. If get_destination returns an error it produces the error message I was seeing.
The domain of the URI in the incoming SIP INVITE request from the DID provider is set to the IP address of my PBX, not its domain. I had allowexternaldomains disabled in sip.conf and my IP wasn't in the domain list so the destination address was being rejected. Looking at the source for get_destination it looks like that should produce an error message at debug level 1 before returning the error, but for some reason I'm not seeing it.
Adding my IP address to the domain list seems to have fixed the issue.
Best Answer
You can find the call detail record logs by inspecting the files
/etc/asterisk/cdr.conf
and/etc/asterisk/cdr_custom.conf
(and any local files which they include) to determine where the log files are, or whether they're enabled. You can then view the call detail records.By default, the records will be at
/var/log/asterisk/cdr-csv/Master.csv
. The above files will contain hints of any changes made locally to the logging configuration.