Asterisk CDR not logging dialed number - War dialing

Hi I’m getting a lot of calls hitting my asterisk server and because they do not match anything they hit the “i” extension.

Is it possible to capture which number they were actually dialing so I can find out whats going on?

I have no idea if they keep dialing the same number or are war dialing.

How can I log the original dialed number and not “i” in the CDR record?


Use _X. rather than i, or enable the channel driver logging, or use channel driver specific options of ${CHANNEL()}.

Thanks for the ideas.

If I used _X. this will match any unmatched inbound call and I assume will answer the call even if the dialplan puts it direct to hangup. Is this correct? I may incur some costs for answering an incoming call depending on what numbers are actually being dialed which is why I am hesitant on using this dialplan idea.

I’m not sure I understand the channel driver logging idea. Is this set in the logging.conf file? I assume this will log to a separate log file rather than to mysql cdr.

Is the idea to set a custom cdr field with ${CHANNEL()}.? does ${CHANNEL()}. show the dialed number?


Calls are only answered if you use a dialplan action that answers calls. Answer and, with the default options, Playback, will answer immediately. Most other actions will not answer the call. (Whilst many people seem to call Answer before DIal, it is not necessary and Dial will not answer unless and until the called party answers.

Explicitly calling hangup is only necessary if you want to send a clearing cause other than the default for what has happened so far in the call, although it can be more convenient than leaving a gap in the priority numbers. In most cases, you can’t send a custom clearing cause if you have already answered the call.

Channel driver logging is enabled by CLI command or options in the channel driver configuration file. Details depend on the channel driver and you have not identified that. Example channel driers are dahdi, SIP, PJSIP, and IAX, although there are many others. Channel driver logs typically goes to the debug logging channel, as configured in logger.conf.