summaryrefslogtreecommitdiff
path: root/main
AgeCommit message (Collapse)Author
2017-11-17CLI: Create ast_cli_completion_vector.Corey Farrell
This is a rewrite of ast_cli_completion_matches using a vector to build the list. The original function calls the vector version, NULL terminates the vector and extracts the elements array. One change in behavior the results are now sorted and deduplicated. This will solve bugs where some duplicate checking was done before the list was sorted. Change-Id: Iede20c5b4d965fa5ec71fda136ce9425eeb69519
2017-11-16aoc: Fix memory management issues.Corey Farrell
aoc_publish_blob failed to check for msg allocation error and never released msg. Change-Id: Ib31a9ffb81056a0d496a49d7eec795005a44bcd5
2017-11-16Merge "sorcery: Add ast_sorcery_retrieve_by_prefix()" into 13Joshua Colp
2017-11-15audiohook.c: Fix freeing a frame and still using it.Richard Mudgett
Memory corruption happened to the media frame caches when an audio hook freed a frame when it shouldn't. I think the freed frame was because a jitter buffer interpolated a missing frame and the audio hook unconditionally freed it. * Made audiohook.c:audio_audiohook_write_list() not free an interpolated frame if it is the same frame as what was passed into the routine. * Made plc.c:normalise_history() use memmove() instead of memcpy() on a memory block that could overlap. Found by valgrind investigating this issue. ASTERISK-27238 ASTERISK-27412 Change-Id: I548d86894281fc4529aefeb9f161f2131ecc6fde
2017-11-14Merge "core: Fix configuration of remote console socket path." into 13Jenkins2
2017-11-14Merge "core: Add cache_media_frames debugging option." into 13Joshua Colp
2017-11-13core: Fix configuration of remote console socket path.Corey Farrell
The remote console socket path is the combination of asterisk.conf settings astrundir from [directories] and astctl from [files]. Unconditionally combine the two strings after processing all values to ensure we end up with the correct socket path. ASTERISK-27415 Change-Id: Ib1e2805d55d6b0955c6430a1a2a93acbf9b091e8
2017-11-13sorcery: Add ast_sorcery_retrieve_by_prefix()Sean Bright
Some consumers of the sorcery API use ast_sorcery_retrieve_by_regex only so that they can anchor the potential match as a prefix and not because they truly need regular expressions. Rather than using regular expressions for simple prefix lookups, add a new operation - ast_sorcery_retrieve_by_prefix - that does them. Patches against 13 and 15 have a compatibility layer needed to maintain ABI that is not needed in master. Change-Id: I56f4e20ba1154bd52281f995c27a429a854f6a79
2017-11-11core: Add cache_media_frames debugging option.Richard Mudgett
The media frame cache gets in the way of finding use after free errors of media frames. Tools like valgrind and MALLOC_DEBUG don't know when a frame is released because it gets put into the cache instead of being freed. * Added the "cache_media_frames" option to asterisk.conf. Disabling the option helps track down media frame mismanagement when using valgrind or MALLOC_DEBUG. The cache gets in the way of determining if the frame is used after free and who freed it. NOTE: This option has no effect when Asterisk is compiled with the LOW_MEMORY compile time option enabled because the cache code does not exist. To disable the media frame cache simply disable the cache_media_frames option in asterisk.conf and restart Asterisk. Sample asterisk.conf setting: [options] cache_media_frames=no ASTERISK-27413 Change-Id: I0ab2ce0f4547cccf2eb214901835c2d951b78c00
2017-11-11frame.c: Make ast_frame_free()/ast_frfree() NULL tolerantRichard Mudgett
Change-Id: Ic49d821ef88ada38a31bdd835b9531443c55d793
2017-11-09core: Remove disabled code.Corey Farrell
handle_quit has been disabled since 2003, remove it. Change-Id: Idc3aaa6c81676160547078f9b71e8aa43de2db18
2017-11-09Merge "stasis_bridges.c: Fix off-nominal json memory leaks." into 13Jenkins2
2017-11-08AST-2017-010: Fix cdr_object_update_party_b_userfield_cb() buf overrunRichard Mudgett
cdr_object_update_party_b_userfield_cb() could overrun the fixed buffer if the supplied string is too long. The long string could be supplied by external means using the CDR(userfield) function. This may seem reminiscent to AST-2017-001 (ASTERISK_26897) and it is. The earlier patch fixed the buffer overrun for Party A's userfield while this patch fixes the same thing for Party B's userfield. ASTERISK-27337 Change-Id: I0fa767f65ecec7e676ca465306ff9e0edbf3b652
2017-11-07Merge "stasis: Release object if vector append fails." into 13Jenkins2
2017-11-07Merge "format_cap: Fix leak on AST_VECTOR_APPEND error." into 13Joshua Colp
2017-11-07Merge "Messaging: Report error on failure to register tech or handler." into 13Joshua Colp
2017-11-07Merge "CLI: Remove unused internal command." into 13Jenkins2
2017-11-07Merge "tcptls: Print notice when TLS is enabled but not configured." into 13Joshua Colp
2017-11-07Merge "stasis: Remove silly use of RAII_VAR in stasis_forward_all." into 13Joshua Colp
2017-11-07Merge "stasis_channels.c: Remove a very silly RAII_VAR()." into 13Jenkins2
2017-11-07Merge "Fix ast_(v)asprintf() malloc failure usage conditions." into 13Jenkins2
2017-11-06stasis: Release object if vector append fails.Corey Farrell
Change-Id: I3e5cc669169aab6175ddfaf7486edeaeb4fdcfb1
2017-11-06RTP Engine: Deal with errors returned from AST_VECTOR_REPLACE.Corey Farrell
Check for errors from AST_VECTOR_REPLACE and clean memory if needed. Change-Id: I124d15cc1d645f85a72a1279f623c1993b304b0b
2017-11-06Messaging: Report error on failure to register tech or handler.Corey Farrell
Message tech and handler registrations use a vector which could fail to expand. If it does log and error and return error. Change-Id: I593a8de81a07fb0452e9b0efd5d4018b77bca6f4
2017-11-06format_cap: Fix leak on AST_VECTOR_APPEND error.Corey Farrell
format_cap_framed_init can fail on AST_VECTOR_APPEND. This should report failure to the caller and clean the newly allocated frame. Change-Id: Ica0661235bf09497bf23d844ceb01f21b41a55b0
2017-11-06stasis: Remove silly use of RAII_VAR in stasis_forward_all.Corey Farrell
Change-Id: I46de4c968d40144d5b049966304ff66c1469fb65
2017-11-06CLI: Remove unused internal command.Corey Farrell
The internal CLI command "_command complete" was last used by Asterisk 0.2.0. Since then we've been using "_command nummatches" and "_command matchesarray". Change-Id: I682fe1e21a24a3bb5bd04146e639f1c5866bcfce
2017-11-06stasis_bridges.c: Fix off-nominal json memory leaks.Richard Mudgett
Change-Id: Ib1181a36b317c86bff1ef2e44a17a0b1c73cfdc8
2017-11-06stasis_channels.c: Remove a very silly RAII_VAR().Richard Mudgett
Change-Id: I28b458b3c1a442c4ef0be7b4986a95ea4149e14f
2017-11-06Fix ast_(v)asprintf() malloc failure usage conditions.Richard Mudgett
When (v)asprintf() fails, the state of the allocated buffer is undefined. The library had better not leave an allocated buffer as a result or no one will know to free it. The most likely way it can return failure is for an allocation failure. If the printf conversion fails then you actually have a threading problem which is much worse because another thread modified the parameter values. * Made __ast_asprintf()/__ast_vasprintf() set the returned buffer to NULL on failure. That is much more useful than either an uninitialized pointer or a pointer that has already been freed. Many uses won't have to check for failure to ensure that the buffer won't be double freed or prevent an attempt to free an uninitialized pointer. * stasis.c: Fixed memory leak in multi_object_blob_to_ami() allocated by ast_asprintf(). * ari/resource_bridges.c:ari_bridges_play_helper(): Remove assignment to the wrong thing which is now not needed even if assigning to the right thing. Change-Id: Ib5252fb8850ecf0f78ed0ee2ca0796bda7e91c23
2017-11-06Merge "Stasis/ARI: Fix off-nominal path json memory leaks." into 13Joshua Colp
2017-11-06Merge "AOC: Fix AOC-S json memory leak." into 13Jenkins2
2017-11-06tcptls: Print notice when TLS is enabled but not configured.Alexander Traud
Asterisk can be compiled without a SSL/TLS library, without the Development Headers of OpenSSL. However, if TLS (SIP) or Secure-WebSockets (WebRTC) was enabled in a configuration file, Asterisk did not notice the user. Asterisk failed silently, only the corresponding TCP ports were not open. ASTERISK-27394 Reported-by: mossley74 Change-Id: Ib8b7539a5b2af8154c22e5f7a40fc68f95d95b93
2017-11-03Stasis/ARI: Fix off-nominal path json memory leaks.Richard Mudgett
Change-Id: Id569c624c426e3b22a99936473c730592d8b83fb
2017-11-03AOC: Fix AOC-S json memory leak.Richard Mudgett
Change-Id: I3a1d40a41a8a7d00fa4a187de6a343a79155d3ef
2017-11-03Build System: Fix build failure caused by recent CLI improvements.Corey Farrell
We use the editline library to help with filename completion in our CLI interface. Some systems failed to find the header when included from loader.c. This is fixed by setting the proper CFLAGS for the build of loader.o. ASTERISK-27378 Change-Id: Ib7fd496f1d7ed48141a2eadd5dd61cab2f2308be
2017-11-02Modules: Additional improvements to CLI completion.Corey Farrell
Replace 'needsreload' argument with a 'type' argument to specify which type of modules you want completion. This provides more accurate CLI completion for load and unload commands. * 'module unload' now excludes modules that have active references or are not running. * 'module load' now excludes modules that are already running. * 'core set debug [atleast] <level> [module]' shows running modules only. ASTERISK-27378 Change-Id: Iea3e00054461484196c46f688f02635cc886bad1
2017-10-31features: Bridge application's BRIDGERESULT not appropriately setKevin Harwell
The dialplan application "Bridge" was not setting the BRIDGERESULT to failure when a failure did occur. Even worse if it did fail to join the bridge it would still report success. This patch now sets the BRIDGERESULT variable to an appropriate value for a given condition state. Also, removed the value INCOMPATIBLE as a valid result type since it is no longer used. ASTERISK-27369 #close Change-Id: I22588e7125a765edf35cff28c98ca143e9927554
2017-10-31Merge "Build System: Fix --disable-xmldoc option." into 13Jenkins2
2017-10-30Modules: Fix issues with CLI completion.Corey Farrell
* Stop using ast_module_helper to check if a module is loaded, use ast_module_check instead (app_confbridge and app_meetme). * Stop ast_module_helper from listing reload classes when needsreload was not requested. ASTERISK-27378 Change-Id: Iaed8c1e4fcbeb242921dbac7929a0fe75ff4b239
2017-10-26codec.c: Defensively check the returned samples.Richard Mudgett
Earlier versions of the codec_opus samples_count callback can return negative error values on undecodable frames. This resulted in a divide by zero exception. * Added a defensive check in ast_codec_samples_count() for a "negative" samples count return value. Log the event and set the count to zero. ASTERISK-27194 Change-Id: Icf69350307ecbbc80a3d74de46af9bd80ea17819
2017-10-25Merge "http.c: Fix http header send content." into 13Joshua Colp
2017-10-25Build System: Fix --disable-xmldoc option.Corey Farrell
The configure option to disable XML documentation does not currently work. This patch makes it effective, but also causes an ABI change by removing the ast_xmldoc_* symbols. Disabling xmldoc also prevents docs from being automatically generated, but they can still be manually generated with 'make doc/core-en_US.xml'. ASTERISK-26639 Change-Id: Ifac562340c09f80c83e0203de098fcac93bf8c44
2017-10-25http.c: Fix http header send content.Ben Ford
Currently ast_http_send barricades a portion of the content that needs to be sent in order to establish a connection for things like the ARI client. The conditional and contents have been changed to ensure that everything that needs to be sent, will be sent. ASTERISK-27372 Change-Id: I8816d2d8f80f4fefc6dcae4b5fdfc97f1e46496d
2017-10-24hashtab: Use ast_free.Corey Farrell
A few places in hashtab use free instead of ast_free. Change-Id: I2ff089bad71640c03c3ce97f1b00fc962ef79427
2017-10-23main/Makefile: Remove rule for non-existant testexpr2.Corey Farrell
Change-Id: Ibb3e47f27a395d74d8c5263db015b05434f5969b
2017-10-16cdr.c: Rename the Party A CDR container.Richard Mudgett
* Rename the Party A CDR container from active_cdrs_by_channel to active_cdrs_master. * Renamed the support functions associated with active_cdrs_master appropriately. ASTERISK-27335 Change-Id: I6104bb3edc3a0b7243ce502e45e8832b0cff14f7
2017-10-16cdr.c: Add container to key off of Party B channel names.Richard Mudgett
The CDR performance gets worse the further it gets behind in processing stasis messages. One of the reasons is because of a n*m loop used when processing Party B information. * Added a new CDR container that is keyed to Party B so we don't need such a large loop when processing Party B information. NOTE: To reduce the size of the patch I deferred to another patch the renaming of the Party A active_cdrs_by_channel container to active_cdrs_master and renaming the container's hash and cmp functions appropriately. ASTERISK-27335 Change-Id: I0bf66e8868f8adaa4b5dcf9e682e34951c350249
2017-10-16declare optional openssl dependencies in moduleinfoTzafrir Cohen
Declare optional openssl dependencies in: * res_rtp_asterisk.c * tcptls.c ASTERISK-27328 #close Change-Id: I2636f1c05b8104b4fe6f36cce0ebd9a98b9c78ab
2017-10-15Merge "ast_bt_get_symbols: Prevent double-free." into 13Jenkins2