[asterisk-users] Patch to remove numbers from the logs

Dovid Bender dovid at telecurve.com
Thu Jul 8 16:57:31 CDT 2021


We have a project where people will be making payments over the phone. I
would like block Asterisk from logging any time the system is processing a
card. So be it SayDigits(123456789), when the user enters DTMF or when I
pass a card number as a variable to an AGI etc. I assume this affects
others and I would like to have the patch created in a way that a. will be
accepted by Sangoma and b. will work for anyone else that has this issue.
My idea was to have a channel variable
for exampleSet(CHANNEL(LOG_DIGITS)=OFF) and then have ast_logger check to
see if the variable is set. The problem I faced that wherever the logger is
called a string is passed. So any digits (e.g. channel ID, thread ID etc.)
would have the digits removed which I assume would hurt people. My solution
was to have a configuration file where you would put in regex strings that
we would replace. For instance if I set LOG_DIGITS=OFF and in the Dialplan
I had

In the configuration file I would have

The system would then look for any of the above expressions and then
replace the numbers with an X. Does that seem like a patch that would get
accepted? is that completely in left field? Any thoughts on a better way of
doing it? I know I can change the verbosity to 0 but then I would get
nothing at all in the logs.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20210708/35c2c1c9/attachment.html>

More information about the asterisk-users mailing list