summaryrefslogtreecommitdiff
path: root/cdr/cdr_adaptive_odbc.c
AgeCommit message (Collapse)Author
2018-03-06BuildSystem: Depend not implicitly but explicitly on external libraries.Alexander Traud
ASTERISK-27722 Change-Id: Ie7b8c30d86cb00a54d6ac4e09e6f28f42d2bd52c
2017-12-22Remove as much trailing whitespace as possible.Sean Bright
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2016-10-27Remove ASTERISK_REGISTER_FILE.Corey Farrell
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes all traces of it. Previously exported symbols removed: * __ast_register_file * __ast_unregister_file * ast_complete_source_filename This also removes the mtx_prof static variable that was declared when MTX_PROFILE was enabled. This variable was only used in lock.c so it is now initialized in that file only. ASTERISK-26480 #close Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2016-08-05cdr_adaptive_odbc: Fix DNSs mixed config quote quoted_identifiersRodrigo Ramírez Norambuena
When haved more than once DNSs config and one of their dont set quoted_identifiers and before this is with configurated with quoted_identifiers resulting a truncate statement for a reference null for quote character identifier. This patch initializes quoted flag before build SQL Query Example config for this bugfix case in cdr_adaptive_odbc.conf file [first] connection=asterisk-server1 table=cdr quoted_identifiers=" [second] connection=asterisk-server2 table=cdr [third] connection=asterisk-server3 table=cdr quoted_identifiers=` Change-Id: Ibd95667b468e10d4a19a2b9d88b9934ec7207e1d
2015-09-18dr_adaptive_odbc.c, cel_odbc.c, cel_pgsql.c: REFACTOR Macro LENGTHEN_BUFRodrigo Ramírez Norambuena
Remove repeated code on macro of assigned buffer to SQL vars Change-Id: Icb19ad013124498e172ea1d0b29ccd0ed17deef0
2015-07-20cdr/cdr_adaptive_odbc.c: Fix quoted identifier usage when inserting CDR recordsElazar Broad
Commit a24ce38 added support for the use of quoted indentifiers when inserting CDR records into the database. However, the if statement logic responsible for determining whether to use those identifiers is reversed, resulting in a reference to the quoted identifier character buffer which will be null, hence null terminating the SQL query, resulting in a truncated statement which fails to execute. ASTERISK-25263 #close Reported by: Elazar Broad Tested by: Elazar Broad Change-Id: I40da47309b67cc1572207b1515dcc08ec9b1f644
2015-05-20cel, cdr: Assigned separator for column name and values.Rodrigo Ramírez Norambuena
Use a separator string between column names and values for SQL sentences instead of evaluating the separator to use each time. This change adds a space after the comma in constructing SQL sentences. Before the SQL was created like "INSERT INTO cdr(calldate,clid,dst" without spaces between column name and values. The files applied this change are cdr/cdr_adaptive_odbc.c, cdr/cdr_pgsql.c, cel/cel_odbc.c ASTERISK-25109 #close Reported By: Rodrigo Ramírez Norambuena <decipher.hk@gmail.com> Change-Id: Ia5a1a161f5e26e1643703b30f8cc9cf0860cc7ea
2015-05-05cdr_adaptive_odbc: Add ability to set character for quoted identifiers.Rodrigo Ramírez Norambuena
Added the ability to set the character to quote identifiers. This allows adding the character at the start and end of table and column names. This setting is configurable for cdr_adaptive_odbc via the quoted_identifiers in configuration file cdr_adaptive_odbc.conf. ASTERISK-25006 Change-Id: I0b9a56b79ca13a727a803d88ed3b8643e37632b8
2015-04-20cdr/cdr_adaptive_odbc.c: Refactor concatenate columns name.Rodrigo Ramírez Norambuena
The concatenate for columns name to INSERT INTO is always the same. It is possible to do it on one line. ASTERISK-24980 Change-Id: Ib8bb53c42535378581d4ef729cc5ebbb22b067ac
2015-04-13git migration: Refactor the ASTERISK_FILE_VERSION macroMatt Jordan
Git does not support the ability to replace a token with a version string during check-in. While it does have support for replacing a token on clone, this is somewhat sub-optimal: the token is replaced with the object hash, which is not particularly easy for human consumption. What's more, in practice, the source file version was often not terribly useful. Generally, when triaging bugs, the overall version of Asterisk is far more useful than an individual SVN version of a file. As a result, this patch removes Asterisk's support for showing source file versions. Specifically, it does the following: * Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and remove passing the version in with the macro. Other facilities than 'core show file version' make use of the file names, such as setting a debug level only on a specific file. As such, the act of registering source files with the Asterisk core still has use. The macro rename now reflects the new macro purpose. * main/asterisk: - Refactor the file_version structure to reflect that it no longer tracks a version field. - Remove the "core show file version" CLI command. Without the file version, it is no longer useful. - Remove the ast_file_version_find function. The file version is no longer tracked. - Rename ast_register_file_version/ast_unregister_file_version to ast_register_file/ast_unregister_file, respectively. * main/manager: Remove value from the Version key of the ModuleCheck Action. The actual key itself has not been removed, as doing so would absolutely constitute a backwards incompatible change. However, since the file version is no longer tracked, there is no need to attempt to include it in the Version key. * UPGRADE: Add notes for: - Modification to the ModuleCheck AMI Action - Removal of the "core show file version" CLI command Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
2014-07-25Add module support level to ast_module_info structure. Print it in CLI ↵Mark Michelson
"module show" . ASTERISK-23919 #close Reported by Malcolm Davenport Review: https://reviewboard.asterisk.org/r/3802 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-28Logger/CLI/etc.: Fix some aesthetic issues; reduce chatty verbose messagesMatthew Jordan
This patch addresses some aesthetic issues in Asterisk. These are all just minor tweaks to improve the look of the CLI when used in a variety of settings. Specifically: * A number of chatty verbose messages were removed or demoted to DEBUG messages. Verbose messages with a verbosity level of 5 or higher were - if kept as verbose messages - demoted to level 4. Several messages that were emitted at verbose level 3 were demoted to 4, as announcement of dialplan applications being executed occur at level 3 (and so the effects of those applications should generally be less). * Some verbose messages that only appear when their respective 'debug' options are enabled were bumped up to always be displayed. * Prefix/timestamping of verbose messages were moved to the verboser handlers. This was done to prevent duplication of prefixes when the timestamp option (-T) is used with the CLI. * Verbose magic is removed from messages before being emitted to non-verboser handlers. This prevents the magic in multi-line verbose messages (such as SIP debug traces or the output of DumpChan) from being written to files. * _Slightly_ better support for the "light background" option (-W) was added. This includes using ast_term_quit in the output of XML documentation help, as well as changing the "Asterisk Ready" prompt to bright green on the default background (which stands a better chance of being displayed properly than bright white). Review: https://reviewboard.asterisk.org/r/3547/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-09Allow Asterisk to compile under GCC 4.10Kinsey Moore
This resolves a large number of compiler warnings from GCC 4.10 which cause the build to fail under dev mode. The vast majority are signed/unsigned mismatches in printf-style format strings. ........ Merged revisions 413586 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413587 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413588 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-27Prevent CDR backends from unregistering while billing data is in flightMatthew Jordan
This patch makes it so that CDR backends cannot be unregistered while active CDR records exist. This helps to prevent billing data from being lost during restarts and shutdowns. Review: https://reviewboard.asterisk.org/r/2880/ ........ Merged revisions 402081 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-23cdr_adaptive_odbc: Also apply a filter when the CDR value is empty.Richard Mudgett
Extra CDR records are written if a filtered CDR value is empty because the filter is not checked. (closes issue ASTERISK-22272) Reported by: Jordi Llull Chavarria ........ Merged revisions 401577 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401579 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 401581 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-17Update Asterisk's CDRs for the new bridging frameworkMatthew Jordan
This patch is the initial push to update Asterisk's CDR engine for the new bridging framework. This patch guts the existing CDR engine and builds the new on top of messages coming across Stasis. As changes in channel state and bridge state are detected, CDRs are built and dispatched accordingly. This fundamentally changes CDRs in a few ways. (1) CDRs are now *very* reflective of the actual state of channels and bridges. This means CDRs track well with what an actual channel is doing - which is useful in transfer scenarios (which were previously difficult to pin down). It does, however, mean that CDRs cannot be 'fooled'. Previous behavior in Asterisk allowed for CDR applications, channels, and other properties to be spoofed in parts of the code - this no longer works. (2) CDRs have defined behavior in multi-party scenarios. This behavior will not be what everyone wants, but it is a defined behavior and as such, it is predictable. (3) The CDR manipulation functions and applications have been overhauled. Major changes have been made to ResetCDR and ForkCDR in particular. Many of the options for these two applications no longer made any sense with the new framework and the (slightly) more immutable nature of CDRs. There are a plethora of other changes. For a full description of CDR behavior, see the CDR specification on the Asterisk wiki. (closes issue ASTERISK-21196) Review: https://reviewboard.asterisk.org/r/2486/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-14Doxygen Updates - Title updateAndrew Latham
Update and extend the configuration_file group and enable linking. Update title that was left behind many years ago. (issue ASTERISK-20259) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375005 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-28Fix setting CDR variables in the hangup extensionTerry Wilson
A previous CDR fix for setting CDR variables during a bridge via custom dialplan features broke setting CDR variables in the hangup extension. This patch fixes the issue. Review: https://reviewboard.asterisk.org/r/1794/ ........ Merged revisions 358978 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 358989 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360724 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-07Add detection for ODBC WCHAR fieldsTerry Wilson
Without detecting these types, cel_odbc blows up when the character set for the table is utf8. This also wraps cdr_adaptive_odbc's use of those types in the HAVE_ODBC_WCHAR #ifdef seen in other parts of the code. ........ Merged revisions 358435 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 358436 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358437 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-28Add additional character type types to supported data types for ↵Jonathan Rose
cdr_adaptive_odbc The reporter was uable to use varchar utf8_unicode_ci with cdr_adaptive_odbc, so this patch adds those along with some other character types to the list of types cdr_adaptive_odbc will work using the varchar conditions. The problem wasn't really UTF8 characters as much as it was a failure to respond to the exact type that was declared/in use on that database. (closes issue ASTERISK-19334) Reported By: Igor Nikolaev Patches: cdr_adaptive_odbc.patch uploaded by Igor Nikolaev (license 6236) ........ Merged revisions 357455 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 357458 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357460 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-03Support schema selection in cdr_adaptive_odbcKinsey Moore
Asterisk now supports using ODBC with databases where a single schema must be selected. Previously, INSERTs would fail because they did not take into account extra fields cause by having multiple schemas. This also corrects some SQL resource leaks. (closes issue ASTERISK-17106) Patch-by: Alexander Frolkin Patch-by: Tilgnman Lesher git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353964 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14Merged revisions 328247 via svnmerge from Leif Madsen
https://origsvn.digium.com/svn/asterisk/branches/1.10 ................ r328247 | lmadsen | 2011-07-14 16:25:31 -0400 (Thu, 14 Jul 2011) | 14 lines Merged revisions 328209 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r328209 | lmadsen | 2011-07-14 16:13:06 -0400 (Thu, 14 Jul 2011) | 6 lines Introduce <support_level> tags in MODULEINFO. This change introduces MODULEINFO into many modules in Asterisk in order to show the community support level for those modules. This is used by changes committed to menuselect by Russell Bryant recently (r917 in menuselect). More information about the support level types and what they mean is available on the wiki at https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-31Support negative filters.Tilghman Lesher
(closes issue #17979) Reported by: tilghman Patches: 20100911__for_blitzrage.diff.txt uploaded by tilghman (license 14) Tested by: lmadsen git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@300045 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-23Merged revisions 283319 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r283319 | tilghman | 2010-08-23 16:33:47 -0500 (Mon, 23 Aug 2010) | 9 lines Merged revisions 283318 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r283318 | tilghman | 2010-08-23 16:32:14 -0500 (Mon, 23 Aug 2010) | 2 lines CDR drivers depend upon res_odbc, not directly on the ODBC libraries ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@283320 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-20Add load priority order, such that preload becomes unnecessary in most casesTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-08Add High Resolution Times to CDRs for AsteriskBradley Latus
People expressed an interest in having access to the exact length of calls to a finer degree than seconds. See the CHANGES and UPGRADE.txt for usage also updated the sample configs to note the change. Patch by snuffy. (closes issue #16559) Reported by: cianmaher Tested by: cianmaher, snuffy Review: https://reviewboard.asterisk.org/r/461/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269153 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-26formatting tweaks and constificationRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-30When the field is blank, don't warn about the field being unable to be ↵Tilghman Lesher
coerced, just skip the column. (closes http://lists.digium.com/pipermail/asterisk-dev/2009-December/041362.html) Reported by Nic Colledge on the -dev list, fixed by me. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@236847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10AST-2009-005Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-20Remove unnecessary usleep() from a couple of module unload callbacks.Russell Bryant
In passing, also tweak cdr_unregister() to hold the list lock a bit less time. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202109 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21Const-ify the world (or at least a good part of it)Kevin P. Fleming
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes: - CLI command handlers - CLI command handler arguments - AGI command handlers - AGI command handler arguments - Dialplan application handler arguments - Speech engine API function arguments In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing. Review: https://reviewboard.asterisk.org/r/251/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-15remove the PBX_ODBC logic from the configure script, and add GENERIC_ODCB ↵Kevin P. Fleming
logic that includes copying the relevant LIB and INCLUDE data from either UnixODBC or iODBC, based on which was found; if both were found, prefer UnixODBC this stops modules from being linked against both sets of libraries on systems that have both installed git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-13Merge ast_str_opaque branch (discontinue usage of ast_str internals)Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20Begin on a crusade to end trailing whitespace!Terry Wilson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@158072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-19Fix checking for CONFIG_STATUS_FILEINVALID so that modules don't crash upon ↵Terry Wilson
trying to parse an invalid config git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-14Allow setting static values in CDRsTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-04improve configure script to remember the previous value of each dependency ↵Kevin P. Fleming
in build_tools/menuselect-deps, so that (once it has been written) menuselect can use this information to warn the user when a previously met dependency is no longer met along the way, change tags used in configure script, menuselect-deps and code for various dependencies to be consistently named git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@154151 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-08Keep up with shadow warnings. One day I'll actually enable this in the ↵Sean Bright
Makefile. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@147457 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-06All ODBC parts can now use either unixodbc or iodbc.Michiel van Baak
This allows for the ODBC parts to work on OpenBSD as well. 99.99% of the work is done by seanbright (bow, bow) and I actually did nothing but test and yell at him that it still didn't work :) Thanks for helping out ! git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@146925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12Build under dev-modeSean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-11Add usegmtime, as per the recent -users list discussion, and also add myTilghman Lesher
explanation to the file, since that additional text helps people understand the concept. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-07More from the resolve-shadow-warnings branch. This time the cdr/ directory.Sean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@136300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-29Convert to use ast_strTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105411 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-17Change the way the new filter feature works, by allowing it to be a column NOTTilghman Lesher
logged into the database. This will allow more granularity of a decision evaluated in the dialplan, then takes effect when posting the CDR. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@98987 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-15Add the "filter" keywordTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@98947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-11Port Nick Gorham's timestamp patch to adaptive_odbc, tooTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@98269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-13Don't use backslash as an escape character, unless it really is an escape ↵Tilghman Lesher
character. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21remove another set of redundant #include "asterisk/options.h"Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19another bunch of include removals (errno.h and asterisk/logger.h)Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16Start untangling header inclusion in a way that does not affectLuigi Rizzo
build times - tested, there is no measureable difference before and after this commit. In this change: use asterisk/compat.h to include a small set of system headers: inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h, stdlib.h, alloca.h, stdio.h Where available, the inclusion is conditional on HAVE_FOO_H as determined by autoconf. Normally, source files should not include any of the above system headers, and instead use either "asterisk.h" or "asterisk/compat.h" which does it better. For the time being I have left alone second-level directories (main/db1-ast, etc.). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3