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

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Jun 28 17:41:56 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17082 
====================================================================== 
Reported By:                coolmig
Assigned To:                tilghman
====================================================================== 
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-28 17:41 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.
====================================================================== 

---------------------------------------------------------------------- 
 (0123983) coolmig (reporter) - 2010-06-28 17:41
 https://issues.asterisk.org/view.php?id=17082#c123983 
---------------------------------------------------------------------- 
Hi Tilghman, I tried the new patch and the automatic preload of the engine
is made perfectly, with no need for an explicit reload, no more complains
about the engine not found. :D

I only had a small issue, on the list of types in config.h it seems like
the type 'timestamp' is not recognized. Postgresql uses timestamp instead
of MySQL's datetime.

Looking at a debugged asterisk start:

[Jun 28 15:29:44] DEBUG[17439]: res_config_pgsql.c:202
m find_table: Query of table structure complete.  Now retrieving results.
       > Found column 'id' of type 'int4'
       > Found column 'time' of type 'timestamp'
       > Found column 'callid' of type 'varchar'
       > Found column 'queuename' of type 'varchar'
       > Found column 'agent' of type 'varchar'
       > Found column 'event' of type 'varchar'
       > Found column 'data1' of type 'varchar'
       > Found column 'data2' of type 'varchar'
       > Found column 'data3' of type 'varchar'
       > Found column 'data4' of type 'varchar'
       > Found column 'data5' of type 'varchar'
[Jun 28 15:29:44] WARNING[17439]: res_config_pgsql.c:117
5 require_pgsql: Possibly unsupported column type 'timestamp' on col
umn 'time'
[Jun 28 15:29:44] DEBUG[17439]: res_config_pgsql.c:1478
 pgsql_reconnect: PostgreSQL RealTime: One or more of the parameters 
in the config does not pass our validity checks.

So I'm going to try taking away the field 'time' of the
ast_realtime_require_field to see if it works, but I think the solution
would be adding the new type to config.h and make us recognize it in
require_pgsql of res__config__pgsql.c.

I'll keep you posted, thanks again. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-06-28 17:41 coolmig        Note Added: 0123983                          
======================================================================




More information about the asterisk-bugs mailing list