Remove inconsistency in CEL eventtype for user defined events.

The CEL eventtype field for ODBC and PGSQL backends should be USER_DEFINED
instead of the user defined event name supplied by the CELGenUserEvent
application.  If the field is output as a number, the user defined name
does not have a value and is always output as 21 for USER_DEFINED and the
userdeftype field would be required to supply the user defined name.

The following CEL backends (cel_odbc, cel_pgsql, cel_custom, cel_manager,
and cel_sqlite3_custom) can be independently configured to remove this
inconsistency.

* Allows cel_manager, cel_custom, and cel_sqlite3_custom to behave the
same way.

(closes issue ASTERISK-17189)
Reported by: Bryant Zimmerman

Review: https://reviewboard.asterisk.org/r/1669/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353648 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2012-02-01 17:42:15 +00:00
parent a99b3c817b
commit 797d633139
10 changed files with 119 additions and 23 deletions

View File

@@ -19,17 +19,17 @@
* \brief FreeTDS CEL logger
*
* See also
* \arg \ref Config_cdr
* \arg \ref Config_cel
* \arg http://www.freetds.org/
* \ingroup cdr_drivers
* \ingroup cel_drivers
*/
/*! \verbatim
*
* Table Structure for `cdr`
* Table Structure for `cel`
*
CREATE TABLE [dbo].[cdr] (
CREATE TABLE [dbo].[cel] (
[accountcode] [varchar] (20) NULL ,
[cidname] [varchar] (80) NULL ,
[cidnum] [varchar] (80) NULL ,
@@ -204,7 +204,9 @@ retry:
")",
settings->table, accountcode_ai, clidnum_ai, clid_ai, cidani_ai, cidrdnis_ai,
ciddnid_ai, exten_ai, context_ai, channel_ai, app_ai, appdata_ai, start,
record.event_name, ast_cel_get_ama_flag_name(record.amaflag), uniqueid_ai, linkedid_ai,
(record.event_type == AST_CEL_USER_DEFINED)
? record.user_defined_name : record.event_name,
ast_cel_get_ama_flag_name(record.amaflag), uniqueid_ai, linkedid_ai,
userfield_ai, peer_ai);
if (erc == FAIL) {