summaryrefslogtreecommitdiff
path: root/cdr/cdr_pgsql.c
AgeCommit message (Collapse)Author
2015-05-12cdr_pgsql: Use PQescapeStringConn for escaping names.Rodrigo Ramírez Norambuena
Use function PQescapeStringConn for escaping the name of the table and schema instead of doing it manually. Change-Id: I6709165e2d00463e9c813d24f17830ad4910b599
2015-04-14cdr_pgsql: Fix CLI "cdr show pgsql status" command.Rodrigo Ramírez Norambuena
The command always showed the usage information. * Fix the error in command validation for CLI_SHOWUSAGE. ASTERISK-24959 #close Reported by: Rodrigo Ramirez Norambuena Change-Id: I584f0936bb01001336a468a55c1d05d79fe795d5 (cherry picked from commit 23a180cade51e84b9def65b05759c3cb9feba225)
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-07-16cel_pgsql, cdr_pgsql, res_config_pgsql: Add PostgreSQL application_name supportMatthew Jordan
This patch adds support for the PostgreSQL application_name connection setting. When the appropriate PostgreSQL module's configuration is set with an application name, the name will be passed to PostgreSQL on connection and displayed in the database's pg_stat_activity view, as well as in CSV logs. This aids in managing which applications/servers are connected to a PostgreSQL database, as well as tracing the activity of those connections. Review: https://reviewboard.asterisk.org/r/3591 ASTERISK-23737 #close Reported by: Gergely Domodi patches: pgsql_application_name.patch uploaded by Gergely Domodi (License 6610) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418755 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
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-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-09-21Doxygen Updates - janitor workAndrew Latham
Doxygen updates including mistakes, misspellings, missing parameters, updates for Doxygen style. Some missing txt file links are removed but their content or essense will be included in some later updates. A majority of the txt files were removed in the 1.6 era but never noted. The HR and EXTREF are simple changes that make the documentation more compatable with more versions of Doxygen. Further updates coming. (issue ASTERISK-20259) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-31Clean up and ensure proper usage of alloca()Kinsey Moore
This replaces all calls to alloca() with ast_alloca() which calls gcc's __builtin_alloca() to avoid BSD semantics and removes all NULL checks on memory allocated via ast_alloca() and ast_strdupa(). (closes issue ASTERISK-20125) Review: https://reviewboard.asterisk.org/r/2032/ Patch-by: Walter Doekes (wdoekes) ........ Merged revisions 370642 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 370643 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-17Avoid cppcheck warnings; removing unused vars and a bit of cleanup.Walter Doekes
Patch by: junky Review: https://reviewboard.asterisk.org/r/1743/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-07Fix column duplication bug in module reload for cdr_pgsql.Jonathan Rose
Prior to this patch, attempts to reload cdr_pgsql.so would cause the column list to keep its current data and then add a second copy during the reload. This would cause attempts to log the CDR to the database to fail. This patch also cleans up some unnecessary null checks for ast_free and deals with a few potential locking problems. (closes issue ASTERISK-19216) Reported by: Jacek Konieczny Review: https://reviewboard.asterisk.org/r/1711/ ........ Merged revisions 354263 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 354270 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-29Add CLI command "cdr show pgsql status" based on "cdr mysql status"Olle Johansson
Review: https://reviewboard.asterisk.org/r/923/ Thanks all for the code reviews and feedback. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@338415 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-20Merged revisions 299131 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r299131 | tilghman | 2010-12-20 11:47:10 -0600 (Mon, 20 Dec 2010) | 18 lines Merged revisions 299130 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r299130 | tilghman | 2010-12-20 11:41:24 -0600 (Mon, 20 Dec 2010) | 11 lines If a call was not answered, then the billsec was calculated unusually large. Also, due to a copy and paste error, a request for the answer field would have given the start value, instead. (closes issue #18460) Reported by: joscas Patches: 20101215__issue18460.diff.txt uploaded by tilghman (license 14) Tested by: joscas ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@299132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-11Merged revisions 291038 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r291038 | tilghman | 2010-10-09 18:25:37 -0500 (Sat, 09 Oct 2010) | 2 lines Add missing option to set calls to be logged in GMT/UTC. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@291039 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-27Formating changesOlle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@288992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-24Merged revisions 288638 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r288638 | tilghman | 2010-09-23 22:39:29 -0500 (Thu, 23 Sep 2010) | 16 lines Merged revisions 288637 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r288637 | tilghman | 2010-09-23 22:36:01 -0500 (Thu, 23 Sep 2010) | 9 lines Merged revisions 288636 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r288636 | tilghman | 2010-09-23 22:20:24 -0500 (Thu, 23 Sep 2010) | 2 lines Solaris compatibility fixes ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@288639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-22Merged revisions 288268 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r288268 | tilghman | 2010-09-22 10:14:02 -0500 (Wed, 22 Sep 2010) | 30 lines Merged revisions 288267 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r288267 | tilghman | 2010-09-22 10:11:09 -0500 (Wed, 22 Sep 2010) | 23 lines Merged revisions 288265-288266 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r288265 | tilghman | 2010-09-22 09:48:04 -0500 (Wed, 22 Sep 2010) | 9 lines Allow the encoding to be set, in case local charset does not agree with database. (closes issue #16940) Reported by: jamicque Patches: 20100827__issue16940.diff.txt uploaded by tilghman (license 14) 20100921__issue16940__1.6.2.diff.txt uploaded by tilghman (license 14) Tested by: jamicque ........ r288266 | tilghman | 2010-09-22 10:04:52 -0500 (Wed, 22 Sep 2010) | 5 lines Document addition of encoding parameter. (issue #16940) Reported by: jamicque ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@288278 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-07-12cdr_pgsql does not detect when a table is found.Leif Madsen
This change adds an ERROR message to let you know when a failure exists to get the columns from the pgsql database, which typically means that the table does not exist. (closes issue #17478) Reported by: kobaz Patches: cdr_pgsql.patch uploaded by kobaz (license 834) Tested by: kobaz, russell, lmadsen git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275626 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-03-20Resolve more compiler warnings on FreeBSD.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253540 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
2010-02-26constification and remove unnecessary includeRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249009 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-07Use extref for doxygen references to external libraries (in this case ↵Olle Johansson
PostgreSQL) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222614 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-06Change schema query to involve the use of an optional schema parameter.Tilghman Lesher
This change is done in such a way as to allow the driver to continue to function with older databases which don't have these features. (closes issue #16000) Reported by: jamicque Patches: 20091002__issue16000.diff.txt uploaded by tilghman (license 14) 20091002__issue16000__1.6.1.diff.txt uploaded by tilghman (license 14) Tested by: jamicque git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222309 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
2008-12-15When querying for the structure of the CDR table, remove the schema, if itTilghman Lesher
exists. (Closes issue #14058) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164349 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-08-27OopsTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@140355 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-24Memory leakTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@139707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-24Eliminate open coding of ast_strTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@139704 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-06-29Quote column names when inserting CDRs into postgres to avoid conflictsSean Bright
with reserved words. (closes issue #12947) Reported by: panolex git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@126274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-10Ensure that "calldate" is acceptable for a column name.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115596 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-20Minor logging cleanupsSean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-15Oops, buffer wasn't long enough for queryTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114152 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-11If any field is not null, but has no default, then it must be set or the ↵Tilghman Lesher
insert will fail. (Closes issue #12285) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114090 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11Whitespace changes onlyTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@107551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-25Permit additional CDR columns to be saved in Postgres. Note that theseTilghman Lesher
changes are backward-compatible, so no changes to UPGRADE.txt are necessary. (closes issue #9279) Reported by: rottenroddy Patches: 20080125__bug9279.diff.txt uploaded by Corydon76 (license 14) Tested by: Corydon76 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@104101 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-06Merged revisions 90166,90736,90753 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r90166 | tilghman | 2007-11-29 13:48:10 -0600 (Thu, 29 Nov 2007) | 3 lines Properly escape cdr->src and cdr->dst and ensure we use thread-safe escaping (Fixes AST-2007-026) ........ r90736 | tilghman | 2007-12-03 17:23:55 -0600 (Mon, 03 Dec 2007) | 5 lines If both dbhost and dbsock were not set, a NULL deref could result Reported by: xrg Patch by: tilghman (Closes issue #11387) ........ r90753 | tilghman | 2007-12-03 17:50:51 -0600 (Mon, 03 Dec 2007) | 5 lines Solaris requires the inclusion of sys/loadavg.h for getloadavg(). Reported by: snuffy Patch by: snuffy,tilghman (Closes issue #11430) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91561 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-17more removal of duplicate #include linesLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89349 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
2007-09-20Fix memory leaks in pbx_dundi, cdr_pgsql, and the configuration file parser.Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83229 65c4cc65-6c06-0410-ace0-fbb531ad65f3