summaryrefslogtreecommitdiff
path: root/res/res_config_sqlite.c
AgeCommit message (Collapse)Author
2018-03-14loader: Convert reload_classes to built-in modules.Corey Farrell
* acl (named_acl.c) * cdr * cel * ccss * dnsmgr * dsp * enum * extconfig (config.c) * features * http * indications * logger * manager * plc * sounds * udptl These modules are now loaded at appropriate time by the module loader. Unlike loadable modules these use AST_MODULE_LOAD_FAILURE on error so the module loader will abort startup on failure of these modules. Some of these modules are still initialized or shutdown from outside the module loader. logger.c is initialized very early and shutdown very late, manager.c is initialized by the module loader but is shutdown by the Asterisk core (too much uses it without holding references). Change-Id: I371a9a45064f20026c492623ea8062d02a1ab97f
2018-03-08Complete deprecating legacy modules.Richard Mudgett
The menuselect comment was updated to deprecate these modules but the AST_MODULE_INFO block at the end of file was missed. ASTERISK-27671 Change-Id: I63070b5c4d4f08af010c6034acd4793c1bcef839
2018-02-13Deprecate legacy modules.Corey Farrell
* app_fax (replaced by res_fax). * res_config_sqlite (replaced by res_config_sqlite3). * res_monitor (replaced by app_mixmonitor). This is related to ASTERISK~23657 but does not resolve that ticket. Resolving that ticket would require complete removal of res_monitor. ASTERISK-27671 #close Change-Id: I16a3edd61fc1abd4a7b2e9357693ed663f62dd49
2017-12-22Remove as much trailing whitespace as possible.Sean Bright
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2017-04-12modules: change module LOAD_FAILUREs to LOAD_DECLINESGeorge Joseph
In all non-pbx modules, AST_MODULE_LOAD_FAILURE has been changed to AST_MODULE_LOAD_DECLINE. This prevents asterisk from exiting if a module can't be loaded. If the user wishes to retain the FAILURE behavior for a specific module, they can use the "require" or "preload-require" keyword in modules.conf. A new API was added to logger: ast_is_logger_initialized(). This allows asterisk.c/check_init() to print to the error log once the logger subsystem is ready instead of just to stdout. If something does fail before the logger is initialized, we now print to stderr instead of stdout. Change-Id: I5f4b50623d9b5a6cb7c5624a8c5c1274c13b2b25
2017-02-21realtime: Centralize some common realtime backend codeSean Bright
All of the realtime backends create artificial ast_categorys to pass back into the core as query results. These categories have no filename or line number information associated with them and the backends differ slightly on how they create them. So create a couple helper macros to help make things more consistent. Also updated the call sites to remove redundant error messages about memory allocation failure. Note that res_config_ldap sets the category filename to the 'table name' but that is not read by anything in the core, so I've dropped it. Change-Id: I3a1fd91e0c807dea1ce3b643b0a6fe5be9002897
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
2015-09-18CHAOS: avoid crash if string create failsScott Griepentrog
Validate string buffer allocation before using them. ASTERISK-25323 Change-Id: Ib9c338bdc1e53fb8b81366f0b39482b83ef56ce0
2015-05-13AST_MODULE_INFO: Format corrections to the usages of AST_MODULE_INFO macro.Rodrigo Ramírez Norambuena
Change-Id: Icf88f9f861c6b2a16e5f626ff25795218a6f2723
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
2013-12-08res_config_sqlite: Check for CDR unregistration failuresMatthew Jordan
If the CDR unregistration fails due to an inflight CDR, the res_config_sqlite module needs to bail on unloading itself. Otherwise, the config could be unloaded (including the CDR table name) while the CDR engine posts a CDR to the still registered backend, resulting in a crash. ........ Merged revisions 403435 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403436 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
2013-04-27Update res_config_sqlite to use the ast_variable lists.Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-14Doxygen Updates - Title updateAndrew Latham
Update and extend the configuration_file group and enable linking to the resource. Update title that was left behind many years ago. (issue ASTERISK-20259) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-01Doxygen CleanupAndrew Latham
Start adding configuration file linking and pages. Add module loading doxygen block. Breaking up commits to keep it easy to track (issue ASTERISK-20259) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-22Doxygen Updates Janitor WorkAndrew Latham
* Whitespace, doc-blocks, spelling, case, missing and incorrect tags. * Add cleanup to Makefile for the Doxygen configuration update * Start updating Doxygen configuration for cleaner output * Enable inclusion of configuration files into documentation * remove mantisworkflow... * update documentation README * Add markup to Tilghman's email and talk with him about updating his email, he knows... * no code changes on this commit other than the mentioned Makefile change (issue ASTERISK-20259) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-21Fix misuses of asprintf throughout the code.Mark Michelson
This fixes three main issues * Change asprintf() uses to ast_asprintf() so that it pairs properly with ast_free() and no longer causes MALLOC_DEBUG to freak out. * When ast_asprintf() fails, set the pointer NULL if it will be referenced later. * Fix some memory leaks that were spotted while taking care of the first two points. (Closes issue ASTERISK-20135) reported by Richard Mudgett Review: https://reviewboard.asterisk.org/r/2071 ........ Merged revisions 371590 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 371591 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 371592 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-06Add missing newlines to CLI loggingKinsey Moore
........ Merged revisions 361471 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 361472 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361476 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-03Fix sqlite config driver segfault and broken queriesWalter Doekes
The sqlite realtime handler assumed you had a static config configured as well. The realtime multientry handler assumed that you weren't using dynamic realtime. (closes issue ASTERISK-18354) (closes issue ASTERISK-18355) Review: https://reviewboard.asterisk.org/r/1561 ........ Merged revisions 343375 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 343393 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@343394 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-13Don't skip the query field on a realtime multi queryTerry Wilson
There is no documented reason to not add the query field to the varlist returned by a realtime multi query, despite the config category being set to its value. Of course, there is no documentation that the category should be set to the value either. There is lots of no documentation when it comes to realtime. But, other engines do not skip this field so I am forcing this backend to follow the convention, because not doing so is very silly. ........ Merged revisions 340662 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 340663 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@340665 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
2011-05-05Merged revisions 317474 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r317474 | russell | 2011-05-05 17:36:33 -0500 (Thu, 05 May 2011) | 2 lines Fix more "set but unused" warnings. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317475 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-08Fix some doxygen warnings.Leif Madsen
(closes issue #17336) Reported by: snuffy Patches: doxygen-fixes1.diff uploaded by snuffy (license 35) Tested by: russell git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@268969 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-08Release list lock before returning on error.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@268933 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-03-18a few more namespace updates... res_ael_share still needs some work before ↵Kevin P. Fleming
this can be merged to other release branches git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-05Change the first field, or we don't get the necessary field separation.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173657 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-12-05Janitor, use ARRAY_LEN() when possible.Eliel C. Sardanons
(closes issue #13990) Reported by: eliel Patches: array_len.diff uploaded by eliel (license 64) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@161218 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-29we can now build with -Wformat=2, which found a couple of real bugsKevin P. Fleming
because SPRINTF() use non-literal format strings (which cannot be checked), move it into its own module so the rest of func_strings can benefit from format string checking git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@159774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02bring over all the fixes for the warnings found by gcc 4.3.x from the 1.4 ↵Kevin P. Fleming
branch, and add the ones needed for all the new code here too git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-14Merge realtime_update2 branch, which adds a new realtime API call namedTilghman Lesher
'update2', which permits updates which match across multiple columns, instead of requiring all tables to have a single unique identifier. All of the other API calls with the exception of 'update' already had the ability to match on multiple fields, so it was a missing and very desireable feature that an API call implementing an update should have this, too. This does not change any outward performance of Asterisk, but it should make life easier for application developers who use the RealTime framework. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@148570 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-10Don't include logger.h in asterisk.h by default as it is causing problems ↵Sean Bright
building app_voicemail. Instead, include it where it is needed. This turned out to be a relatively minor issue because other headers include logger.h as well. Need to test -addons before merging this back to 1.6.0. (closes issue #13605) Reported by: tomo1657 Patches: 13605_seanbright.diff uploaded by seanbright (license 71) Tested by: mmichelson git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@148200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12Create a new config file status, CONFIG_STATUS_FILEINVALID for differentiatingTilghman Lesher
when a file is invalid from when a file is missing. This is most important when we have two configuration files. Consider the following example: Old system: sip.conf users.conf Old result New result ======== ========== ========== ========== Missing Missing SIP doesn't load SIP doesn't load Missing OK SIP doesn't load SIP doesn't load Missing Invalid SIP doesn't load SIP doesn't load OK Missing SIP loads SIP loads OK OK SIP loads SIP loads OK Invalid SIP loads incompletely SIP doesn't load Invalid Missing SIP doesn't load SIP doesn't load Invalid OK SIP doesn't load SIP doesn't load Invalid Invalid SIP doesn't load SIP doesn't load So in the case when users.conf doesn't load because there's a typo that disrupts the syntax, we may only partially load users, instead of failing with an error, which may cause some calls not to get processed. Worse yet, the old system would do this with no indication that anything was even wrong. (closes issue #10690) Reported by: dtyoo Patches: 20080716__bug10690.diff.txt uploaded by Corydon76 (license 14) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-31Switch command order, to meet with current specsTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134977 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-31Two errors:Tilghman Lesher
1) If a function returns SQLITE_LOCKED, no recovery is possible. 2) An error message can be allocated, even when no error is signalled. (closes issue #13109) Reported by: gknispel_proformatique git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134919 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-30Add adaptive capabilities to the sqlite realtime driverTilghman Lesher
(closes issue #13097) Reported by: gknispel_proformatique Patches: 20080730__bug13097.diff.txt uploaded by Corydon76 (license 14) Tested by: Corydon76 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-19fix a couple of comments in sqlite resource driver.Michiel van Baak
(closes issue #13110) Reported by: gknispel_proformatique Patches: res_config_sqlite_comments.patch uploaded by gknispel (license 261) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@132277 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-17Fix memory leaksTilghman Lesher
(closes issue #13099) Reported by: gknispel_proformatique Patches: res_config_sqlite_leak_on_error.patch uploaded by gknispel (license 261) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@131753 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-17Fix memory leak.Tilghman Lesher
(Closes issue #13096) Reported by gknispel_proformatique git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@131681 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-16Don't try to dereference the dbfile pointer ifMark Michelson
we know that it's NULL. (closes issue #13092) Reported by: gknispel_proformatique Patches: trunk_sqlite_check_vars_null.patch uploaded by gknispel (license 261) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@131361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-31Initialize all these here tmp pointers at declaration. They confused some ↵Joshua Colp
compilers a wee bit. (closes issue #12333) Reported by: ovi git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111961 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11An offhand comment from Russell made me realize that the configuration fileTilghman Lesher
caching would not work properly for users.conf and any other file read from more than one place. I needed to add the filename which requested the config file to get it to work properly. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@107791 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-21Store dates using local time instead of UTCMark Michelson
(closes issue #11610, reported and patched by rbraun_performatique) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@94548 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21remove a bunch of useless #include "options.h"Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19include "logger.h" and errno.h from asterisk.h - usage shows that theyLuigi Rizzo
were included almost everywhere. Remove some of the instances. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89424 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-11-14One more typo in config.c; and missed conversions due to the constifying of ↵Tilghman Lesher
ast_variable_new parameters git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89270 65c4cc65-6c06-0410-ace0-fbb531ad65f3