[asterisk-dev] CLI filtering

Steve Edwards asterisk.org at sedwards.com
Thu Jan 18 14:33:27 MST 2007


On Thu, 18 Jan 2007, Steven Critchfield wrote:

> 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.

The "tags" concept seems to be very workable to me. It can be added to 
the body of ast_log() first, and then added to each invocation of ast_log 
piecemeal and containing the information relevant to that section of code 
be it a literal, a channel number, or a caller id number.

It's been a while since I've played with the va_start/va_end stuff. Can 
you tell how many arguments were consumed by vfprintf (for example) and 
then handle the remaining arguments as tag pointers?

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards      sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                             Fax: +1-760-731-3000


More information about the asterisk-dev mailing list