Call search

I am trying to trace outbound and inbound callls from and to the PSTN. Is Grep the best way or sed anawk. Can someone shoot me a couple of good commands strings to use?

What is the source of data you suppose apply grep/awk to?
And, anyway, as you are thinking about grep/awk then it seems that you want to work with some sort of “raw” data instead of structers that Asterisk may provide - why?

p.s. Have you read this: viewtopic.php?f=1&t=4208 ?

I am often tasked with searching for numbers called to and from the facility. With asterisk being more virtual than a real PBX, I just can’t put a T-BERD on a monitor port to trap inbound and outbound digits.

Though asterisk is “more virtual than a real”, it’s quite possible to collect all the data needed, for example, in DB.
I think CDR can provided some bits of information about incoming/outcoming calls. Next, you can set up proper logging in order to have data to work with just where you want.

Or do I still misunderstand you?

p.s. Or, I wonder, do you have access to asterisk configuration and management?

I do have cofiguration and management access but my issue is:

if I dial NPA-NXX-XXXX from my extension XXXX and the call process fails how do I look up the dialed number from that extension for troubleshooting purposes. I know grep is a good tool I just cant seem to narrow down the data when greping.

Any ideas?

First crazy idea to pipe asterisk console output and then work with it.

Second one is about logging: take a logger.conf file in /etc/asterisk and add “verbose” to “message” output to get output similar to asterisk console output (I haven’t tried this, though, because using “failed” extension - see third idea) in log files. Logs are in /var/log/asterisk/.

Third idea is to add “failed” extension to dialplan and to somehow mark failed dials. How to mark? Maybe use some dialplan possibilities or add a call to some odbc functions, or somehowelse, better to look through reference manual;

This sounds like an application for CDRs, not for the diagnostic log. Really it sounds like an application for a third party call accounting package.