Skip to content
Snippets Groups Projects
  1. Nov 19, 2018
    • George Joseph's avatar
      backtrace: Refactor ast_bt_get_symbols so it doesn't crash · ece5f801
      George Joseph authored
      We've been seeing crashes in libbfd when we attempt to generate
      a stack trace from multiple threads.  It turns out that libbfd
      is NOT thread-safe.  It can cache the bfd structure and give it to
      multiple threads without protecting itself.  To get around this,
      we've added a global mutex around the bfd functions and also have
      refactored the use of those functions to be more efficient and
      to provide more information about inlined functions.
      
      Also added a few more tests to test_pbx.c.  One just calls
      ast_assert() and the other calls ast_log_backtrace().  Neither are
      run by default.
      
      WARNING:  This change necessitated changing the return value of
      ast_bt_get_symbols() from an array of strings to a VECTOR of
      strings.  However, the use of this function outside Asterisk is not
      likely.
      
      ASTERISK-28140
      
      Change-Id: I79d02862ddaa2423a0809caa4b3b85c128131621
      ece5f801
  2. Oct 19, 2018
    • Corey Farrell's avatar
      lock: Replace __ast_mutex_logger with private log_mutex_error. · 4c19b949
      Corey Farrell authored
      __ast_mutex_logger used the variable `canlog` without accepting it as a
      argument.  Replace with internal macro `log_mutex_error` which takes
      canlog as the first arguement.  This will prevent confusion when working
      with lock.c code, many of the function declare the canlog variable and
      in some cases it previously appeared to be unused.
      
      Change-Id: I83b372cb0654c5c18eadc512f65a57fa6c2e9853
      4c19b949
  3. Oct 18, 2018
    • Richard Mudgett's avatar
      Fix 'statement' typo throughout code. · 467f7c67
      Richard Mudgett authored
      Most were in comments.  A couple were in warning messages.
      
      Pointed out by Jonathan H on the Asterisk users mailing list.
      
      Change-Id: I6286939dff5d0a27a2758140570106f1cb351855
      467f7c67
  4. Sep 27, 2018
    • Sean Bright's avatar
      config.c: Cleanup AST_INCLUDE_GLOB · ac23e5ad
      Sean Bright authored
      * In main/config.c, AST_INCLUDE_GLOB is fixed to '1' making the #ifdefs
        pointless.
      
      * In utils/extconf.c, AST_INCLUDE_GLOB is never defined so there is a
        lot of dead code.
      
      Change-Id: I1bad1a46d7466ddf90d52cc724e997195495226c
      ac23e5ad
  5. Aug 08, 2018
    • Corey Farrell's avatar
      CI: Add support for coverage processing. · addfc938
      Corey Farrell authored
      Enable coverage with `./tests/CI/buildAsterisk.sh --coverage`.  This
      will cause Asterisk to be compiled with coverage support.  It also
      initializes 'before' coverage data for all sources.  Accept
      --tested-only to disable modules which are not run by any test.
      Enabling coverage also sets tested-only true by default.  To build
      everything with coverage enabled use `--coverage --tested-only=0`.
      
      ./tests/CI/processCoverage.sh is used to process the coverage and
      generate HTML reports.
      
      Fix utils/check_expr2 which failed to compiled with coverage enabled.
      
      Add status output 5 times per stage of astobj2_test_perf to ensure
      remote CLI does not timeout when compiled with coverage.  Remote CLI
      disconnects if no output is received for 60 seconds.  When coverage is
      enabled it takes about 70 seconds for my laptop to run the stages of
      this test, so with the change a message is printed every 14 seconds.
      
      Change-Id: I890f7d5665087426ad7d3e363187691b9afc2222
      addfc938
  6. Aug 01, 2018
    • Corey Farrell's avatar
      Build System: Improve ccache matching for different menuselect options. · a10a3aff
      Corey Farrell authored
      Changing any Menuselect option in the `Compiler Flags` section causes a
      full rebuild of the Asterisk source tree.  Every enabled option causes
      a #define to be added to buildopts.h, thus breaking ccache caching for
      every source file that includes "asterisk.h".  In most cases each option
      only applies to one or two files.  Now we only define those options for
      the specific sources which use them, this causes much better cache
      matching when working with multiple builds.  For example testing code
      with an without MALLOC_DEBUG will now use just over half the ccache
      size, only main/astmm.o will have two builds cached instead of every
      file.
      
      Reorder main/Makefile so _ASTCFLAGS set on specific object files are all
      together, sorted by filename.  Stop adding -DMALLOC_DEBUG to CFLAGS of
      bundled pjproject, this define is no longer used by any header so only
      serves to break cache.
      
      The only code change is a slight adjustment to how main/astmm.c is
      initialized.  Initialization functions always exist so main/asterisk.c
      can call them unconditionally.  Additionally rename the astmm
      initialization functions so they are not exported.
      
      Change-Id: Ie2085237a964f6e1e6fff55ed046e2afff83c027
      a10a3aff
  7. Jul 18, 2018
  8. Jun 21, 2018
  9. May 11, 2018
    • Corey Farrell's avatar
      Fix GCC 8 build issues. · b5914d90
      Corey Farrell authored
      This fixes build warnings found by GCC 8.  In some cases format
      truncation is intentional so the warning is just suppressed.
      
      ASTERISK-27824 #close
      
      Change-Id: I724f146cbddba8b86619d4c4a9931ee877995c84
      b5914d90
  10. Apr 20, 2018
  11. Apr 17, 2018
  12. Mar 19, 2018
    • Corey Farrell's avatar
      core: Remove additional symbols. · 040bb217
      Corey Farrell authored
      Remove symbols that are depreacated and replaced:
      * ast_channel_datastore_alloc
      * ast_channel_datastore_free
      * ast_channel_cmpwhentohangup
      * ast_channel_setwhentohangup
      * config_text_file_save
      * devstate2str
      * ast_device_state_changed
      * ast_device_state_changed_literal
      * ast_verbose_get_by_module
      
      Remove unused symbols:
      * channelreloadreason2txt (last used in Asterisk 12).
      
      Remove unused ast_options flags:
      * AST_OPT_FLAG_END_CDR_BEFORE_H_EXTEN / ast_opt_end_cdr_before_h_exten
      * AST_OPT_FLAG_VERBOSE_MODULE / ast_opt_verb_module
      * AST_OPT_FLAG_INITIATED_SECONDS
      
      Change-Id: I841255995d195f8efc1ed47af9c7a2f131c08645
      040bb217
  13. Mar 17, 2018
    • Corey Farrell's avatar
      core: Stop using AST_INLINE_API for allocator functions. · 4d1c9d87
      Corey Farrell authored
      This replaces AST_INLINE_API allocators in utils.h with real functions
      implemented in astmm.c.  Associated macro's are also moved from utils.h
      to astmm.h.
      
      Remove menuselect conflicts between MALLOC_DEBUG and DEBUG_CHAOS as they
      can now be combined.
      
      This has multiple benefits:
      * Simplifies asterisk/utils.h by removing inline functions and use of
        the logger.
      * Removal of these inline functions decreases size of Asterisk and
        module binaries by 1% or more.
      * Puts memory management functions together with and without
        MALLOC_DEBUG enabled, simplifying management of the code.
      * Enables DEBUG_CHAOS for ASTMM_REDIRECT and bundled pjproject.
      
      Change-Id: If9df4377f74bdbb627461b27a473123e05525887
      4d1c9d87
  14. Mar 13, 2018
    • Corey Farrell's avatar
      core: Remove incorrect usage of attribute_malloc. · 9e488dd4
      Corey Farrell authored
      GCC documentation states that when __attribute__((malloc)) is used it
      should not return storage which contains any valid pointers.  It
      specifically mentions that realloc functions should not have the malloc
      attribute, but this also means that complex initializers which could
      contain initialized pointers should not use this attribute.
      
      Change-Id: If507f33ffb3ca3b83b702196eb0e8215d27fc7d2
      9e488dd4
  15. Jan 25, 2018
  16. Dec 22, 2017
  17. Oct 24, 2017
  18. Aug 01, 2017
    • Corey Farrell's avatar
      Fix compiler warnings on Fedora 26 / GCC 7. · 58d03211
      Corey Farrell authored
      GCC 7 has added capability to produce warnings, this fixes most of those
      warnings.  The specific warnings are disabled in a few places:
      
      * app_voicemail.c: truncation of paths more than 4096 chars in many places.
      * chan_mgcp.c: callid truncated to 80 chars.
      * cdr.c: two userfields are combined to cdr copy, fix would break ABI.
      * tcptls.c: ignore use of deprecated method SSLv3_client_method().
      
      ASTERISK-27156 #close
      
      Change-Id: I65f280e7d3cfad279d16f41823a4d6fddcbc4c88
      58d03211
  19. Feb 23, 2017
    • frahaase's avatar
      Binaural synthesis (confbridge): Adds binaural synthesis to bridge_softmix. · 094c26aa
      frahaase authored
      Adds binaural synthesis to bridge_softmix (via convolution using libfftw3).
      Binaural synthesis is conducted at 48kHz.
      For a conference, only one spatial representation is rendered.
      The default rendering is applied for mono-capable channels.
      
      ASTERISK-26292
      
      Change-Id: Iecdb381b6adc17c961049658678f6219adae1ddf
      094c26aa
  20. Feb 15, 2017
  21. Jan 04, 2017
    • Jonathan R. Rose's avatar
      core/pbx: dialplan show - display filename/line# · d96e3502
      Jonathan R. Rose authored
      Adds the ability for extensions to be registered to include filename and
      line number so that dialplan show output can show the filename and line
      number of a config file responsible for generating a given extension.
      
      This only affects config modules that are written to use the new extension
      registering functions. In this patch, that only includes pbx_config, so
      extensions registered in extensions.conf and any included extension will
      be shown in this manner. Extensions registered in this manner will show
      the filename and line number *instead* of the registrar.
      
      ASTERISK-26658 #close
      Reported by: Jonathan R. Rose
      
      Change-Id: Ieccc6abccdff34ed5c7da3511fd24972b8f2dd30
      d96e3502
  22. Oct 27, 2016
    • Corey Farrell's avatar
      Remove ASTERISK_REGISTER_FILE. · a6e5bae3
      Corey Farrell authored
      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
      a6e5bae3
  23. Sep 29, 2016
  24. Aug 20, 2016
    • Corey Farrell's avatar
      Fix naming mismatch of allocator functions. · 8061d9f6
      Corey Farrell authored
      Allocator functions that take file/line/func parameters are prefixed
      with single-underscore when MALLOC_DEBUG is not defined,
      double-underscore when it is defined.  This change updates all
      allocators that accept file/line/func to have the same prototype in
      either ABI mode.  The parameter order of __ast_vasprintf and
      __ast_asprintf in utils.h have been changed to match that of astmm.h.
      
      End-use allocator macro's have been removed from astmm.h and moved to an
      unconditional part of utils.h.
      
      Change-Id: I823bb6ce2b5675b3a4735948f10a3b420e9a023a
      8061d9f6
  25. Jul 21, 2016
    • Corey Farrell's avatar
      pbx: Create pbx_sw.c for management of 'struct ast_sw'. · a36a174c
      Corey Farrell authored
      This changes context switches from a linked list to a vector, makes
      'struct ast_sw' opaque to pbx.c.
      
      Although ast_walk_context_switches is maintained the procedure is no
      longer efficient except for the first call (inc==NULL).  This
      functionality is replaced by two new functions implemented by vector
      macros.
      * ast_context_switches_count (AST_VECTOR_SIZE)
      * ast_context_switches_get (AST_VECTOR_GET)
      
      As with ast_walk_context_switches callers of these functions are
      expected to have locked contexts.  Only a few places in Asterisk walked
      the switches, they have been converted to use the new functions.
      
      Change-Id: I08deb016df22eee8288eb03de62593e45a1f0998
      a36a174c
  26. Jul 18, 2016
    • Corey Farrell's avatar
      pbx: Create pbx_ignorepat.c for management of 'struct ast_ignorepat'. · e2e8713b
      Corey Farrell authored
      This changes context ignore patterns from a linked list to a vector,
      makes 'struct ast_ignorepat' opaque to pbx.c.
      
      Although ast_walk_context_ignorepats is maintained the procedure is no
      longer efficient except for the first call (inc==NULL).  This
      functionality is replaced by two new functions implemented by vector
      macros.
      * ast_context_ignorepats_count (AST_VECTOR_SIZE)
      * ast_context_ignorepats_get (AST_VECTOR_GET)
      
      As with ast_walk_context_ignorepats callers of these functions are
      expected to have locked contexts.  Only a few places in Asterisk walked
      the ignorepats, they have been converted to use the new functions.
      
      Change-Id: I78f2157d275ef1b7d624b4ff7d770d38e5d7f20a
      e2e8713b
  27. Jul 15, 2016
    • Corey Farrell's avatar
      pbx: Create pbx_include.c for management of 'struct ast_include'. · be36bd7c
      Corey Farrell authored
      This changes context includes from a linked list to a vector, makes
      'struct ast_include' opaque to pbx.c.
      
      Although ast_walk_context_includes is maintained the procedure is no
      longer efficient except for the first call (inc==NULL).  This
      functionality is replaced by two new functions implemented by vector
      macros.
      * ast_context_includes_count (AST_VECTOR_SIZE)
      * ast_context_includes_get (AST_VECTOR_GET)
      
      As with ast_walk_context_includes callers of these functions are
      expected to have locked contexts.  Only a few places in Asterisk walked
      the includes, they have been converted to use the new functions.
      
      const have been applied where possible to parameters for ast_include
      functions.
      
      Change-Id: Ib5c882e27cf96fb2aec67a39c18b4c71c9c83b60
      be36bd7c
  28. May 15, 2016
    • Matt Jordan's avatar
      logger: Support JSON logging with Verbose messages · 35223765
      Matt Jordan authored
      When 2d7a4a33 was merged, it missed the fact that Verbose log messages
      are formatted and handled by 'verbosers'. Verbosers are registered
      functions that handle verbose messages only; they exist as a separate
      class of callbacks. This was done to handle the 'magic' that must be
      inserted into Verbose messages sent to remote consoles, so that the
      consoles can format the messages correctly, i.e., the leading
      tabs/characters.
      
      In reality, verbosers are a weird appendage: they're a separate class of
      formatters/message handlers outside of what handles all other log
      messages in Asterisk. After some code inspection, it became clear that
      simply passing a Verbose message along with its 'sublevel' importance
      through the normal logging mechanisms removes the need for verbosers
      altogether.
      
      This patch removes the verbosers, and makes the default log formatter
      aware that, if the log channel is a console log, it should simply insert
      the 'verbose magic' into the log messages itself. This allows the
      console handlers to interpret and format the verbose message
      themselves.
      
      This simplifies the code quite a lot, and should improve the performance
      of printing verbose messages by a reasonable factor:
      (1) It removes a number of memory allocations that were done on each
          verobse message
      (2) It removes the need to strip the verbose magic out of the verbose
          log messages before passing them to non-console log channels
      (3) It now performs fewer iterations over lists when handling verbose
          messages
      
      Since verbose messages are now handled like other log messages (for the
      most part), the JSON formatting of the messages works as well.
      
      ASTERISK-25425
      
      Change-Id: I21bf23f0a1e489b5102f8a035fe8871552ce4f96
      35223765
  29. Jun 05, 2015
    • David M. Lee's avatar
      Fixes for OS X · 9fca378b
      David M. Lee authored
       * Add some type casting so tv_usec can really be a long, instead of
         some strange platform specific type.
      
       * Add some .dylib style files to .gitignore.
      
       * Switch from using -Xlinker to -Wl,. For [reasons unknown][], newer
         versions of GCC, when compiling the Homebrew formula for Asterisk,
         are not properly passing the -Xlinker options to the linker. Given
         that -Wl, does exactly the [same thing][], and does it properly, this
         patch changes the -Xlinker options to use -Wl, instead.
      
       [reasons unknown]: http://bit.ly/1SUbEYx
       [same thing]: https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html
      
      Change-Id: Id5e6b3c6cc86282ea5fca630dc3991137c5bf4dd
      9fca378b
  30. May 20, 2015
    • Matt Jordan's avatar
      doxygen: Fix doxygen errors · d8698b7f
      Matt Jordan authored
      This patch fixes a number of errors and warning messages in the doxygen
      log. Specifically, it addresses:
      * A number of files incorrectly places a '\brief' tag immediately after
        a '\file' tag. Doing so emits a warning, as '\file' takes an optional
        argument specifying which file the doxygen comment is for. As '\brief'
        is not a file, doxygen was unamused.
      * A grouping of Stasis Topics and Messages in rtp_engine.h was
        incorrectly terminated. We now correctly terminate the grouping, which
        prevents members of rtp_engine.h from showing up in the wrong group.
      * Group indicators which are not part of the Stasis Topics and Messages
        group were removed. Group indicators without an \addtogroup or
        \ingroup have no meaning.
      
      Change-Id: Ia1415ffec6767e27233ae1cae5ed5970de5656d4
      d8698b7f
  31. May 14, 2015
    • Corey Farrell's avatar
      MALLOC_DEBUG: Replace WRAP_LIBC_MALLOC with ASTMM_LIBC. · 478fb4a3
      Corey Farrell authored
      There are 3 ways that calls directly to standard allocator functions can
      be dealt with:
      1. Block their use, cause them to generate an error.  This is the default.
      2. Replace them with the Asterisk equivalent function calls.
      3. Leave them alone.
      
      This change allows one of these 3 options to be selected by any source.
      The source just needs to define ASTMM_LIBC to ASTMM_BLOCK, ASTMM_REDIRECT,
      or ASTMM_IGNORE to use option 1, 2 or 3 respectively.  Normally ASTMM_BLOCK
      is the correct option, so it is default when ASTMM_LIBC is not defined.
      In some cases when building 3rd party code it is desirable to have it use
      Asterisk functions, without changing the whole source - ASTMM_REDIRECT
      accomplishes this.  When using 3rd party libraries sometimes a static
      inline function will make use of malloc or free.  In these cases it may
      be unsafe to replace the allocator in the header, as it's possible the
      memory could be freed by the library using standard allocators.  For
      those cases ASTMM_IGNORE is needed.
      
      Change-Id: I8afef4bc7f3b93914263ae27d3a5858b69663fc7
      478fb4a3
  32. May 05, 2015
    • Corey Farrell's avatar
      CLI: Enable automatic references to modules. · df6c1d75
      Corey Farrell authored
      * Pass module to ast_cli_register and ast_cli_register_multiple.
      * Add a module reference before executing any CLI callback, remove
        the reference when complete.
      
      ASTERISK-25049 #close
      Reported by: Corey Farrell
      
      Change-Id: I7aafc7c9f2b912918f28fe51d51e9e8a755750e3
      df6c1d75
    • Corey Farrell's avatar
      Modules: Make ast_module_info->self available to auxiliary sources. · a8bfa9e1
      Corey Farrell authored
      ast_module_info->self is often needed to register items with the core.  Many
      modules have ad-hoc code to make this pointer available to auxiliary sources.
      This change updates the module build process to make the needed information
      available to all sources in a module.
      
      ASTERISK-25056 #close
      Reported by: Corey Farrell
      
      Change-Id: I18c8cd58fbcb1b708425f6757becaeca9fa91815
      a8bfa9e1
  33. May 03, 2015
  34. Apr 13, 2015
    • David M. Lee's avatar
      Fixing extconf compile · a573b77f
      David M. Lee authored
      During the mass code deletion for clang support, a stray backslash was
      left behind that was causing utils to fail to compile.
      
      Change-Id: I60e5fa58c9a5b248bde23aaada79ff663f87a2a1
      a573b77f
    • Matt Jordan's avatar
      git migration: Refactor the ASTERISK_FILE_VERSION macro · 4a582616
      Matt Jordan authored
      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
      4a582616
  35. Apr 12, 2015
    • George Joseph's avatar
      Add .gitignore and .gitreview files · b35e184d
      George Joseph authored
      Add the .gitignore and .gitreview files to the asterisk repo.
      
      NB:  You can add local ignores to the .git/info/exclude file
      without having to do a commit.
      
      Common ignore patterns are in the top-level .gitignore file.
      Subdirectory-specific ignore patterns are in their own .gitignore
      files.
      
      Change-Id: I842a1588ff27d8a0189f12d597f0a7af033d6c69
      Tested-by: George Joseph
      b35e184d
  36. Apr 06, 2015
  37. Mar 28, 2015
Loading