summaryrefslogtreecommitdiff
path: root/cdr/cdr_pgsql.c
AgeCommit message (Collapse)Author
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
2007-08-16Don't reload a configuration file if nothing has changed.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-27Merged revisions 77540 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r77540 | file | 2007-07-27 14:04:08 -0300 (Fri, 27 Jul 2007) | 6 lines (closes issue #10310) Reported by: prashant_jois Patches: cdr_pgsql.patch uploaded by prashant (license 114) Finish the Postgresql connection after the log messages are printed so we don't access invalid memory. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26Merged revisions 77318 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r77318 | mmichelson | 2007-07-26 13:30:29 -0500 (Thu, 26 Jul 2007) | 8 lines Two consecutive calls to PQfinish could occur, meaning free gets called on the same variable twice. This patch sets the connection to NULL after calls to PQfinish so that the problem does not occur. Also in this patch, prashant_jois informed me that it is safe to pass a null pointer to PQfinish, so I have removed the check for conn's existence from my_unload_module. (closes issue 10295, reported by junky, patched by me with input from prashant_jois) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77319 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18Merge in ast_strftime branch, which changes timestamps to be accurate to the ↵Tilghman Lesher
microsecond, instead of only to the second git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20Merged revisions 70612 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r70612 | qwell | 2007-06-20 18:32:39 -0500 (Wed, 20 Jun 2007) | 4 lines Fix some potential memory leaks in cdr_pgsql. Issue 10020, patch by me, with credit to prashant_jois for pointing out the problem. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@70613 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20Merged revisions 70560 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r70560 | qwell | 2007-06-20 17:55:21 -0500 (Wed, 20 Jun 2007) | 1 line Fix a stupid mistake in my last cdr_pgsql race condition fix ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@70561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20Merged revisions 70554 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r70554 | qwell | 2007-06-20 17:31:35 -0500 (Wed, 20 Jun 2007) | 4 lines Fix a race condition in cdr_pgsql that can occur when reloading the module. Issue 10022, patch by me, with credit to prashant_jois for finding the bug. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@70555 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14Merged revisions 69392 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r69392 | kpfleming | 2007-06-14 16:50:40 -0500 (Thu, 14 Jun 2007) | 2 lines use ast_localtime() in every place localtime_r() was being used ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14Add a massive set of changes for converting to use the ast_debug() macro.Russell Bryant
(issue #9957, patches from mvanbaak, caio1982, critch, and dimas) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-12Merged revisions 69016 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r69016 | russell | 2007-06-12 14:40:17 -0500 (Tue, 12 Jun 2007) | 4 lines Fix a memory leak pointed out by prashant_jois in #asterisk-bugs. PQclear() was not called on the result structure after doing a PQexec(). Also, fix up some formatting in passing. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69017 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06Issue 9869 - replace malloc and memset with ast_calloc, and other coding ↵Tilghman Lesher
guidelines changes git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67864 65c4cc65-6c06-0410-ace0-fbb531ad65f3