Skip to content
Snippets Groups Projects
  1. Nov 11, 2017
    • Richard Mudgett's avatar
      core: Add cache_media_frames debugging option. · 90bb0a3e
      Richard Mudgett authored
      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
      90bb0a3e
  2. Nov 10, 2017
  3. Nov 08, 2017
    • Richard Mudgett's avatar
      AST-2017-010: Fix cdr_object_update_party_b_userfield_cb() buf overrun · b358e441
      Richard Mudgett authored
      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
      b358e441
  4. Nov 07, 2017
  5. Nov 06, 2017
    • Corey Farrell's avatar
      stasis: Release object if vector append fails. · adb4fdcb
      Corey Farrell authored
      Change-Id: I3e5cc669169aab6175ddfaf7486edeaeb4fdcfb1
      adb4fdcb
    • Corey Farrell's avatar
      RTP Engine: Deal with errors returned from AST_VECTOR_REPLACE. · 2f4f2160
      Corey Farrell authored
      Check for errors from AST_VECTOR_REPLACE and clean memory if needed.
      
      Change-Id: I124d15cc1d645f85a72a1279f623c1993b304b0b
      2f4f2160
    • Corey Farrell's avatar
      PBX: Handle errors from AST_VECTOR_APPEND. · 5762f724
      Corey Farrell authored
      This resolves potentials leaks on AST_VECTOR_APPEND error in:
      * ast_context_add_include2
      * ast_context_add_switch2
      * ast_context_add_ignorepat2
      
      Change-Id: Ib60e95c4f622fa3b832d87227c0523a695d736b6
      5762f724
    • Corey Farrell's avatar
      Messaging: Report error on failure to register tech or handler. · 714026b3
      Corey Farrell authored
      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
      714026b3
    • Corey Farrell's avatar
      format_cap: Fix leak on AST_VECTOR_APPEND error. · e43c8af7
      Corey Farrell authored
      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
      e43c8af7
    • Corey Farrell's avatar
      stasis: Remove silly use of RAII_VAR in stasis_forward_all. · 64bcb65a
      Corey Farrell authored
      Change-Id: I46de4c968d40144d5b049966304ff66c1469fb65
      64bcb65a
    • Corey Farrell's avatar
      CLI: Remove unused internal command. · b7e10340
      Corey Farrell authored
      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
      b7e10340
    • Richard Mudgett's avatar
      stasis_bridges.c: Fix off-nominal json memory leaks. · 92342401
      Richard Mudgett authored
      Change-Id: Ib1181a36b317c86bff1ef2e44a17a0b1c73cfdc8
      92342401
    • Richard Mudgett's avatar
      stasis_channels.c: Remove a very silly RAII_VAR(). · f81970d3
      Richard Mudgett authored
      Change-Id: I28b458b3c1a442c4ef0be7b4986a95ea4149e14f
      f81970d3
    • Richard Mudgett's avatar
      Fix ast_(v)asprintf() malloc failure usage conditions. · ee08f10d
      Richard Mudgett authored
      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
      ee08f10d
    • Sean Bright's avatar
      dtls: Add support for ephemeral DTLS certificates. · 04d3785a
      Sean Bright authored
      This mimics the behavior of Chrome and Firefox and creates an ephemeral
      X.509 certificate for each DTLS session.
      
      Currently, the only supported key type is ECDSA because of its faster
      generation time, but other key types can be added in the future as
      necessary.
      
      ASTERISK-27395
      
      Change-Id: I5122e5f4b83c6320cc17407a187fcf491daf30b4
      04d3785a
    • Alexander Traud's avatar
      tcptls: Print notice when TLS is enabled but not configured. · 19332e69
      Alexander Traud authored
      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
      19332e69
  6. Nov 03, 2017
  7. Nov 02, 2017
    • Joshua Colp's avatar
      core: Don't attempt to write to a stream that does not exist. · 87014793
      Joshua Colp authored
      When a frame is provided to ast_write ensure that a multistream
      capable channel has a stream for it before attempting to give it
      to the channel driver. In some cases (such as a deferred SDP
      negotiation) the stream may not yet exist.
      
      ASTERISK-27364
      
      Change-Id: Icf84ca982a67cdd6e9a71851eb7eb1bd0e865276
      87014793
  8. Nov 01, 2017
    • Corey Farrell's avatar
      Modules: Additional improvements to CLI completion. · b9f457ea
      Corey Farrell authored
      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
      b9f457ea
  9. Oct 31, 2017
    • Kevin Harwell's avatar
      features: Bridge application's BRIDGERESULT not appropriately set · 1e700117
      Kevin Harwell authored
      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
      1e700117
  10. Oct 30, 2017
    • Joshua Colp's avatar
      core / pjsip: Add support for grouping streams together. · 4c535f5c
      Joshua Colp authored
      In WebRTC streams (or media tracks in their world) can be grouped
      together using the mslabel. This informs the browser that each
      should be synchronized with each other.
      
      This change extends the stream API so this information can
      be stored with streams. The PJSIP support has been extended
      to use the mslabel to determine grouped streams and store
      this association on the streams. Finally when creating the
      SDP the group information is used to cause each media stream
      to use the same mslabel.
      
      ASTERISK-27379
      
      Change-Id: Id6299aa031efe46254edbdc7973c534d54d641ad
      4c535f5c
    • Corey Farrell's avatar
      Modules: Fix issues with CLI completion. · e82b921c
      Corey Farrell authored
      * 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
      e82b921c
  11. Oct 26, 2017
    • Richard Mudgett's avatar
      codec.c: Defensively check the returned samples. · 2ca3dbb1
      Richard Mudgett authored
      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
      2ca3dbb1
  12. Oct 25, 2017
    • Ben Ford's avatar
      http.c: Fix http header send content. · 3821be1c
      Ben Ford authored
      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
      3821be1c
    • Corey Farrell's avatar
      Build System: Fix --disable-xmldoc option. · 5553adb8
      Corey Farrell authored
      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
      5553adb8
  13. Oct 24, 2017
    • Corey Farrell's avatar
      Single API for ast_store_lock_info and ast_remove_lock_info. · 569e9a83
      Corey Farrell authored
      This makes the 'bt' parameter unconditional for ast_store_lock_info and
      ast_remove_lock_info.  The 'bt' parameter is unused when HAVE_BKTR is
      undefined.
      
      Change-Id: Ieced0e920928b735a39c3b5952b806c473d67453
      569e9a83
    • Corey Farrell's avatar
      hashtab: Use ast_free. · 841ac3de
      Corey Farrell authored
      A few places in hashtab use free instead of ast_free, remove declaration
      of ASTMM_LIBC from hashtab.c as it's no longer needed.
      
      Change-Id: I2ff089bad71640c03c3ce97f1b00fc962ef79427
      841ac3de
  14. Oct 23, 2017
  15. Oct 16, 2017
    • Richard Mudgett's avatar
      cdr.c: Rename the Party A CDR container. · 73164d0d
      Richard Mudgett authored
      * 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
      73164d0d
    • Richard Mudgett's avatar
      cdr.c: Add container to key off of Party B channel names. · fe1120cf
      Richard Mudgett authored
      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
      fe1120cf
  16. Oct 13, 2017
    • Corey Farrell's avatar
      ast_bt_get_symbols: Prevent double-free. · ee65d5ac
      Corey Farrell authored
      It's possible for bfdobj to be created but syms not created.  If syms
      was not allocated in the current loop iteration but was allocated in the
      previous iteration it would crash.
      
      ASTERISK-27340
      
      Change-Id: I5b110c609f6dfe91339f782a99a431bca5837363
      ee65d5ac
    • Alexander Traud's avatar
      tcptls: NULL-check the parameter of ast_ssl_teardown before accessing it. · 44d9446e
      Alexander Traud authored
      This avoids a crash on stopping a chan_sip which failed to start its TLS server.
      
      ASTERISK-27339 #close
      
      Change-Id: I327fc70db68eaaca5b50a15c7fd687fde79263d5
      44d9446e
    • Richard Mudgett's avatar
      cdr.c: Eliminated many calls to ao2_global_obj_ref(). · f369be21
      Richard Mudgett authored
      The CDR performance gets worse the further it gets behind in processing
      stasis messages.  One of the reasons is we were getting the global config
      to determine if we needed to log a debugging message.
      
      * Many calls to ao2_global_obj_ref() were just so we could determine if
      debug mode is enabled.  Made a global flag to check instead.
      
      * Eliminated many RAII_VAR() usages associated with the remaining
      ao2_global_obj_ref() calls.
      
      * Added missing NULL checks for the returned ao2_global_obj_ref() value.
      
      ASTERISK-27335
      
      Change-Id: Iceaad93172862f610cad0188956634187bfcc7cd
      f369be21
    • Richard Mudgett's avatar
      cdr.c: Defer getting ao2_global_obj_ref() until needed. · 2eea0874
      Richard Mudgett authored
      The CDR performance gets worse the further it gets behind in processing
      stasis messages.  One of the reasons is we were getting the global config
      even if we didn't need it.
      
      * Most uses of the global config were only needed on off nominal code
      paths so it makes sense to not get it until absolutely needed.
      
      ASTERISK-27335
      
      Change-Id: I00c63b7ec233e5bfffd5d976f05568613d3c2365
      2eea0874
    • Richard Mudgett's avatar
      cdr.c: Set stringfields only if they are different. · 7c7a9178
      Richard Mudgett authored
      The CDR performance gets worse the further it gets behind in processing
      stasis messages.  One of the reasons is we were repeatedly setting string
      fields to potentially the same string in base_process_party_a().  Setting
      a string field involves allocating room for the new string out of a memory
      pool which may have to allocate even more memory.
      
      * Check to see if the string field is already set to the desired string.
      
      ASTERISK-27335
      
      Change-Id: I3ccb7e23f1488417e08cafe477755033eed65a7c
      7c7a9178
    • Richard Mudgett's avatar
      cdr.c: Fix setting dnid, callingsubaddr, and calledsubaddr · c80c8f2a
      Richard Mudgett authored
      The string comparisons for setting these CDR variables was inverted.  We
      were repeatedly setting these CDR variables only if the channel snapshots
      had the same value.
      
      ASTERISK-27335
      
      Change-Id: I9482073524411e7ea6c03805b16de200cb1669ea
      c80c8f2a
  17. Oct 12, 2017
Loading