Skip to content
Snippets Groups Projects
  1. Dec 20, 2013
  2. Dec 18, 2013
  3. Dec 17, 2013
  4. Dec 13, 2013
  5. Dec 05, 2013
  6. Dec 03, 2013
  7. Nov 27, 2013
    • David M. Lee's avatar
      ari:Add application/json parameter support · fccb427c
      David M. Lee authored
      The patch allows ARI to parse request parameters from an incoming JSON
      request body, instead of requiring the request to come in as query
      parameters (which is just weird for POST and DELETE) or form
      parameters (which is okay, but a bit asymmetric given that all of our
      responses are JSON).
      
      For any operation that does _not_ have a parameter defined of type
      body (i.e. "paramType": "body" in the API declaration), if a request
      provides a request body with a Content type of "application/json", the
      provided JSON document is parsed and searched for parameters.
      
      The expected fields in the provided JSON document should match the
      query parameters defined for the operation. If the parameter has
      'allowMultiple' set, then the field in the JSON document may
      optionally be an array of values.
      
      (closes issue ASTERISK-22685)
      Review: https://reviewboard.asterisk.org/r/2994/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403177 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      fccb427c
  8. Nov 22, 2013
  9. Oct 25, 2013
  10. Oct 24, 2013
  11. Oct 23, 2013
  12. Oct 03, 2013
  13. Oct 02, 2013
  14. Sep 30, 2013
    • David M. Lee's avatar
      Multiple revisions 399887,400138,400178,400180-400181 · 2de42c2a
      David M. Lee authored
      ........
        r399887 | dlee | 2013-09-26 10:41:47 -0500 (Thu, 26 Sep 2013) | 1 line
        
        Minor performance bump by not allocate manager variable struct if we don't need it
      ........
        r400138 | dlee | 2013-09-30 10:24:00 -0500 (Mon, 30 Sep 2013) | 23 lines
        
        Stasis performance improvements
        
        This patch addresses several performance problems that were found in
        the initial performance testing of Asterisk 12.
        
        The Stasis dispatch object was allocated as an AO2 object, even though
        it has a very confined lifecycle. This was replaced with a straight
        ast_malloc().
        
        The Stasis message router was spending an inordinate amount of time
        searching hash tables. In this case, most of our routers had 6 or
        fewer routes in them to begin with. This was replaced with an array
        that's searched linearly for the route.
        
        We more heavily rely on AO2 objects in Asterisk 12, and the memset()
        in ao2_ref() actually became noticeable on the profile. This was
        #ifdef'ed to only run when AO2_DEBUG was enabled.
        
        After being misled by an erroneous comment in taskprocessor.c during
        profiling, the wrong comment was removed.
        
        Review: https://reviewboard.asterisk.org/r/2873/
      ........
        r400178 | dlee | 2013-09-30 13:26:27 -0500 (Mon, 30 Sep 2013) | 24 lines
        
        Taskprocessor optimization; switch Stasis to use taskprocessors
        
        This patch optimizes taskprocessor to use a semaphore for signaling,
        which the OS can do a better job at managing contention and waiting
        that we can with a mutex and condition.
        
        The taskprocessor execution was also slightly optimized to reduce the
        number of locks taken.
        
        The only observable difference in the taskprocessor implementation is
        that when the final reference to the taskprocessor goes away, it will
        execute all tasks to completion instead of discarding the unexecuted
        tasks.
        
        For systems where unnamed semaphores are not supported, a really
        simple semaphore implementation is provided. (Which gives identical
        performance as the original taskprocessor implementation).
        
        The way we ended up implementing Stasis caused the threadpool to be a
        burden instead of a boost to performance. This was switched to just
        use taskprocessors directly for subscriptions.
        
        Review: https://reviewboard.asterisk.org/r/2881/
      ........
        r400180 | dlee | 2013-09-30 13:39:34 -0500 (Mon, 30 Sep 2013) | 28 lines
        
        Optimize how Stasis forwards are dispatched
        
        This patch optimizes how forwards are dispatched in Stasis.
        
        Originally, forwards were dispatched as subscriptions that are invoked
        on the publishing thread. This did not account for the vast number of
        forwards we would end up having in the system, and the amount of work it
        would take to walk though the forward subscriptions.
        
        This patch modifies Stasis so that rather than walking the tree of
        forwards on every dispatch, when forwards and subscriptions are changed,
        the subscriber list for every topic in the tree is changed.
        
        This has a couple of benefits. First, this reduces the workload of
        dispatching messages. It also reduces contention when dispatching to
        different topics that happen to forward to the same aggregation topic
        (as happens with all of the channel, bridge and endpoint topics).
        
        Since forwards are no longer subscriptions, the bulk of this patch is
        simply changing stasis_subscription objects to stasis_forward objects
        (which, admittedly, I should have done in the first place.)
        
        Since this required me to yet again put in a growing array, I finally
        abstracted that out into a set of ast_vector macros in
        asterisk/vector.h.
        
        Review: https://reviewboard.asterisk.org/r/2883/
      ........
        r400181 | dlee | 2013-09-30 13:48:57 -0500 (Mon, 30 Sep 2013) | 28 lines
        
        Remove dispatch object allocation from Stasis publishing
        
        While looking for areas for performance improvement, I realized that an
        unused feature in Stasis was negatively impacting performance.
        
        When a message is sent to a subscriber, a dispatch object is allocated
        for the dispatch, containing the topic the message was published to, the
        subscriber the message is being sent to, and the message itself.
        
        The topic is actually unused by any subscriber in Asterisk today. And
        the subscriber is associated with the taskprocessor the message is being
        dispatched to.
        
        First, this patch removes the unused topic parameter from Stasis
        subscription callbacks.
        
        Second, this patch introduces the concept of taskprocessor local data,
        data that may be set on a taskprocessor and provided along with the data
        pointer when a task is pushed using the ast_taskprocessor_push_local()
        call. This allows the task to have both data specific to that
        taskprocessor, in addition to data specific to that invocation.
        
        With those two changes, the dispatch object can be removed completely,
        and the message is simply refcounted and sent directly to the
        taskprocessor.
        
        Review: https://reviewboard.asterisk.org/r/2884/
      ........
      
      Merged revisions 399887,400138,400178,400180-400181 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      2de42c2a
  15. Sep 27, 2013
  16. Sep 24, 2013
    • Matthew Jordan's avatar
      Fix a performance problem CDRs · e7d49d28
      Matthew Jordan authored
      There is a large performance price currently in the CDR engine. We currently
      perform two ao2_callback calls on a container that has an entry for every
      channel in the system. This is done to create matching pairs between channels
      in a bridge.
      
      As such, the portion of the CDR logic that this patch deals with is how we
      make pairings when a channel enters a mixing bridge. In general, when a
      channel enters such a bridge, we need to do two things:
       (1) Figure out if anyone in the bridge can be this channel's Party B.
       (2) Make pairings with every other channel in the bridge that is not already
           our Party B.
      
      This is a two step process. In the first step, we look through everyone in the
      bridge and see if they can be our Party B (single_state_process_bridge_enter).
      If they can - yay! We mark our CDR as having gotten a Party B. If not, we keep
      searching. If we don't find one, we wait until someone joins who can be our
      Party B.
      
      Step 2 is where we changed the logic
      (handle_bridge_pairings and bridge_candidate_process). Previously, we would
      first find candidates - those channels in the bridge with us - from the
      active_cdrs_by_channel container. Because a channel could be a candidate if it
      was Party B to an item in the container, the code implemented multiple
      ao2_container callbacks to get all the candidates. We also had to store them
      in another container with some other meta information. This was rather complex
      and costly, particularly if you have 300 Local channels (600 channels!) going
      at once.
      
      Luckily, none of it is needed: when a channel enters a bridge (which is when
      we're figuring all this stuff out), the bridge snapshot tells us the unique
      IDs of everyone already in the bridge. All we need to do is:
       For all channels in the bridge:
         If the channel is us or our Party B that we got in step 1, skip it
         Compare us and the candidate to figure out who is Party A (based on some
             specific rules)
         If we are Party A:
            Make a new CDR for us, append it to our chain, and set the candidate as
                Party B
         If they are Party A:
            If they don't have a Party B:
              Make a new CDR for them, append us to their chain, and us as Party B
            Otherwise:
              Copy us over as Party B on their existing CDR.
      
      This patch does that.
      
      Because we now use channel unique IDs to find the candidates during bridging,
      active_cdrs_by_channel now looks up things using uniqueid instead of channel
      name. This makes the more complex code simpler; it does, however, have the
      drawback that dialplan applications and functions will be slightly slower as
      they have to iterate through the container looking for the CDR by name.
      That's a small price to pay however as the bridging code will be called a lot
      more often.
      
      This patch also does two other minor changes:
       (1) It reduces the container size of the channels in a bridge snapshot to 1.
           In order to be predictable for multi-party bridges, the order of the
           channels in the container must be stable; that is, it must always devolve
           to a linked list.
       (2) CDRs and the multi-party test was updated to show the relationship between
           two dialed channels. You still want to know if they talked - previously,
           dialed channels were always ignored, which is wrong when they have
           managed to get a Party B.
      
      (closes issue ASTERISK-22488)
      Reported by: Richard Mudgett
      
      Review: https://reviewboard.asterisk.org/r/2861/
      ........
      
      Merged revisions 399666 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399667 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      e7d49d28
  17. Sep 16, 2013
  18. Sep 13, 2013
    • Richard Mudgett's avatar
      Restore Dial, Queue, and FollowMe 'I' option support. · 2a371cd8
      Richard Mudgett authored
      The Dial, Queue, and FollowMe applications need to inhibit the bridging
      initial connected line exchange in order to support the 'I' option.
      
      * Replaced the pass_reference flag on ast_bridge_join() with a flags
      parameter to pass other flags defined by enum ast_bridge_join_flags.
      
      * Replaced the independent flag on ast_bridge_impart() with a flags
      parameter to pass other flags defined by enum ast_bridge_impart_flags.
      
      * Since the Dial, Queue, and FollowMe applications are now the only
      callers of ast_bridge_call() and ast_bridge_call_with_flags(), changed the
      calling contract to require the initial COLP exchange to already have been
      done by the caller.
      
      * Made all callers of ast_bridge_impart() check the return value.  It is
      important.  As a precaution, I also made the compiler complain now if it
      is not checked.
      
      * Did some cleanup in parking_tests.c as a result of checking the
      ast_bridge_impart() return value.
      
      An independent, but associated change is:
      * Reduce stack usage in ast_indicate_data() and add a dropping redundant
      connected line verbose message.
      
      (closes issue ASTERISK-22072)
      Reported by: Joshua Colp
      
      Review: https://reviewboard.asterisk.org/r/2845/
      ........
      
      Merged revisions 399136 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      2a371cd8
  19. Sep 08, 2013
  20. Sep 04, 2013
  21. Aug 30, 2013
  22. Aug 25, 2013
  23. Aug 23, 2013
  24. Aug 22, 2013
  25. Aug 17, 2013
  26. Aug 16, 2013
    • Richard Mudgett's avatar
      Doxygen comment tweaks. · e47d3db3
      Richard Mudgett authored
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      e47d3db3
    • David M. Lee's avatar
      Stasis: address refcount races; implementation comments · f29d969a
      David M. Lee authored
      Change r395954 reordered some stasis object destruction, which should
      have been fine. Unfortunately, it caused some hard to reproduce issues
      related to objects being accessed after they had been destroyed. The
      patch in r396329 fixed the destruction order problem; this patch
      addresses the underlying issue. A few other stasis-related fixes were
      also added.
      
       * Add ref-bumps around areas where objects may get transitively
         destroyed. (For example, where we lock a topic, unref a subscription,
         which unrefs the topic, which explodes the topic when we try to
         unlock it.)
      
       * Wrote an extensive doxygen page about Stasis implementation,
         relationships between objects, lifecycles of objects, how the
         refcounting works, etc. Many other comments were added, corrected, or
         cleaned up.
      
       * Added an assert to the topic dtor to catch extra ref decrements.
      
       * Fixed type used after destruction errors for graceful shutdown in
         stasis_channels.c.
      
       * I added two unit tests in an attempt to catch destruction order
         issues. Since the underlying cause is a race condition, though, the
         tests rarely failed even when the code was wrong.
      
       * Fixed a leak in stasis_cache_pattern.c.
      
      (closes issue ASTERISK-22243)
      Review: https://reviewboard.asterisk.org/r/2746/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396842 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      f29d969a
  27. Aug 14, 2013
  28. Aug 13, 2013
Loading