Skip to content
Snippets Groups Projects
  1. Aug 12, 2013
    • Matthew Jordan's avatar
      Fix two race conditions and ref counting issue when joining a bridge · 63b5bf26
      Matthew Jordan authored
      These problems were all caught by a test in the Asterisk Test Suite that
      originated some Local channels and attempted to move the ;2 half of the Local
      channel into a bridge using the Bridge AMI action.
      
      (1) When originating a channel, the Newchannel event is emitted quickly;
          however, the ;2 channel will not have a pbx thread assigned to it until
          after the outbound 'dialing' for the ;1 is complete. Thus, there is a period
          of time where the outside world "knows" of the channel's existence and can
          influence it but Asterisk has not yet started the dialplan execution thread.
          If a Bridge AMI action is taken on the channel, the channel appears to be a
          Dialed channel with no PBX thread; hence, the channel will be imparted into
          the Bridge by first 'yanking' the channel. At the same time, a race condition
          can occur after the yank (but before entering the bridge) when ;1 answers
          and starts a PBX on the ;2. The end result currently is an assertion failure
          in the Bridging API, as a channel with a PBX is imparted into the Bridge.
      
          There's no way to prevent AMI from attempting to Bridge a channel
          immediately after creation; likewise, holding the channel lock through the
          entire Dial operation is unwise (and impossible). Instead of treating the
          presence of a PBX thread as an error, we simply bail out of the adding the
          channel to the bridge through ast_bridge_impart. The Bridge action will
          then fail - but we avoid a situation where the channel is both executing
          a PBX thread and simultaneously being given a separate thread in the
          bridging system (which would be a "bad thing"). Since imparting a channel
          with a PBX *can* occur and is not a programming error, the asserts have been
          removed.
      
      (2) When the first condition occurs, we have to take one of two actions: either
          hangup the yanked channel as it did not enter the bridge, or deref it
          because we don't own it. We can determine if we own it or not by testing
          for the presence of the PBX thread. If we hung it up directly, we'd crash.
      
      (3) bridge_find_channel does not increase the reference count of the
          ast_bridge_channel object. The RAII_VAR usage in ast_bridge_add_channel
          thus created a ticking time bomb in whatever bridge the channel moved into,
          as the destructor for the ast_bridge_channel object would be called.
      
      Review: https://reviewboard.asterisk.org/r/2741/
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396543 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      63b5bf26
    • Matthew Jordan's avatar
      Unlock outgoing dial lock on off nominal path · 5b013bc6
      Matthew Jordan authored
      If the thread servicing the dial request isn't created successfully, the
      outgoing dial lock will still be held when the function returns. This patch
      unlocks the lock on this off nominal path.
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      5b013bc6
  2. Aug 10, 2013
  3. Aug 09, 2013
  4. Aug 08, 2013
  5. Aug 06, 2013
    • David M. Lee's avatar
      ARI: Add recording controls · c7908487
      David M. Lee authored
      This patch implements the controls from ARI recordings. The controls
      are:
      
       * DELETE /recordings/live/{recordingName} - stop recording and
         discard it
       * POST /recordings/live/{recordingName}/stop - stop recording
       * POST /recordings/live/{recordingName}/pause - pause recording
       * POST /recordings/live/{recordingName}/unpause - resume recording
       * POST /recordings/live/{recordingName}/mute - mute recording (record
         silence to the file)
       * POST /recordings/live/{recordingName}/unmute - unmute recording.
      
      Since this underlying functionality did not already exist, is was
      added to app.c by a set of control frames, similar to how playback
      control works. The pause/mute control frames are toggles, even though
      the ARI controls are idempotent, to be consistent with the playback
      control frames.
      
      (closes issue ASTERISK-22181)
      Review: https://reviewboard.asterisk.org/r/2697/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      c7908487
    • David M. Lee's avatar
      Tweak caching topics to fix CEL tests · b97d318b
      David M. Lee authored
      The Stasis changes in r395954 had an unanticipated side effect: messages
      published directly to an _all topic does not get forwarded to the
      corresponding caching topic.
      
      This patch fixes that by changing how caching topics forward messages,
      and how the caching pattern forwards are setup.
      
      For the caching pattern, the all_topic is forwarded to the
      all_topic_cached. This forwards messages published directly to the
      all_topic to all_topic_cached.
      
      In order to avoid duplicate messages on all_topic_cached, caching topics
      were changed to no longer forward uncached messages. Subscribers to an
      individual caching topic should only expect to receive cache updates,
      and subscription change messages. Since individual caching topics are
      new, this shouldn't be a problem.
      
      There are a few minor changes to the pre-cache split behavior.
      
       * For topics changed to use the caching pattern, the all_topic_cached
         will forward snapshots in addition to cache updates. Since
         subscribers by design ignore unexpected messages, this should be
         fine.
      
       * Caching topics that don't use the caching pattern no longer forward
         non-cache updates. This makes no difference for the current caching
         topics.
      
         * mwi_topic_cached, channel_by_name_topic and
           presence_state_topic_cached have no subscribers
      
         * device_state_topic_cached's only subscriber only processes cache
           udpates
      
      (issue ASTERISK-22243)
      Review: https://reviewboard.asterisk.org/r/2738
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      b97d318b
    • Kinsey Moore's avatar
      Fix memory leaks in the CDR engine · 2e23bec4
      Kinsey Moore authored
      Fix refcount bugs and a possible locking problem in the CDR engine
      relating to use of ao2_iterators.
      
      Review: https://reviewboard.asterisk.org/r/2724/
      (closes issue ASTERISK-22126)
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396320 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      2e23bec4
    • Walter Doekes's avatar
      Check result of ast_var_assign() calls for memory allocation failure. · ccdfe67b
      Walter Doekes authored
      We try to keep the system running even when all available memory is
      spent.
      
      Review: https://reviewboard.asterisk.org/r/2734/
      ........
      
      Merged revisions 396279 from http://svn.asterisk.org/svn/asterisk/branches/1.8
      ........
      
      Merged revisions 396287 from http://svn.asterisk.org/svn/asterisk/branches/11
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      ccdfe67b
  6. Aug 05, 2013
  7. Aug 03, 2013
  8. Aug 02, 2013
  9. Aug 01, 2013
    • David M. Lee's avatar
      Fix sorcery for some rather picky regex implementations. · 23e86edf
      David M. Lee authored
      Some regex implementations won't compile an empty string. Assuming that
      it's equivalent of a regex that will match anything, use ".?" instead.
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396035 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      23e86edf
    • Matthew Jordan's avatar
      Support externally initiated parking requests; remove some dead code · 5c4b4824
      Matthew Jordan authored
      This patch does the following:
       * It adds support for externally initiated parking requests. In particular,
         chan_skinny has a protocol level message that initiates a call park.
         This patch now supports that option, as well as the protocol specific
         mechanisms in chan_dahdi/sig_analog and chan_mgcp.
       * A parking bridge features virtual table has been added that provides
         access to the parking functionality that the Bridging API needs. This
         includes requests to park an entire 'call' (with little or no additional
         information, thank you chan_skinny), perform a blind transfer to a parking
         extension, determine if an extension is a parking extension, as well as the
         actual "do the parking" request from the Bridging API.
       * Refactoring in chan_mgcp, chan_skinny, and chan_dahdi to make use of the new
         functions
       * The removal of some - but not all - dead parking code from features.c
      
      This also fixed blind transferring a multi-party bridge to a parking lot (which
      was implemented, but had at least one code path where using the parking features
      kK might not have worked)
      
      Review: https://reviewboard.asterisk.org/r/2710
      
      (closes issue ASTERISK-22134)
      Reported by: Matt Jordan
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      5c4b4824
    • Kinsey Moore's avatar
      Fix documentation replication issues · 03090a88
      Kinsey Moore authored
      This prevents XML documentation duplication by expanding channel and
      bridge snapshot tags into channel and bridge snapshot parameter sets
      with a given prefix or defaulting to no prefix. This also prevents
      documentation from becoming fractured and out of date by keeping all
      variations of the documentation in template form such that it only
      needs to be updated once and keeps maintenance to a minimum.
      
      Review: https://reviewboard.asterisk.org/r/2708/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      03090a88
    • David M. Lee's avatar
      Split caching out from the stasis_caching_topic. · e1b959cc
      David M. Lee authored
      In working with res_stasis, I discovered a significant limitation to
      the current structure of stasis_caching_topics: you cannot subscribe
      to cache updates for a single channel/bridge/endpoint/etc.
      
      To address this, this patch splits the cache away from the
      stasis_caching_topic, making it a first class object. The stasis_cache
      object is shared amongst individual stasis_caching_topics that are
      created per channel/endpoint/etc. These are still forwarded to global
      whatever_all_cached topics, so their use from most of the code does
      not change.
      
      In making these changes, I noticed that we frequently used a similar
      pattern for bridges, endpoints and channels:
      
           single_topic  ---------------->  all_topic
                 ^
                 |
           single_topic_cached  ----+---->  all_topic_cached
                                    |
                                    +---->  cache
      
      This pattern was extracted as the 'Stasis Caching Pattern', defined in
      stasis_caching_pattern.h. This avoids a lot of duplicate code between
      the different domain objects.
      
      Since the cache is now disassociated from its upstream caching topics,
      this also necessitated a change to how the 'guaranteed' flag worked
      for retrieving from a cache. The code for handling the caching
      guarantee was extracted into a 'stasis_topic_wait' function, which
      works for any stasis_topic.
      
      (closes issue ASTERISK-22002)
      Review: https://reviewboard.asterisk.org/r/2672/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395954 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      e1b959cc
  10. Jul 30, 2013
  11. Jul 29, 2013
  12. Jul 27, 2013
  13. Jul 26, 2013
Loading