summaryrefslogtreecommitdiff
path: root/main/config.c
AgeCommit message (Collapse)Author
2009-02-17If there are no realtime engines, there's no reason to check for realtime ↵Olle Johansson
families git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176513 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-12-05The first file should have a blank config filename in the structure, so thatTilghman Lesher
when a save occurs to a different filename, everything goes to the alternate filename, instead of appending to the original. This is important for the AMI command UpdateConfig. (closes issue #13301) Reported by: trevo Patches: 20081113__bug13301.diff.txt uploaded by Corydon76 (license 14) 20081113__bug13301__1.6.0.diff.txt uploaded by Corydon76 (license 14) Tested by: Corydon76, blitzrage git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@161181 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-25This is basically a complete rollback of r155401, as it was determined thatSean Bright
it would be best to maintain API compatibility. Instead, this commit introduces ao2_callback_data() which is functionally identical to ao2_callback() except that it allows you to pass arbitrary data to the callback. Reviewed by Mark Michelson via ReviewBoard: http://reviewboard.digium.com/r/64 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@158959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20more formatting corrections :: one line for loops and if statements still ↵Ryan Brindley
need {} git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@158078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20formatting changes :: one line for loops and if statements should have {}Ryan Brindley
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@158070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-18(closes issue #13420)Steve Murphy
Reported by: alex70 Patches: 13420.13539.patch uploaded by murf (license 17) Tested by: murf, awk This fixes two problems: a spurious linefeed insertion probably left over from pre-precomment times. Only generated when category had no previous comments. The other problem: Insertions could get the line-numbering out of whack and generate negative line numbers, causing chunks of line numbers to be emitted, on the scale of the number of lines up to that point in the file. In such cases, abort the looping, and all is well. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-07Add ability to pass arbitrary data to the ao2_callback_fn (called fromSean Bright
ao2_callback and ao2_find). Currently, passing OBJ_POINTER to either of these mandates that the passed 'arg' is a hashable object, making searching for an ao2 object based on outside criteria difficult. Reviewed by Russell and Mark M. via ReviewBoard: http://reviewboard.digium.com/r/36/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155401 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-04Slightly optimize ast_devstate_str and rename global functions devstate2str ↵Tilghman Lesher
and config_text_file_save to have an ast_ prefix git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@154260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-01Merge changes from team/group/appdocsxmlRussell Bryant
This commit introduces the first phase of an effort to manage documentation of the interfaces in Asterisk in an XML format. Currently, a new format is available for applications and dialplan functions. A good number of conversions to the new format are also included. For more information, see the following message to asterisk-dev: http://lists.digium.com/pipermail/asterisk-dev/2008-October/034968.html git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-20 Do NOT attempt to do anything with the ast_config struct when it's been ↵BJ Weschke
returned as INVALID by the config file interpreter. (closes issue #13741) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@151246 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-14Add additional memory debugging to several core APIs, and fix several memoryTilghman Lesher
leaks found with these changes. (Closes issue #13505, closes issue #13543) Reported by: mav3rick, triccyx Patches: 20081001__bug13505.diff.txt uploaded by Corydon76 (license 14) Tested by: mav3rick, triccyx git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@149199 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-09(closes issue #13557)Steve Murphy
Reported by: nickpeirson Patches: pbx.c.patch uploaded by nickpeirson (license 579) replace_bzero+bcopy.patch uploaded by nickpeirson (license 579) Tested by: nickpeirson, murf 1. replaced all refs to bzero and bcopy to memset and memmove instead. 2. added a note to the CODING-GUIDELINES 3. add two macros to asterisk.h to prevent bzero, bcopy from creeping back into the source 4. removed bzero from configure, configure.ac, autoconfig.h.in git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@147807 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-08-29Merged revisions 140488 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r140488 | mmichelson | 2008-08-29 12:34:17 -0500 (Fri, 29 Aug 2008) | 22 lines After working on the ao2_containers branch, I noticed something a bit strange. In all cases where we provide a callback function to ao2_container_alloc, the callback function would only return 0 or CMP_MATCH. After inspecting the ao2_callback() code carefully, I found that if you're only looking for one specific item, then you should return CMP_MATCH | CMP_STOP. Otherwise, astobj2 will continue traversing the current bucket until the end searching for more matches. In cases like chan_iax2 where in 1.4, all the peers are shoved into a single bucket, this makes for potentially terrible performance since the entire bucket will be traversed even if the peer is one of the first ones come across in the bucket. All the changes I have made were for cases where the callback function defined was passed to ao2_container_alloc so that calls to ao2_find could find a unique instance of whatever object was being stored in the container. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@140489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-10Another big chunk of changes from the RSW branch. Bunch of stuff from main/Sean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@137082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-05Add '+=' append operator to configuration files.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@135717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-18Merged revisions 132107 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r132107 | tilghman | 2008-07-18 13:47:50 -0500 (Fri, 18 Jul 2008) | 6 lines Textual clarification (closes issue #13106) Reported by: flefoll Patches: config.c.br14.120173.patch-unknown-directive uploaded by flefoll (license 244) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@132109 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-05Merge the adaptive realtime branch, which will make adding new required fieldsTilghman Lesher
to realtime less painful in the future. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03Merged revisions 120173 via svnmerge from Jeff Peeler
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r120173 | jpeeler | 2008-06-03 17:15:33 -0500 (Tue, 03 Jun 2008) | 6 lines (closes issue #11594) Reported by: yem Tested by: yem This change decreases the buffer size allocated on the stack substantially in config_text_file_load when LOW_MEMORY is turned on. This change combined with the fix from revision 117462 (making mkintf not copy the zt_chan_conf structure) was enough to prevent the crash. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21Be sure that we cache included files for each source file which loadsMark Michelson
a configuration file. As it was, only the first did so. This led to a problem if the included file was changed (but not the configuration file which includes it) and the second source file attempted to reload the configuration. It would not see that the included file had changed. In this particular example, res_phoneprov and chan_sip both loaded sip.conf, which included a file call sip.peers.conf. Since res_phoneprov was the first to load sip.conf, only it cached the fact that sip.conf included sip.peers.conf. If sip.peers.conf were changed and sip.conf were not and a sip reload were issued (meaning that chan_sip attempts to reload sip.conf only if it and its included files have changed) the changes made to sip.peers.conf would not be seen and therefore no action would be taken. (closes issue #12693) Reported by: marsosa git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05#execing the same file multiple times led to warning messages saying that ↵Mark Michelson
the same file was being #included twice. This was due to the fact that #exec created a temporary file which was then #included. The name of the temporary file was the name of the #exec'd file, with the Unix timestamp and thread ID concatenated. The issue was that if multiple #exec statements of the same file were reached in the same second, then the result was that the temporary files would have duplicate names. To resolve this, the temporary file now has microsecond resolution for the timestamp portion. (closes issue #12574) Reported by: jmls Patches: 12574.patch uploaded by putnopvut (license 60) Tested by: jmls, putnopvut git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-02Add attributes to various API calls, to help track down bugs (and remove a ↵Tilghman Lesher
deprecated function) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115157 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-26Simplify new macro, simplify configfile logic, now that list is sortedTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-26Add a linkedlist macro that maintains a sorted listTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111036 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-26Add the "config reload <conffile>" command, which allows you to tell AsteriskTilghman Lesher
to reload any file that references a given configuration file. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19Merged revisions 109908 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r109908 | murf | 2008-03-19 09:41:13 -0600 (Wed, 19 Mar 2008) | 72 lines (closes issue #11442) Reported by: tzafrir Patches: 11442.patch uploaded by murf (license 17) Tested by: murf I didn't give tzafrir very much time to test this, but if he does still have remaining issues, he is welcome to re-open this bug, and we'll do what is called for. I reproduced the problem, and tested the fix, so I hope I am not jumping by just going ahead and committing the fix. The problem was with what file_save does with templates; firstly, it tended to print out multiple options: [my_category](!)(templateref) instead of [my_category](!,templateref) which is fixed by this patch. Nextly, the code to suppress output of duplicate declarations that would occur because the reader copies inherited declarations down the hierarchy, was not working. Thus: [master-template](!) mastervar = bar [template](!,master-template) tvar = value [cat](template) catvar = val would be rewritten as: ;! ;! Automatically generated configuration file ;! Filename: experiment.conf (/etc/asterisk/experiment.conf) ;! Generator: Manager ;! Creation Date: Tue Mar 18 23:17:46 2008 ;! [master-template](!) mastervar = bar [template](!,master-template) mastervar = bar tvar = value [cat](template) mastervar = bar tvar = value catvar = val This has been fixed. Since the config reader 'explodes' inherited vars into the category, users may, in certain circumstances, see output different from what they originally entered, but it should be both correct and equivalent. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109942 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
2008-03-04Whitespace changes onlyTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-25Merged revisions 104092 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r104092 | qwell | 2008-02-25 14:49:42 -0600 (Mon, 25 Feb 2008) | 11 lines Allow the use of #include and #exec in situations where the max include depth was only 1. Specifically, this fixes using #include and #exec in extconfig.conf. This was basically caused because the config file itself raises the include level to 1. I opted not to raise the include limit, because recursion here could cause very bizarre behavior. Pointed out, and tested by jmls (closes issue #12064) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@104093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-15Fix up some doxygen issues.Jason Parker
(closes issue #11996) Patches: bug_11996_doxygen.diff uploaded by snuffy (license 35) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103723 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-12Requested changes from Pari, reviewed by Russell.Jeff Peeler
Added ability to retrieve list of categories in a config file. Added ability to retrieve the content of a particular category. Added ability to empty a context. Created new action to create a new file. Updated delete action to allow deletion by line number with respect to category. Added new action insert to add new variable to category at specified line. Updated action newcat to allow new category to be inserted in file above another existing category. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-07Display a message if no config mappings are found with "core show config ↵Jason Parker
mappings". Closes issue #11704, patch by kshumard. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@96936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-19add support for PARSE_DOUBLE, and remove identifiers forLuigi Rizzo
types not supported (INT16 and UINT16) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-18remove unnecessary (char *) casts for ast_config_AST_* variables.Luigi Rizzo
There are some left in the .flex files, left to the maintainer... git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-14Print an error message if a #included file does not existRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93004 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-13Merged revisions 92696 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.4 (closes issue #10690) ........ r92696 | qwell | 2007-12-12 18:11:09 -0600 (Wed, 12 Dec 2007) | 7 lines If a typo is found in a config file, we previous continued on with what was already loaded. We do not want to do this (see bug below for details). This makes it so that if a [ is found without a ], the entire config will fail, and nothing in it will be loaded. Issue 10690. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92697 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-08remove unused code, and simplify the logic for #include/#execLuigi Rizzo
(still a lot of cleanup needed here). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91983 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-08Implement comment_buffer and lline_buffer in terms of the ast_str_*() API.Luigi Rizzo
I don't know if comment_buffers etc are actually used at all... git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91962 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-08unify some common codeLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-08normalize formattingLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91952 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-08document a nice technique to exit from a block in case of errors.Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91951 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-08a little bit of documentation on how lines are parsed.Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91931 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-30Merged revisions 90348 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r90348 | russell | 2007-11-30 13:26:04 -0600 (Fri, 30 Nov 2007) | 8 lines Change the behavior of ao2_link(). Previously, in inherited a reference. Now, it automatically increases the reference count to reflect the reference that is now held by the container. This was done to be more consistent with ao2_unlink(), which automatically releases the reference held by the container. It also makes it so it is no longer possible for a pointer to be invalid after ao2_link() returns. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@90351 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-20move asterisk/paths.h outside asterisk.h and into those filesLuigi Rizzo
who really need it. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89466 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-17trim more redundant headersLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89384 65c4cc65-6c06-0410-ace0-fbb531ad65f3