summaryrefslogtreecommitdiff
path: root/main/config.c
AgeCommit message (Collapse)Author
2014-03-06sorcery: Create AST_SORCERY dialplan function.George Joseph
This patch creates the AST_SORCERY dialplan function which allows someone to retrieve any value from a sorcery-based config file. It's similar to AST_CONFIG. The creation of the function itself was fairly straightforward but it required changes to the underlying sorcery infrastructure that rippled into individual sorcery objects. The changes stemmed from inconsistencies in how sorcery created ast_variable objectsets from sorcery objects and the inconsistency in how individual objects used that feature especially when it came to parameters that can be specified multiple times like contact in aor and match in identify. You can read more here... http://lists.digium.com/pipermail/asterisk-dev/2014-February/065202.html So, what this patch does, besides actually creating the AST_SORCERY function, is the following... * Creates ast_variable_list_append which is a helper to append one ast_variable list to another. * Modifies the ast_sorcery_object_field_register functions to accept the already-defined sorcery_fields_handler callback. * Modifies ast_sorcery_objectset_create to accept a parameter indicating return type preference...a single ast_variable with all values concatenated or an ast_variable list with multiple entries. Also fixed a few bugs. * Modifies individual sorcery object implementations to use the new function definition of the ast_sorcery_object_field_register functions. * Modifies location.c and res_pjsip_endpoint_identifier_ip.c to implement sorcery_fields_handler handlers so they return multiple occurrences as an ast_variable_list. * Added a whole bunch of tests to test_sorcery. (closes issue ASTERISK-22537) Review: http://reviewboard.asterisk.org/r/3254/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-05config: Fix inverted testKinsey Moore
The test of the result of the stat() call was inverted such that its output was only used if the call failed. This inverts the test so that the output of stat() is used correctly. This was causing full reloads on unchanged files. (closes issue ASTERISK-23383) Reported by: David Woolley ........ Merged revisions 409916 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 409917 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 409918 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409919 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-05Corrected cross-platform stat nanosecond codeDavid M. Lee
When nanosecond time resolution was added for identifying config file changes, it didn't cover all of the myriad of ways that one might obtain nanosecond time resolution off of struct stat. Rather than complicate the #if even further figuring out one system from the next, this patch directly tests for the three struct members I know about today, and #ifdef's accordingly. Review: https://reviewboard.asterisk.org/r/3273/ ........ Merged revisions 409833 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 409834 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 409835 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409836 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-20pjsip_cli: Fix memory leak in ast_sip_cli_print_sorcery_objectset.George Joseph
Fixed memory leaks in ast_sip_cli_print_sorcery_objectset and ast_variable_list_sort. (closes issue ASTERISK-23266) Review: http://reviewboard.asterisk.org/r/3200/ ........ Merged revisions 408520 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-19config: Add file size and nanosecond resolution fields to the cached ↵Richard Mudgett
modified config file information. Repeatedly modifying config files and reloading too fast sometimes fails to reload the configuration because the cached modification timestamp has one second resolution. * Added file size and nanosecond resolution fields to the cached config file modification timestamp information. Now if the file size changes or the file system supports nanosecond resolution the modified file has a better chance of being detected for reload. * Added a missing unlock in an off-nominal code path. (closes issue AST-1303) Review: https://reviewboard.asterisk.org/r/3235/ ........ Merged revisions 408387 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 408388 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 408389 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408390 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-12realtime: Fix ast_update2_realtime() on raspberry pi.Walter Doekes
The old code depended on undefined va_arg behaviour: calling a function twice with the same va_list parameter and expecting it to continue where it left off. The changed code behaves like the manpage says it should. Also added a bunch of early returns to trap errors (e.g. OOM) instead of crashing. The problem was found by Julian Lyndon-Smith. The deviant behaviour on the raspberry PI also uncovered another bug (fixed in r407875) in the res_config_pgsql.so driver. Reported by: jmls Tested by: jmls Review: https://reviewboard.asterisk.org/r/3201/ ........ Merged revisions 407968 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407970 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-27Allow nested #includes in extconfig.confRussell Bryant
extconfig.conf was hard-coded to not allow nested includes for some reason. The code has been this way since a patch was merged for ASTERISK-3333 (revision 4889), which was a significant update to this code ("Merge config updates"). I can't figure out any good reason why this should be limited. This patch just removes the limit and uses the default nesting depth limit. Closes issue ASTERISK-17837 Review: https://reviewboard.asterisk.org/r/3159/ ........ Merged revisions 406643 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 406644 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 406645 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-20res_pjsip: Add PJSIP CLI commandsMatthew Jordan
Implements the following cli commands: pjsip list aors pjsip list auths pjsip list channels pjsip list contacts pjsip list endpoints pjsip show aor(s) pjsip show auth(s) pjsip show channels pjsip show endpoint(s) Also... Minor modifications made to the AMI command implementations to facilitate reuse. New function ast_variable_list_sort added to config.c and config.h to implement variable list sorting. (issue ASTERISK-22610) patches: pjsip_cli_v2.patch uploaded by george.joseph (License 6322) ........ Merged revisions 404480 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-02config: Allow ConfBridge DTMF menus to have '#' as the first digit.Richard Mudgett
ConfBridge allows custom DTMF menus to be created in the confbridge.conf file by assigning a DTMF key sequence to a sequence of actions as follows: DTMF-sequence = action,action... Unfortunately, the normal config file processing code interprets an initial '#' character as starting a directive such as #include. * Add the ability to escape the first non-blank character in a config line so the '#' character can be used without triggering the directive processing code. (closes issue AFS-2) (closes issue ASTERISK-22478) Reported by: Nicolas Tanski Patches: jira_asterisk_22478_v11.patch (license #5621) patch uploaded by rmudgett (modified) Review: https://reviewboard.asterisk.org/r/2969/ ........ Merged revisions 402407 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 402416 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402417 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30Fix various memory leaksKevin Harwell
main/config.c - cleanup cache fie includes res/res_security_log.c - unregister logger level channesl/chan_sip.c - cleanup io context and notify_types main/translator.c - cleanup at shutdown main/named_acl.c - cleanup cli commands main/indications.c - ast_get_indication_tone() unref default_tone_zone if used (closes issues ASTERISK-22378) Reported by: Corey Farrell Patches: config_shutdown.patch uploaded by coreyfarrell (license 5909) res_security_log.patch uploaded by coreyfarrell (license 5909) chan_sip-11.patch uploaded by coreyfarrell (license 5909) indications_refleak.patch uploaded by coreyfarrell (license 5909) named_acl-cli_unreg-trunk.patch uploaded by coreyfarrell (license 5909) translate_shutdown.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 398102 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398103 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 398116 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-27Add support for a realtime sorcery module.Joshua Colp
This change does the following: 1. Adds the sorcery realtime module 2. Adds unit tests for the sorcery realtime module 3. Changes the realtime core to use an ast_variable list instead of variadic arguments 4. Changes all realtime drivers to accept an ast_variable list Review: https://reviewboard.asterisk.org/r/2424/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386731 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-26Clean up memory leak in config file on off nominal paths when glob is allowedMatthew Jordan
If a system allows for its usage, Asterisk will use glob to help parse Asterisk .conf files. The config file loading routine was leaking the memory allocated by the glob() routine when the config file was in an unmodified or invalid state. This patch properly calls globfree in those off nominal paths. (closes issue ASTERISK-21412) Reported by: Corey Farrell patches: config_glob_leak.patch uploaded by Corey Farrell (license 5909) ........ Merged revisions 386672 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 386677 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02Prevent crashes from occurring when reading from data sources with large valuesMatthew Jordan
When reading configuration data from an Asterisk .conf file or when pulling data from an Asterisk RealTime backend, Asterisk was copying the data on the stack for manipulation. Unfortunately, it is possible to read configuration data or realtime data from some data source that provides a large blob of characters. This could potentially cause a crash via a stack overflow. This patch prevents large sets of data from being read from an ARA backend or from an Asterisk conf file. (issue ASTERISK-20658) Reported by: wdoekes Tested by: wdoekes, mmichelson patches: * issueA20658_dont_process_overlong_config_lines.patch uploaded by wdoekes (license 5674) * issueA20658_func_realtime_limit.patch uploaded by wdoekes (license 5674) ........ Merged revisions 378375 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 378376 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378377 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03Cleanup config cache on exit.Richard Mudgett
(issue ASTERISK-20649) Reported by: Corey Farrell Patches: config-cleanup-all.patch (license #5909) patch uploaded by Corey Farrell ........ Merged revisions 377104 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 377105 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 377106 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-21Add scoped locks to Asterisk.Mark Michelson
With the SCOPED_LOCK macro, you can create a variable that locks a specific lock and unlocks the lock when the variable goes out of scope. This is useful for situations where many breaks, continues, returns, or other interruptions would require separate unlock statements. With a scoped lock, these aren't necessary. There are specializations for mutexes, read locks, write locks, ao2 locks, ao2 read locks, ao2 write locks, and channel locks. Each of these is a SCOPED_LOCK at heart though. Review: https://reviewboard.asterisk.org/r/2060 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-16Handle integer over/under-flow in ast_parse_argsTerry Wilson
The strtol family of functions will return *_MIN/*_MAX on overflow. To detect when an overflow has happened, errno must be set to 0 before calling the function, then checked afterward. (closes issue ASTERISK-20120) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2073/ ........ Merged revisions 371392 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 371398 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 371399 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371400 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-07-11Named ACLs: Introduces a system for creating and sharing ACLsJonathan Rose
This patch adds Named ACL functionality to Asterisk. This allows system administrators to define an ACL and refer to it by a unique name. Configurable items can then refer to that name when specifying access control lists. It also includes updates to all core supported consumers of ACLs. That includes manager, chan_sip, and chan_iax2. This feature is based on the deluxepine-trunk by Olle E. Johansson and provides a subset of the Named ACL functionality implemented in that branch. For more information on this feature, see acl.conf and/or the Asterisk wiki. Review: https://reviewboard.asterisk.org/r/1978/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15Multiple revisions 369001-369002Kevin P. Fleming
........ r369001 | kpfleming | 2012-06-15 10:56:08 -0500 (Fri, 15 Jun 2012) | 11 lines Add support-level indications to many more source files. Since we now have tools that scan through the source tree looking for files with specific support levels, we need to ensure that every file that is a component of a 'core' or 'extended' module (or the main Asterisk binary) is explicitly marked with its support level. This patch adds support-level indications to many more source files in tree, but avoids adding them to third-party libraries that are included in the tree and to source files that don't end up involved in Asterisk itself. ........ r369002 | kpfleming | 2012-06-15 10:57:14 -0500 (Fri, 15 Jun 2012) | 3 lines Add a script to enable finding source files without support-levels defined. ........ Merged revisions 369001-369002 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369005 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-04Merge changes dealing with support for Digium phones.Mark Michelson
Presence support has been added. This is accomplished by allowing for presence hints in addition to device state hints. A dialplan function called PRESENCE_STATE has been added to allow for setting and reading presence. Presence can be transmitted to Digium phones using custom XML elements in a PIDF presence document. Voicemail has new APIs that allow for moving, removing, forwarding, and playing messages. Messages have had a new unique message ID added to them so that the APIs will work reliably. The state of a voicemail mailbox can be obtained using an API that allows one to get a snapshot of the mailbox. A voicemail Dialplan App called VoiceMailPlayMsg has been added to be able to play back a specific message. Configuration hooks have been added. Configuration hooks allow for a piece of code to be executed when a specific configuration file is loaded by a specific module. This is useful for modules that are dependent on the configuration of other modules. chan_sip now has a public method that allows for a custom SIP INFO request to be sent mid-dialog. Digium phones use this in order to display progress bars when files are played. Messaging support has been expanded a bit. The main visible difference is the addition of an AMI action MessageSend. Finally, a ParkingLots manager action has been added in order to get a list of parking lots. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-01Add new config-parsing frameworkTerry Wilson
This framework adds a way to register the various options in a config file with Asterisk and to handle loading and reloading of that config in a consistent and atomic manner. Review: https://reviewboard.asterisk.org/r/1873/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368181 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-18Fix a variety of memory leaksMatthew Jordan
This patch addresses a number of memory leaks in a variety of modules that were found by a static analysis tool. A brief summary of the changes: * app_minivm: free ast_str objects on off nominal paths * app_page: free the ast_dial object if the requested channel technology cannot be appended to the dialing structure * app_queue: if a penalty rule failed to match any existing rule list names, the created rule would not be inserted and its memory would be leaked * app_read: dispose of the created silence detector in the presence of off nominal circumstances * app_voicemail: dispose of an allocated unique ID field for MWI event un-subscribe requests in off nominal paths; dispose of configuration objects when using the secret.conf option * chan_dahdi: dispose of the allocated frame produced by ast_dsp_process * chan_iax2: properly unref peer in CLI command "iax2 unregister" * chan_sip: dispose of the allocated frame produced by sip_rtp_read's call of ast_dsp_process; free memory in parse unit tests * func_dialgroup: properly deref ao2 object grhead in nominal path of dialgroup_read * func_odbc: free resultset in off nominal paths of odbc_read * cli: free match_list in off nominal paths of CLI match completion * config: free comment_buffer/list_buffer when configuration file load is unchanged; free the same buffers any time they were created and config files were processed * data: free XML nodes in various places * enum: free context buffer in off nominal paths * features: free ast_call_feature in off nominal paths of applicationmap config processing * netsock2: users of ast_sockaddr_resolve pass in an ast_sockaddr struct that is allocated by the method. Failures in ast_sockaddr_resolve could result in the users of the method not knowing whether or not the buffer was allocated. The method will now not allocate the ast_sockaddr struct if it will return failure. * pbx: cleanup hash table traversals in off nominal paths; free ignore pattern buffer if it already exists for the specified context * xmldoc: cleanup various nodes when we no longer need them * main/editline: various cleanup of pointers not being freed before being assigned to other memory, cleanup along off nominal paths * menuselect/mxml: cleanup of value buffer for an attribute when that attribute did not specify a value * res_calendar*: responses are allocated via the various *_request method returns and should not be allocated in the various write_event methods; ensure attendee buffer is freed if no data exists in the parsed node; ensure that calendar objects are de-ref'd appropriately * res_jabber: free buffer in off nominal path * res_musiconhold: close the DIR* object in off nominal paths * res_rtp_asterisk: if we run out of ports, close the rtp socket object and free the rtp object * res_srtp: if we fail to create the session in libsrtp, destroy the temporary ast_srtp object (issue ASTERISK-19665) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/1922 ........ Merged revisions 366880 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366881 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10Resolve FORWARD_NULL static analysis warningsKinsey Moore
This resolves core findings from ASTERISK-19650 numbers 0-2, 6, 7, 9-11, 14-20, 22-24, 28, 30-32, 34-36, 42-56, 82-84, 87, 89-90, 93-102, 104, 105, 109-111, and 115. Finding numbers 26, 33, and 29 were already resolved. Those skipped were either extended/deprecated or in areas of code that shouldn't be disturbed. (Closes issue ASTERISK-19650) ........ Merged revisions 366167 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366168 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-04Fix many issues from the NULL_RETURNS Coverity reportKinsey Moore
Most of the changes here are trivial NULL checks. There are a couple optimizations to remove the need to check for NULL and outboundproxy parsing in chan_sip.c was rewritten to avoid use of strtok. Additionally, a bug was found and fixed with the parsing of outboundproxy when "outboundproxy=," was set. (Closes issue ASTERISK-19654) ........ Merged revisions 365398 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 365399 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-27Multiple revisions 364365,364369Terry Wilson
........ r364365 | twilson | 2012-04-27 17:31:01 -0500 (Fri, 27 Apr 2012) | 11 lines Fix ast_parse_arg numeric type range checking and add tests ast_parse_arg wasn't checking for strto* parse errors or limiting the results by the actual range of the numeric types. This patch fixes that and adds unit tests as well. Review: https://reviewboard.asterisk.org/r/1879/ ........ Merged revisions 364340 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ r364369 | twilson | 2012-04-27 17:33:10 -0500 (Fri, 27 Apr 2012) | 2 lines Add missing test_config.c ........ Merged revisions 364365,364369 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364397 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-22Kill off red blobs in most of main/*Kinsey Moore
Everything still compiled after making these changes, so I assume these whitespace-only changes didn't break anything (and shouldn't have). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-14Re-commit the verbose branch.Tilghman Lesher
This change permits each verbose destination (consoles, logger) to have its own concept of what the verbosity level is. The big feature here is that the logger will now be able to capture a particular verbosity level without condemning each console to need to suffer that level of verbosity. Additionally, a stray 'core set verbose' will no longer change what will go to the log. Review: https://reviewboard.asterisk.org/r/1599/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-09Make the config parser remove escaping backslashesKinsey Moore
The config parser in Asterisk does not currently remove a backslash that is used to escape a semicolon which would otherwise be interpreted as the start of a comment. The change here causes that backslash to be removed, but does not create a real escape system in the config parser. The biggest complication with a real escape system would be breaking existing configs everywhere (parsing \\ as \ and breaking on escaped non-semicolon characters) even though it would be the "right" way to do things. (closes issue ASTERISK-17121) Review: https://reviewboard.asterisk.org/r/1724/ ........ Merged revisions 354655 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 354656 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354657 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-12Backed out core changes from r346391Matthew Jordan
During testing, it was discovered that there were a number of side effects introduced by r346391 and subsequent check-ins related to it (r346429, r346617, and r346655). This included the /main/stdtime/ test 'hanging', as well as the remote console option failing to receive the appropriate output after a period of time. I only backed out the changes to main/ and utils/, as this was adequate to reverse the behavior experienced. (issue ASTERISK-18974) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-30Remove the few places where we try to ast_verbose() without a newline.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-21Add #tryinclude statementPaul Belanger
This provides the same functionality as #include however an asterisk module will still load if the filename does not exist. Review: https://reviewboard.asterisk.org/r/1476/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@345735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-01Several fixes to the chan_sip dynamic realtime peer/user lookupWalter Doekes
There were several problems with the dynamic realtime peer/user lookup code. The lookup logic had become rather hard to read due to lots of incremental changes to the realtime_peer function. And, during the addition of the sipregs functionality, several possibilities for memory leaks had been introduced. The insecure=port matching has always been broken for anyone using the sipregs family. And, related, the broken implementation forced those using sipregs to *still* have an ipaddr column on their sippeers table. Thanks Terry Wilson for comprehensive testing and finding and fixing unexpected behaviour from the multientry realtime call which caused the realtime_peer to have a completely unused code path. This changeset fixes the leaks, the lookup inconsistenties and that you won't need an ipaddr column on your sippeers table anymore (when you're using sipregs). Beware that when you're using sipregs, peers with insecure=port will now start matching! (closes issue ASTERISK-17792) (closes issue ASTERISK-18356) Reported by: marcelloceschia, Walter Doekes Reviewed by: Terry Wilson Review: https://reviewboard.asterisk.org/r/1395 ........ Merged revisions 342927 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 342929 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@342930 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-01Cleanup references to sipusers and sipfriends dynamic realtime familiesWalter Doekes
Somewhere between 1.4 and 1.8 the sipusers family has become completely unused. Before that, the sipfriends family had been obsoleted in favor of separate sipusers and sippeers families. Apparently, they have been merged back again into a single family which is now called "sippeers". Reviewed by: irroot, oej, pabelanger Review: https://reviewboard.asterisk.org/r/1523 ........ Merged revisions 342869 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 342870 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@342871 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-25Return NULL when no results returned for realtime_multientryTerry Wilson
It was not documented what the return value should be when no entries were returned with the multientry realtime callback. This change forces consistent behavior even if the backends return an empty ast_config. Review: https://reviewboard.asterisk.org/r/1521/ ........ Merged revisions 342223 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 342224 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@342225 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-02Merged revisions 334297 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r334297 | rmudgett | 2011-09-02 12:15:08 -0500 (Fri, 02 Sep 2011) | 46 lines Merged revisions 334296 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r334296 | rmudgett | 2011-09-02 12:10:58 -0500 (Fri, 02 Sep 2011) | 39 lines Fix potential memory allocation failure crashes in config.c. * Added required checks to the returned memory allocation pointers to prevent crashes. * Made ast_include_rename() create a replacement ast_variable list node if the new filename is longer than the available space. Fixes potential crash and memory leak. * Factored out ast_variable_move() from ast_variable_update() so ast_include_rename() can also use it when creating a replacement ast_variable list node. * Made the filename stuffed at the end of the struct a minimum allocated size in ast_variable_new() in case ast_include_rename() changes the stored filename. * Constify struct char pointers pointing to strings stuffed at the end of the struct for: ast_variable, cache_file_mtime, and ast_config_map. * Factored out cfmtime_new() to remove inlined code and allow some struct pointers to become const. * Removed the list lock from struct cache_file_mtime that was never used. * Added doxygen comments to several structure elements and better documented what strings are stuffed at the struct end char array. * Reworked ast_config_text_file_save() and set_fn() to handle allocation failure of the include file scratch pad object tracking blank lines. * Made ast_config_text_file_save() fn[] declared with PATH_MAX to ensure it is long enough for any filename with path. Also reduced the number of container fileset buckets from a rediculus 180,000 to 1023. JIRA AST-618 Review: https://reviewboard.asterisk.org/r/1378/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@334304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-22Merged revisions 332940 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r332940 | rmudgett | 2011-08-22 16:23:40 -0500 (Mon, 22 Aug 2011) | 14 lines Merged revisions 332939 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r332939 | rmudgett | 2011-08-22 16:22:24 -0500 (Mon, 22 Aug 2011) | 7 lines Minor code optimizations. * Simplify ast_category_browse() logic for easier understanding. * Remove dead code in ast_variable_delete() and simplify some of its logic. ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@332941 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-22Merged revisions 332761 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r332761 | rmudgett | 2011-08-22 12:05:35 -0500 (Mon, 22 Aug 2011) | 22 lines Merged revisions 332759 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r332759 | rmudgett | 2011-08-22 12:00:03 -0500 (Mon, 22 Aug 2011) | 15 lines Memory leak reading realtime database variable list. Calling ast_load_realtime() can leak the last list node if the read list only contains empty variable value items. * Fixed list filter loop in ast_load_realtime() to delete the list node immediately instead of the next time through the loop. The next time through the loop may not happen if the node to delete is the last in the list. (issue ASTERISK-18277) (issue ASTERISK-18265) Patches: jira_asterisk_18265_v1.8_config.patch (license #5621) patch uploaded by rmudgett ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@332762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-03Merged revisions 316265 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r316265 | russell | 2011-05-03 14:55:49 -0500 (Tue, 03 May 2011) | 5 lines Fix a bunch of compiler warnings generated by gcc 4.6.0. Most of these are -Wunused-but-set-variable, but there were a few others mixed in here, as well. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@316293 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-02Replacing doc/* with wiki linksAndrew Latham
Adding links to http(s)://wiki.asterisk.org git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@305799 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-19Clarify a source comment about configuration template categories.Sean Bright
(closes issue #18578) Reported by: astmiv Patches: asterisk.main.config.2.patch uploaded by astmiv (license 1189) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@302836 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-27Merged revisions 283882 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r283882 | qwell | 2010-08-27 15:31:55 -0500 (Fri, 27 Aug 2010) | 22 lines Merged revisions 283881 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r283881 | qwell | 2010-08-27 15:30:27 -0500 (Fri, 27 Aug 2010) | 15 lines Merged revisions 283880 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r283880 | qwell | 2010-08-27 15:29:11 -0500 (Fri, 27 Aug 2010) | 8 lines Fix issue with decoding ^-escaped characters in realtime. (closes issue #17790) Reported by: denzs Patches: 17790-chunky.diff uploaded by qwell (license 4) Tested by: qwell, denzs ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@283883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-23Merge the realtime failover branchTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278957 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-17Merged revisions 277568 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r277568 | tilghman | 2010-07-16 16:54:29 -0500 (Fri, 16 Jul 2010) | 8 lines Since we split values at the semicolon, we should store values with a semicolon as an encoded value. (closes issue #17369) Reported by: gkservice Patches: 20100625__issue17369.diff.txt uploaded by tilghman (license 14) Tested by: tilghman ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@277773 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-08Add IPv6 to Asterisk.Mark Michelson
This adds a generic API for accommodating IPv6 and IPv4 addresses within Asterisk. While many files have been updated to make use of the API, chan_sip and the RTP code are the files which actually support IPv6 addresses at the time of this commit. The way has been paved for easier upgrading for other files in the near future, though. Big thanks go to Simon Perrault, Marc Blanchet, and Jean-Philippe Dionne for their hard work on this. (closes issue #17565) Reported by: russell Patches: asteriskv6-test-report.pdf uploaded by russell (license 2) Review: https://reviewboard.asterisk.org/r/743 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@274783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-05Merged revisions 273884 via svnmerge from Paul Belanger
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r273884 | pabelanger | 2010-07-05 09:51:29 -0400 (Mon, 05 Jul 2010) | 8 lines Remove extra line breaks from 'core show config mappings' (closes issue #17583) Reported by: pabelanger Patches: issue17583.patch uploaded by pabelanger (license 224) Tested by: lmadsen ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@273886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-30Don't attempt to proceed if our internal parser indicates an invalid file.Tilghman Lesher
(closes issue #17560) Reported by: Nick_Lewis git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@273142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-28Merged revisions 272921-272922 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r272921 | tilghman | 2010-06-28 16:29:27 -0500 (Mon, 28 Jun 2010) | 8 lines Change the way that we read include files, to accommodate for changes in GCC 4.4. (closes issue #17472) Reported by: seandarcy Patches: config2.patch uploaded by nivan (license 1066) Tested by: nivan ........ r272922 | tilghman | 2010-06-28 16:38:49 -0500 (Mon, 28 Jun 2010) | 2 lines Also trim trailing blanks on #includes ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@272923 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-18Merged revisions 241015 via svnmerge from Sean Bright
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r241015 | seanbright | 2010-01-18 14:54:19 -0500 (Mon, 18 Jan 2010) | 12 lines Plug a memory leak when reading configs with their comments. While reading through configuration files with the intent of returning their full contents (comments specifically) we allocated some memory and then forgot to free it. This doesn't fix 16554 but clears up a leak I had in the lab. (issue #16554) Reported by: mav3rick Patches: issue16554_20100118.patch uploaded by seanbright (license 71) Tested by: seanbright ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241016 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-04Oops, didn't compile (thanks, kpfleming)Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237414 65c4cc65-6c06-0410-ace0-fbb531ad65f3