summaryrefslogtreecommitdiff
path: root/cel/cel_tds.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2012-02-01 17:42:15 +0000
committerRichard Mudgett <rmudgett@digium.com>2012-02-01 17:42:15 +0000
commit797d633139a52a87736c04b71e31b1cb66e21e08 (patch)
treeed8848795a995d9e2986bdd30a867d1a8f3b7044 /cel/cel_tds.c
parenta99b3c817baf50cf4edc70e991c0395c3d6d0311 (diff)
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
Diffstat (limited to 'cel/cel_tds.c')
-rw-r--r--cel/cel_tds.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/cel/cel_tds.c b/cel/cel_tds.c
index f5686c9b0..df2b573bf 100644
--- a/cel/cel_tds.c
+++ b/cel/cel_tds.c
@@ -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) {