[asterisk-bugs] [Asterisk 0017082]: [patch] Improve realtime queue logging

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Jun 25 17:15:16 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17082 
====================================================================== 
Reported By:                coolmig
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   17082
Category:                   Applications/app_queue
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     ready for testing
Asterisk Version:           SVN 
JIRA:                       SWP-1164 
Regression:                 No 
Reviewboard Link:           https://reviewboard.asterisk.org/r/731/ 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-03-23 11:06 CDT
Last Modified:              2010-06-25 17:15 CDT
====================================================================== 
Summary:                    [patch] Improve realtime queue logging
Description: 
I was playing with the RT queue log functionality, and found this
limitations:

1. If you choose RT queue logging, you won't have the traditional plain
text file file log. This file is very useful for backup purposes.
2. The column 'data' stores all the parameters separated by '|', which is
not the best way to store it.

I managed to program a patch which overcomes this limitations, and works
this way:

1. If you enable RT queue logging, the queue log will still be logged in
the plain text file, so you have some backup in case of some database
disaster.
2. The parameters are now "exploded", and put in separate fields for each
one. The only thing here is that this code must be changed in case that
some queue log event delivers more than 4 parameters (the only event that
gives 4 parameters is TRANSFER).
3. The calldate is now stored just like the CDR, with a full datetime.
4. The plain text file is left as is, for compatibility purposes.
5. The fieldnames on the table changed a little.
====================================================================== 

---------------------------------------------------------------------- 
 (0123919) coolmig (reporter) - 2010-06-25 17:15
 https://issues.asterisk.org/view.php?id=17082#c123919 
---------------------------------------------------------------------- 
Hi Tilghman, I'm testing your patch in trunk, thanks for your this better
version of the idea.

On the tests I made, it seems like the field checks can't be done because
the logger is always loaded before the realtime engine, even if I preload
the engine in modules.conf. Looking at the asterisk start with
res_config_pgsql.so preloaded:

  == Parsing '/etc/asterisk/asterisk.conf':   == Found
  == Parsing '/etc/asterisk/extconfig.conf':   == Found
  == Binding queue_log to pgsql/bd_general_tests/queue_log
  == Parsing '/etc/asterisk/logger.conf':   == Found
[Jun 25 15:01:58] WARNING[7484]: config.c:2040 
find_engine: Realtime mapping for 'queue_log' found to engine 'pgsql', but
th
e engine is not available
[Jun 25 15:01:58] WARNING[7484]: config.c:2040 
find_engine: Realtime mapping for 'queue_log' found to engine 'pgsql', but
th
e engine is not available
[Jun 25 15:01:58] WARNING[7484]: config.c:2040 
find_engine: Realtime mapping for 'queue_log' found to engine 'pgsql', but
th
e engine is not available
  == Parsing '/etc/asterisk/asterisk.conf':   == Found
  == Manager registered action DataGet
  == Parsing '/etc/asterisk/codecs.conf':   == Found
 Asterisk Dynamic Loader Starting:
  == Parsing '/etc/asterisk/modules.conf':   == Found
[Jun 25 15:01:58] NOTICE[7484]: loader.c:1096 l
oad_modules: 1 modules will be loaded.
  == Parsing '/etc/asterisk/res_pgsql.conf':   == Found
  == PostgreSQL RealTime reloaded.
[Jun 25 15:01:58] NOTICE[7484]: config.c:1983 a
st_config_engine_register: Registered Config Engine pgsql
 PostgreSQL RealTime driver loaded.
 res_config_pgsql.so => (PostgreSQL RealTime Configuration Driver
)
  == Parsing '/etc/asterisk/dnsmgr.conf':   == Found
  == Parsing '/etc/asterisk/http.conf':   == Found

If the field check fails it will default to the normal behavior where the
data field is saved as only one, and setting up the table with "data" field
instead of the 5 ones results in a correct save of the info. So with this
condition I can't enable the improved realtime logging. Please correct me
if I'm wrong.

One question, the field check asks for exactly 20 characters for each
field or they can be larger? On certain events where channel names are
stored this size could be too small. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-06-25 17:15 coolmig        Note Added: 0123919                          
======================================================================




More information about the asterisk-bugs mailing list