Skip to content
Snippets Groups Projects
  1. 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
      Unverified
      4c19b949
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. Dec 22, 2017
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. May 03, 2015
  17. 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
  18. Apr 06, 2015
  19. Mar 28, 2015
  20. Sep 26, 2014
  21. Apr 04, 2014
    • Richard Mudgett's avatar
      internal_timing: Remove the option and always make it enabled if a timing module is loaded. · 03beadb6
      Richard Mudgett authored
      The masquerade supertest frequently fails because either the local channel
      chain doesn't completely optimize out or the DTMF handshake doesn't
      completely get accross.  Local channel optimization requires frames
      flowing to trigger when optimization can happen.  When optimization
      happens the media frame that triggered the optimization is dropped.
      Sending DTMF requires frames to flow in the other direction for timing
      purposes while sending nothing.  If internal timing is not enabled when
      MOH is playing, Asterisk switches to received timing when an audio frame
      is received.  With optimization dropping media frames and MOH not sending
      frames unless it receives frames, occasionaly there are no more frames
      being passed and the test fails.
      
      * The asterisk command line -I option and the asterisk.conf
      internal_timing option are removed.  Asterisk now always uses internal
      timing when needed if any timing module is loaded.  The issue
      ASTERISK-14861 did this quite awhile ago in v1.4 but effectively is broken
      if other internal timing modules besides DAHDI are used.  The
      ast_read_generator_actions() now only does received timing if it has no
      choice for frame generators like MOH, silence, and playback streaming.
      
      * Cleaned up some code dealing with frame generators in
      ast_deactivate_generator(), generator_write_format_change(),
      ast_activate_generator(), and ast_channel_stop_silence_generator().
      
      * Removed ast_internal_timing_enabled(), AST_OPT_FLAG_INTERNAL_TIMING, and
      ast_opt_internal_timing.
      
      ASTERISK-22846 #close
      Reported by: Matt Jordan
      
      Review: https://reviewboard.asterisk.org/r/3414/
      ........
      
      Merged revisions 411715 from http://svn.asterisk.org/svn/asterisk/branches/1.8
      ........
      
      Merged revisions 411716 from http://svn.asterisk.org/svn/asterisk/branches/11
      ........
      
      Merged revisions 411717 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411724 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      03beadb6
  22. Feb 22, 2014
  23. Jan 22, 2014
  24. Nov 08, 2013
    • Kevin Harwell's avatar
      app_dahdiras: Use waitpid instead of wait4. · 2564ed26
      Kevin Harwell authored
      Several places in the code were using wait4 while other places were using
      waitpid.  This change makes all places use waitpid in order to make things
      more consistent and since the 'rusage' object passed in/out of wait4 was
      never used.
      
      (closes issue ASTERISK-22557)
      Reported by: YvesGael
      Patches:
           asterisk-11.5.1-wait4.patch uploaded by hurdman (license 6537)
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      2564ed26
  25. Aug 06, 2013
  26. Aug 05, 2013
  27. Jun 08, 2013
    • Matthew Jordan's avatar
      Add backtrace generation to MALLOC_DEBUG memory corruption reports · c43f380d
      Matthew Jordan authored
      This patch allows astmm to access the backtrace generation code in Asterisk.
      When memory is allocated, a backtrace is created and stored with the memory
      region that tracks the allocation. If a memory corruption is detected, the
      backtrace is printed to the astmm log. The backtrace will make use of the
      BETTER_BACKTRACES build option if available.
      
      As a result, this patch moves the backtrace generation code into its own file
      and uses the non-wrapped versions of the C library memory allocation routines.
      This allows the memory allocation code to safely use the backtrace generation
      routines without infinitely recursing.
      
      Review: https://reviewboard.asterisk.org/r/2567
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      c43f380d
  28. Nov 16, 2012
  29. Oct 14, 2012
  30. Aug 01, 2012
  31. Jul 31, 2012
  32. Apr 19, 2012
    • Matthew Jordan's avatar
      Fix a variety of potential buffer overflows · f7829006
      Matthew Jordan authored
      * chan_mobile: Fixed an overrun where the cind_state buffer (an integer array
        of size 16) would be overrun due to improper bounds checking. At worst, the
        buffer can be overrun by a total of 48 bytes (assuming 4-byte integers),
        which would still leave it within the allocated memory of struct hfp.  This
        would corrupt other elements in that struct but not necessarily cause any
        further issues.
      
      * app_sms: The array imsg is of size 250, while the array (ud) that the data
        is copied into is of size 160.  If the size of the inbound message is 
        greater then 160, up to 90 bytes could be overrun in ud.  This would corrupt
        the user data header (array udh) adjacent to ud.
      
      * chan_unistim: A number of invalid memmoves are corrected.  These would move
        data (which may or may not be valid) into the ends of these buffers.
      
      * asterisk: ast_console_toggle_loglevel does not check that the console log
        level being set is less then or equal to the allowed log levels of 32.
      
      * format_pref: In ast_codec_pref_prepend, if any occurrence of the specified
        codec is not found, the value used to index into the array pref->order
        would be one greater then the maximum size of the array.
      
      * jitterbuf: If the element being placed into the jitter buffer lands in the
        last available slot in the jitter history buffer, the insertion sort attempts
        to move the last entry in the buffer into one slot past the maximum length
        of the buffer.  Note that this occurred for both the min and max jitter
        history buffers.
      
      * tdd: If a read from fsk_serial returns a character that is greater then 32,
        an attempt to read past one of the statically defined arrays containing the
        values that character maps to would occur.
      
      * localtime: struct ast_time and tm are not the same size - ast_time is larger,
        although it contains the elements of tm within it in the same layout.  Hence,
        when using memcpy to copy the contents of tm into ast_time, the size of tm
        should be used, as opposed to the size of ast_time.
      
      * extconf: this treats ast_timing's minmask array as if it had a length of 48,
        when it has defined the size of the array as 24.  pbx.h defines minmask as
        having a size of 48.
      
      (issue ASTERISK-19668)
      Reported by: Matt Jordan
      ........
      
      Merged revisions 362485 from http://svn.asterisk.org/svn/asterisk/branches/1.8
      ........
      
      Merged revisions 362496 from http://svn.asterisk.org/svn/asterisk/branches/10
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      f7829006
  33. Jan 15, 2012
  34. Jul 14, 2011
  35. Feb 04, 2011
  36. Jun 10, 2010
  37. Jun 08, 2010
  38. Jun 02, 2010
Loading