[asterisk-dev] Logging/debug features: 3 ideas for discussion

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Mon Aug 13 20:18:15 CDT 2007

On Monday 13 August 2007, John Todd wrote:
> Channel Name Logging
> Currently when Asterisk is in verbose/debug mode on the console, the
> channel name is not printed on the line of debug.  This seems to be a

The thread ID is printed on the debug line, and that can be grepped for,
once you identify which channel is associated with which thread ID.  Channel
names are a bit less useful, since the same ID may refer to hundreds of
different calls (though not concurrently).  This is because the unique
identifier added to the end of a channel name is currently the address in
memory where the channel structure lives, and the chunk of memory for a
channel tends to get reused quite often for other channels.  Thread IDs, OTOH,
are not recycled very often.

> Timestamps
> It seems that STRFTIME (or the set of commands Asterisk uses from
> within STRFTIME) is limited to not displaying milliseconds, and this

This has been added in trunk.  The flag for fractions of a second is %q,
of which anywhere from %1q (tenths of a second) to %6q (microseconds)
are available.  The default resolution is in milliseconds (%3q or just %q).
The real issue is that in 1.4, timestamps are mostly only accurate to the
nearest second, so it's not just a matter of altering STRFTIME.

> Real-Time Activation Per-Call
> Also, while this may have slipped by me in some of the more esoteric
> functions that have been built over the last several months, but I
> don't see any way of turning on debug or verbose from within the
> dialplan, which would help quite a bit.  We have production systems

The problem with this is that right now, debug and verbose levels are
global.  There has been some discussion about making these levels
settable per-channel, but AFAIK, nothing has been done in code yet.


More information about the asterisk-dev mailing list