Skip to content
Snippets Groups Projects
  1. Jul 22, 2019
  2. Jul 19, 2019
  3. Jul 18, 2019
    • Walter Doekes's avatar
      sched: Don't allow ast_sched_del to deadlock ast_sched_runq from same thread · 3c6f1199
      Walter Doekes authored
      When fixing ASTERISK~24212, a change was done so a scheduled callback could not
      be removed while it was running. The caller of ast_sched_del would have to wait.
      
      However, when the caller of ast_sched_del is the callback itself (however wrong
      this might be), this new check would cause a deadlock: it would wait forever
      for itself.
      
      This changeset introduces an additional check: if ast_sched_del is called
      by the callback itself, it is immediately rejected (along with an ERROR log and
      a backtrace). Additionally, the AST_SCHED_DEL_UNREF macro is adjusted so the
      after-ast_sched_del-refcall function is only run if ast_sched_del returned
      success.
      
      This should fix the following spurious race condition found in chan_sip:
      - thread 1: schedule sip_poke_peer_now (using AST_SCHED_REPLACE)
      - thread 2: run sip_poke_peer_now
      - thread 2: blank out sched-ID (too soon!)
      - thread 1: set sched-ID (too late!)
      - thread 2: try to delete the currently running sched-ID
      
      After this fix, an ERROR would be logged, but no deadlocks (in do_monitor) nor
      excess calls to sip_unref_peer(peer) (causing double frees of rtp_instances and
      other madness) should occur.
      
      (Thanks Richard Mudgett for reviewing/improving this "scary" change.)
      
      Note that this change does not fix the observed race condition: unlocked
      access to peer->pokeexpire (and potentially other scheduled items in chan_sip),
      causing AST_SCHED_DEL_UNREF to look at a changing id. But it will make the
      deadlock go away. And in the observed case, it will not have adverse affects
      (like memory leaks) because the scheduled item is removed through a different
      path.
      
      ASTERISK-28282
      
      Change-Id: Ic26777fa0732725e6ca7010df17af77a012aa856
      3c6f1199
  4. Jul 16, 2019
    • George Joseph's avatar
      Build: Separate header install/uninstall · c781806e
      George Joseph authored
      Asterisk headers are no longer installed and uninstalled
      automatically when performing a "make install" or a
      "make uninstall".  To install/uninstall the headers, use
      "make install-headers" and "make uninstall-headers".
      The headers also continue to be uninstalled when performing a
      "make uninstall-all".
      
      Also corrects an issue where /usr/include/asterisk.h was never
      being removed at all.
      
      Change-Id: Ia7399f3a0203a4825fc4a9f43b9034dae9a2b643
      c781806e
  5. Jul 15, 2019
    • Kevin Harwell's avatar
      manager: Log AMI actions · ba25038f
      Kevin Harwell authored
      When manager debugging is turned on, this patch makes it so incoming AMI actions
      are now also logged.
      
      Change-Id: I8047524510e7ac97d99482b2448f8e368f29cd47
      ba25038f
  6. Jul 14, 2019
  7. Jul 12, 2019
  8. Jul 11, 2019
  9. Jul 09, 2019
    • Kevin Harwell's avatar
      app_voicemail: Remove dependency on the stasis cache · c93c5791
      Kevin Harwell authored
      app_voicemail utilized the stasis cache when polling mailboxes for MWI. This
      caused a memory leak (items were not being appropriately removed from the
      cache), and subsequent slowdown in system processing. This patch removes the
      stasis cache dependency, thus alleviating the memory leak. It does this by
      utilizing the new MWI API that better manages state lifetime.
      
      ASTERISK-28443
      ASTERISK-27121
      
      Change-Id: Ie89fedaca81ea1fd03d150d9d3a1ef3d53740e46
      c93c5791
  10. Jul 08, 2019
    • Kevin Harwell's avatar
      MWI: Update modules that subscribe to MWI to use new API calls · 9637e1df
      Kevin Harwell authored
      The MWI core recently got some new API calls that make tracking MWI state
      lifetime more reliable. This patch updates those modules that subscribe to
      specific MWI topics to use the new API. Specifically, these modules now
      subscribe to both MWI topics and MWI state.
      
      ASTERISK-28442
      
      Change-Id: I32bef880b647246823dbccdf44a98d384fcabfbd
      9637e1df
    • Kevin Harwell's avatar
      mwi: Update the MWI core to use stasis_state API · b31ac839
      Kevin Harwell authored
      ** Note **
      
      This patch is meant to be the minimum needed in order for the MWI core to use
      the now underlying stasis_state module. As such it does not completely remove
      its reliance on the stasis_cache. Doing so has allowed current consumers to
      not have to change, and update those code paths for this patch. When time
      allows, subsequent patches can/will be made to those consumers to take advantage
      of some of the new MWI API included here. Thus, eventually and ultimately
      removing MWI dependency on the stasis_cache.
      
      ** End Note **
      
      This patch makes it so the MWI core now takes advantage of the new stasis_state
      API. Consumers of MWI should no longer need to depend upon stasis topic pooling,
      and the stasis cache directly. Similar functionality and implementation details
      have now been pushed into the stasis_state module. However, all MWI state should
      be accessed via the MWI API itself.
      
      As such a few new methods, and constructs have been added to the MWI core that
      facilitate consumer publishing, subscribing, and iterating over MWI state data.
      
      * ast_mwi_subscriber *
      
      Created via ast_mwi_add_subscriber, a subscriber subscribes to a given mailbox
      in order to receive updates about the given mailbox. Adding a subscriber will
      create the underlying topic, and associated state data if those do not already
      exist for it. The topic, and last known state data is guaranteed to exist for
      the lifetime of the subscriber.
      
      * ast_mwi_publisher *
      
      Before publishing to a particular topic a publisher should be created. This can
      be achieved by using ast_mwi_add_publisher. Publishing to a mailbox should then
      be done using one of the MWI publish functions. This ensures the message is
      published to the appropriate topic, and the last known state is maintained.
      
      * ast_mwi_observer *
      
      Add an observer in order to watch for particular MWI module related events. For
      instance if a submodule needs to know when a subscription is added to any
      mailbox an observer can be added to watch for that.
      
      * other *
      
      Urgent message count is now part of the published MWI state object. Also state
      can be iterated over using defined callbacks.
      
      ASTERISK-28442
      
      Change-Id: I93f935f9090cd5ddff6d4bc80ff90703c05cf776
      b31ac839
    • Kevin Harwell's avatar
      stasis_state: Make unsubscribes NULL tolerant · 83c6ebba
      Kevin Harwell authored
      Regular stasis unsubscribes can handle NULL subscription objects. This patch
      makes it so stasis state unsubscribes handles NULL's as well.
      
      ASTERISK-28442
      
      Change-Id: Ic3648e8df043a85b77cff085e9ff10356028e479
      83c6ebba
  11. Jul 05, 2019
  12. Jul 02, 2019
  13. Jul 01, 2019
  14. Jun 28, 2019
    • Kevin Harwell's avatar
      stasis_state: Add new stasis_state module · 363bafc2
      Kevin Harwell authored
      This new module describes an API that can be thought of as a combination of
      stasis topic pools, and caching. Except, hopefully done in a more efficient
      and less memory "leaky" manner.
      
      The API defines methods, and data structures for managing, and tracking
      published message state through stasis. By adding a subscriber or publisher,
      consumers can more easily track the lifetime of the contained state. For
      instance, when no more publishers and/or subscribers have need of the topic,
      and associated state its data is removed from the managed container.
      
      * stasis_state_manager *
      
      The manager stores and well, manages state data. Each state is an association
      of a unique stasis topic, and the last known published stasis message on that
      topic. There is only ever one managed state object per topic. For each topic
      all messages are forwarded to an "all" topic also maintained by the manager.
      
      * stasis_state_subscriber *
      
      Topic and state can be created, or referenced within the manager by adding a
      stasis_state_subscriber. When adding a subscriber if no state currently exists
      new managed state is immediately created. If managed state already exists then
      a new subscriber is created referencing that state. The managed state is
      guaranteed to live throughout the subscriber's lifetime. State is only removed
      from the manager when no other entities require it.
      
      * stasis_state_publisher *
      
      Topic and state can be created, or referenced within the manager by also adding
      a stasis_state_publisher. When adding a publisher if no state currently exists
      new managed state is created. If managed state already exists then a new
      publisher is created referencing that state. The managed state is guaranteed to
      live throughout the publisher's lifetime. State is only removed from the
      manager when no other entities require it.
      
      * stasis_state_observer *
      
      Some modules may wish to watch for, and react to managed state events. By
      registering a state observer, and implementing handlers for the desired
      callbacks those modules can do so.
      
      * other *
      
      Callbacks also exist that allow consumers to iterate over all, or some of the
      managed state.
      
      ASTERISK-28442
      
      Change-Id: I7a4a06685a96e511da9f5bd23f9601642d7bd8e5
      363bafc2
    • Chris-Savinovich's avatar
      app_voicemail.c: Build all three variants for app_voicemail at the same time · 6b1f6ea2
      Chris-Savinovich authored
      Changes made to apps/Makefile to optionally build all three app_voicemail
      variations at the same time: 1) file (default), 2) odbc, and 3) imap.
      This functionality was requested by users. modules.conf.sample warns the
      user to make sure only one voicemail is loaded at a time.
      
      Change-Id: Iba3cd8ffb4b7e8b1c64a11dd383e1eafcd3ed0e7
      6b1f6ea2
  15. Jun 27, 2019
  16. Jun 25, 2019
Loading