[asterisk-dev] CLI filtering
Steven Critchfield
critch at basesys.com
Thu Jan 18 13:06:17 MST 2007
On Thu, 2007-01-18 at 12:54 -0500, Clod Patry wrote:
> Im aware that all ast_log and ast_verbose will have to receive a
> pointer to the ast_channel.
It just occurred to me that not all messages are channel related. For
instance, messages of startup and shutdown have no channels. Messages
about .call files won't have a channel until there is a dial made.
Registrations of IAX, SIP, and other VoIP devices/services don't have a
channel.
Maybe go a different route, maybe try "tagging" log events. Say each
call to ast_log would have an extra arg which is an array of tags for
which we can filter on. In those tags, we can place any number of
interesting information such as channel, callerid, IP address, system
name, or subsystem generated from. Then you could just do a quick check
against the tags to see if it is one you want to exclude or include for
the filtered list.
I don't know what the performance hit would be like for this way of
doing it. But the programming effort wouldn't be too much. A few lines
in ast_log to accept extra arg for tags, code to look for and deal with
tags. Of course then the going through all the ast_log calls and adding
the tags will be a bit of a chore though.
--
Steven Critchfield <critch at basesys.com>
More information about the asterisk-dev
mailing list