Skip to content
Snippets Groups Projects
  1. Dec 03, 2013
  2. Nov 26, 2013
  3. Nov 16, 2013
  4. Oct 08, 2013
  5. Oct 03, 2013
  6. 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
  7. Sep 28, 2013
  8. Aug 30, 2013
    • David M. Lee's avatar
      optional_api: Fix linking problems between modules that export global symbols · 9bed50db
      David M. Lee authored
      With the new work in Asterisk 12, there are some uses of the
      optional_api that are prone to failure. The details are rather involved,
      and captured on [the wiki][1].
      
      This patch addresses the issue by removing almost all of the magic from
      the optional API implementation. Instead of relying on weak symbol
      resolution, a new optional_api.c module was added to Asterisk core.
      
      For modules providing an optional API, the pointer to the implementation
      function is registered with the core. For modules that use an optional
      API, a pointer to a stub function, along with a optional_ref function
      pointer are registered with the core. The optional_ref function pointers
      is set to the implementation function when it's provided, or the stub
      function when it's now.
      
      Since the implementation no longer relies on magic, it is now supported
      on all platforms. In the spirit of choice, an OPTIONAL_API flag was
      added, so we can disable the optional_api if needed (maybe it's buggy on
      some bizarre platform I haven't tested on)
      
      The AST_OPTIONAL_API*() macros themselves remained unchanged, so
      existing code could remain unchanged. But to help with debugging the
      optional_api, the patch limits the #include of optional API's to just
      the modules using the API. This also reduces resource waste maintaining
      optional_ref pointers that aren't used.
      
      Other changes made as a part of this patch:
       * The stubs for http_websocket that wrap system calls set errno to
         ENOSYS.
      
       * res_http_websocket now properly increments module use count.
      
       * In loader.c, the while() wrappers around dlclose() were removed. The
         while(!dlclose()) is actually an anti-pattern, which can lead to
         infinite loops if the module you're attempting to unload exports a
         symbol that was directly linked to.
      
       * The special handling of nonoptreq on systems without weak symbol
         support was removed, since we no longer rely on weak symbols for
         optional_api.
      
       [1]: https://wiki.asterisk.org/wiki/x/wACUAQ
      
      (closes issue ASTERISK-22296)
      Reported by: Matt Jordan
      Review: https://reviewboard.asterisk.org/r/2797/
      ........
      
      Merged revisions 397989 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      9bed50db
  9. Aug 23, 2013
  10. Aug 01, 2013
  11. Jul 03, 2013
    • David M. Lee's avatar
      Shuffle RESTful URL's around. · dcf03554
      David M. Lee authored
      This patch moves the RESTful URL's around to more appropriate
      locations for release.
      
      The /stasis URL's are moved to /ari, since Asterisk REST Interface was
      a more appropriate name than Stasis-HTTP. (Most of the code still has
      stasis_http references, but they will be cleaned up after there are no
      more outstanding branches that would have merge conflicts with such a
      change).
      
      A larger change was moving the ARI events WebSocket off of the shared
      /ws URL to its permanent home on /ari/events. The Swagger code
      generator was extended to handle "upgrade: websocket" and
      "websocketProtocol:" attributes on an operation.
      
      The WebSocket module was modified to better handle WebSocket servers
      that have a single registered protocol handler. If a client
      connections does not specify the Sec-WebSocket-Protocol header, and
      the server has a single protocol handler registered, the WebSocket
      server will go ahead and accept the client for that subprotocol.
      
      (closes issue ASTERISK-21857)
      Review: https://reviewboard.asterisk.org/r/2621/
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393528 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      dcf03554
  12. Jun 03, 2013
    • David M. Lee's avatar
      Correct autoconf script for finding UUID support. · 6d805dc0
      David M. Lee authored
      The library that provides UUID support varies greatly from system to
      system. On most Linux distros, it's in libuuid. On OpenBSD, it's in
      libe2fs-uuid. On OS X, it is in libsystem.
      
      This patch plays hide-and-seek with UUID support, looking for it in the
      three places we know about. It also corrects the Makefile so that it uses
      the configured library name and include path.
      
      (closes issue ASTERISK-21816)
      Reported by: Brad Latus (snuffy)
      Tested by: Brad Latus (snuffy)
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390352 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      6d805dc0
  13. May 15, 2013
  14. Mar 22, 2013
    • David M. Lee's avatar
      Move more channel events to Stasis; move res_json.c to main/json.c. · cf9324b2
      David M. Lee authored
      This patch started out simply as fixing the bouncing tests introduced
      in r382685, but required some other changes to give it a decent
      implementation.
      
      To fix the bouncing tests, the UserEvent and Newexten AMI events
      needed to be refactored to dispatch via Stasis. Dispatching directly
      to AMI resulted in those events sometimes getting ahead of the
      associated Newchannel events, which would understandably confuse anyone.
      
      I found that instead of creating a zillion different message types and
      structures associated with them, it would be preferable to define a
      message type that has a channel snapshot and a blob of structured data
      with a small bit of additional information. The JSON object model
      provides a very nice way of representing structured data, so I went
      with that.
      
       * Move JSON support from res_json.c to main/json.c
         * Made libjansson-dev a required dependency
       * Added an ast_channel_blob message type, which has a channel
         snapshot and JSON blob of data.
       * Changed UserEvent and Newexten events so that they are dispatched
         via ast_channel_blob messages on the channel's topic.
       * Got rid of the ast_channel_varset message; used ast_channel_blob
         instead.
       * Extracted the manager functions converting Stasis channel events to
         AMI events into manager_channel.c.
      
      (issue ASTERISK-21096)
      Review: https://reviewboard.asterisk.org/r/2381/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      cf9324b2
  15. Mar 12, 2013
  16. Feb 26, 2013
  17. Feb 22, 2013
  18. Jan 30, 2013
  19. Jan 19, 2013
  20. Jan 18, 2013
  21. Jan 11, 2013
    • Automerge script's avatar
      Merged revisions 378915,378918 via svnmerge from · 2c1720b4
      Automerge script authored
      file:///srv/subversion/repos/asterisk/trunk
      
      ................
        r378915 | dlee | 2013-01-11 16:31:42 -0600 (Fri, 11 Jan 2013) | 21 lines
        
        Add JSON API for Asterisk.
        
        This provides a JSON API by pulling in and wrapping the Jansson JSON
        library[1]. The Asterisk API basically mirrors the Jansson
        functionality, with a few minor tweaks.
        
         * Some names have been asteriskified to protect the innocent.
         * Jansson provides both reference-stealing and reference-borrowing
           versions of several API's. The Asterisk API is exclusively
           reference-stealing for operations that put elements into arrays and
           objects.
         * No support for doubles, since we usually don't need that.
         * Coming along for the ride is the ast_test_validate macro, which made
           the unit tests much easier to write.
        
         [1]: http://www.digip.org/jansson/
        
        (issue ASTERISK-20887)
        (closes issue ASTERISK-20888)
        Review: https://reviewboard.asterisk.org/r/2264/
      ................
        r378918 | file | 2013-01-11 17:05:38 -0600 (Fri, 11 Jan 2013) | 11 lines
        
        Retain XMPP filters across reconnections so external modules continue to function as expected.
        
        Previously if an XMPP client reconnected any filters added by an external module were lost.
        This issue exhibited itself with chan_motif not receiving and reacting to Jingle signaling.
        
        (closes issue ASTERISK-20916)
        Reported by: kuj
        ........
        
        Merged revisions 378917 from http://svn.asterisk.org/svn/asterisk/branches/11
      ................
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378927 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      2c1720b4
    • David M. Lee's avatar
      Add JSON API for Asterisk. · 7695ea26
      David M. Lee authored
      This provides a JSON API by pulling in and wrapping the Jansson JSON
      library[1]. The Asterisk API basically mirrors the Jansson
      functionality, with a few minor tweaks.
      
       * Some names have been asteriskified to protect the innocent.
       * Jansson provides both reference-stealing and reference-borrowing
         versions of several API's. The Asterisk API is exclusively
         reference-stealing for operations that put elements into arrays and
         objects.
       * No support for doubles, since we usually don't need that.
       * Coming along for the ride is the ast_test_validate macro, which made
         the unit tests much easier to write.
      
       [1]: http://www.digip.org/jansson/
      
      (issue ASTERISK-20887)
      (closes issue ASTERISK-20888)
      Review: https://reviewboard.asterisk.org/r/2264/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      7695ea26
  22. Dec 13, 2012
  23. Dec 11, 2012
  24. Oct 18, 2012
    • Richard Mudgett's avatar
      build_tools: Allow Asterisk to report git SHAs in version string. · b0c3d288
      Richard Mudgett authored
      Make git more attractive for managing work-in-progress.  Especially
      convenient when a potential patch set needs to be tested on multiple
      platforms since one can use git to keep all the test environments in sync
      independent of a subversion server.
      
      Now the Asterisk version will show the exact git SHA5 that was used when
      building (still appended by "M" if there are local modifications) from a
      git clone of the Asterisk repository so the developer can more easily know
      what is actually under test.
      
      You will now get this:
      
        $ asterisk -V
        Asterisk GIT-1698298
      
      Instead of this:
      
        $ asterisk -V
        Asterisk UNKNOWN__and_probably_unsupported
      
      This has zero impact for those not using git with the exception of an
      extra test in the configure script to gather git's path.  This is
      necessary to prevent "sudo make install" from failing since git may not be
      in the path in make's shell environment.
      
      (closes issue ASTERISK-20483)
      Reported by: Shaun Ruffell
      Patches:
            0001-build_tools-Allow-Asterisk-to-report-git-SHAs-in-ver.patch (license #5417) patch uploaded by Shaun Ruffell
            Modified
      ........
      
      Merged revisions 375189 from http://svn.asterisk.org/svn/asterisk/branches/1.8
      ........
      
      Merged revisions 375190 from http://svn.asterisk.org/svn/asterisk/branches/10
      ........
      
      Merged revisions 375191 from http://svn.asterisk.org/svn/asterisk/branches/11
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375192 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      b0c3d288
  25. Oct 13, 2012
  26. Sep 20, 2012
  27. Sep 18, 2012
  28. Aug 09, 2012
  29. Jul 25, 2012
  30. Jul 23, 2012
  31. Jun 25, 2012
    • Matthew Jordan's avatar
      Add AMI event documentation · 82a7409c
      Matthew Jordan authored
      This patch adds the core changes necessary to support AMI event documentation
      in the source files of Asterisk, and adds documentation to those AMI events
      defined in the core application modules.  Event documentation is built from
      the source by two new python scripts, located in build_tools:
      get_documentation.py and post_process_documentation.py.
      
      The get_documentation.py script mirrors the actions of the existing AWK
      get_documentation scripts, except that it will scan the entirety of a source
      file for Asterisk documentation.  Upon encountering it, if the documentation
      happens to be an AMI event, it will attempt to extract information about the
      event directly from the manager event macro calls that raise the event.  The
      post_process_documentation.py script combines manager event instances that
      are the same event but documented in multiple source files.  It generates
      the final core-[lang].xml file.
      
      As this process can take longer to complete than a typical 'make all', it
      is only performed if a new make target, 'full', is chosen.
      
      Review: https://reviewboard.asterisk.org/r/1967/
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      82a7409c
  32. Jun 01, 2012
  33. May 14, 2012
Loading