Skip to content
Snippets Groups Projects
  1. May 03, 2015
    • Diederik de Groot's avatar
      Update configure.ac/Makefile for clang · 305ce3de
      Diederik de Groot authored
      Created autoconf/ast_check_raii.m4: contains AST_CHECK_RAII which
      checks compiler requirements for RAII:
      gcc: -fnested-functions support
      clang: -fblocks (and if required -lBlocksRuntime)
      The original check was implemented in configure.ac and now has it's
      own file. This function also sets C_COMPILER_FAMILY to either gcc or
      clang for use by makefile
      
      Created autoconf/ast_check_strsep_array_bounds.m4 (contains
      AST_CHECK_STRSEP_ARRAY_BOUNDS):
      which checks if clang is able to handle the optimized strsep & strcmp
      functions (linux). If not, the standard libc implementation should be
      used instead. Clang + the optimized macro's work with:
      strsep(char *, char []), but not with strsepo(char *, char *).
      Instead of replacing all the occurences throughout the source code,
      not using the optimized macro version seemed easier
      
      See 'define __strcmp_gc(s1, s2, l2) in bits/string2.h':
      llvm-comment: Normally, this array-bounds warning are suppressed for
      macros, so that unused paths like the one that accesses __s1[3] are
      not warned about.  But if you preprocess manually, and feed the
      result to another instance of clang, it will warn about all the
      possible forks of this particular if statement. Instead of switching
      of this optimization, another solution would be to run the preproces-
      sing step with -frewrite-includes, which should preserve enough
      information so that clang should still be able to suppress the diag-
      nostic at the compile step later on.
      
      See also "https://llvm.org/bugs/show_bug.cgi?id=20144"
      See also "https://llvm.org/bugs/show_bug.cgi?id=11536"
      
      Makefile.rules: If C_COMPILER_FAMILY=clang then add two warning
      suppressions:
      -Wno-unused-value
      -Wno-parentheses-equality
      In an earlier review (reviewboard: 4550 and 4554), they were deemed a
      nuisace and less than benefitial.
      
      configure.ac:
      Added AST_CHECK_RAII() see earlier
      Added AST_CHECK_STRSEP_ARRAY_BOUNDS() see earlier
      Removed moved content
      
      ASTERISK-24917
      Change-Id: I12ea29d3bda2254ad3908e279b7effbbac6a97cb
      305ce3de
  2. Apr 15, 2015
    • Joshua Colp's avatar
      res_pjsip: Add external PJSIP resolver implementation using core DNS API. · a3cec44a
      Joshua Colp authored
      This change adds the following:
      
      1. A query set implementation. This is an API that allows queries to be executed in parallel and once all have completed a callback is invoked.
      2. Unit tests for the query set implementation.
      3. An external PJSIP resolver which uses the DNS core API to do NAPTR, SRV, AAAA, and A lookups.
      
      For the resolver it will do NAPTR, SRV, and AAAA/A lookups in parallel. If NAPTR or SRV
      are available it will then do more queries. And so on. Preference is NAPTR > SRV > AAAA/A,
      with IPv6 preferred over IPv4. For transport it will prefer TLS > TCP > UDP if no explicit
      transport has been provided. Configured transports on the system are taken into account to
      eliminate resolved addresses which have no hope of completing.
      
      ASTERISK-24947 #close
      Reported by: Joshua Colp
      
      Change-Id: I56cb03ce4f9d3d600776f36928e0b3e379b5d71e
      a3cec44a
  3. Mar 25, 2015
  4. Mar 12, 2015
  5. Feb 25, 2015
  6. Jan 26, 2015
    • David M. Lee's avatar
      Various fixes for OS X · 965777cc
      David M. Lee authored
      This patch addresses compilation errors on OS X. It's been a while, so
      there's quite a few things.
      
       * Fixed __attribute__ decls in route.h to be portable.
       * Fixed htonll and ntohll to work when they are defined as macros.
       * Replaced sem_t usage with our ast_sem wrapper.
       * Added ast_sem_timedwait to our ast_sem wrapper.
       * Fixed some GCC 4.9 warnings using sig*set() functions.
       * Fixed some format strings for portability.
       * Fixed compilation issues with res_timing_kqueue (although tests still fail
         on OS X).
       * Fixed menuconfig /sbin/launchd detection, which disables res_timing_kqueue
         on OS X).
      
      ASTERISK-24539 #close
      Reported by: George Joseph
      
      ASTERISK-24544 #close
      Reported by: George Joseph
      
      Review: https://reviewboard.asterisk.org/r/4327/
      ........
      
      Merged revisions 431092 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      965777cc
  7. Jan 16, 2015
  8. Jan 15, 2015
    • Matthew Jordan's avatar
      configure: If cross-compiling, assume we have working semaphores · f11fb762
      Matthew Jordan authored
      The Asterisk 13 configure.ac checks for HAS_WORKING_SEMAPHORE but does not have
      an option for cross-compiling so it fails with an exit. Since we're cross-
      compiling, we can't exactly go looking for the header. The semaphore.h header
      is relatively common:
      * It's part of the POSIX standard
      * It's part of GNU C Library
      As such, we assume that it will be present when cross-compiling.
      
      As such, this patch defaults "HAS_WORKING_SEMAPHORE" to "1" if cross-compiling
      is detected.
      
      If you're cross-compiling to a platform that doesn't support this, then make
      sure you re-define this to 0.
      
      ASTERISK-24663 #close
      Reported by: abelbeck
      patches:
        asterisk-13-anonymous-semaphores.patch uploaded by abelbeck (License 5903)
      ........
      
      Merged revisions 430646 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430647 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      f11fb762
  9. Jan 13, 2015
  10. Oct 27, 2014
  11. Oct 19, 2014
  12. Aug 17, 2014
  13. Jul 21, 2014
  14. Jul 17, 2014
  15. Jul 04, 2014
  16. Jul 03, 2014
  17. Jun 20, 2014
  18. Jun 16, 2014
    • Richard Mudgett's avatar
      chan_dahdi: Adds support for major update to libss7. · 0c896d8b
      Richard Mudgett authored
      * SS7 support now requires libss7 v2.0 or later.  The new libss7 is not
      backwards compatible.
      
      * Added SS7 support for connected line and redirecting.
      
      * Most SS7 CLI commands are reworked as well as new SS7 commands added.
      See online CLI help.
      
      * Added several SS7 config option parameters described in
      chan_dahdi.conf.sample.
      
      * ISUP timer support reworked and now requires explicit configuration.
      See ss7.timers.sample.
      
      Special thanks to Kaloyan Kovachev for his support and persistence in
      getting the original patch by adomjan updated and ready for release.
      
      SS7-27 #close
      Reported by: adomjan
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      0c896d8b
  19. May 13, 2014
    • Richard Mudgett's avatar
      chan_dahdi/sig_pri: Prevent unnecessary PROGRESS events when overlap dialing is enabled. · 8b6ab478
      Richard Mudgett authored
      When overlap dialing is enabled, the lack of inband audio available
      information in the SETUP_ACKNOWLEDGE events causes an interoperability
      problem with SIP.  sig_pri doesn't know if there is dialtone present when
      a SETUP_ACKNOWLEDGE is received so it assumes it is there and posts an
      AST_CONTROL_PROGRESS frame.  The SIP channel driver then sends out a 183
      Session Progress and blocks the desired 180 Ringing message when the
      ALERTING message comes in.
      
      * Made the configure script detect if the installed version of libpri
      supports the SETUP_ACKNOWLEDGE enhancements.
      
      * Using the new API, made generate an AST_CONTROL_PROGRESS frame on an
      incoming SETUP_ACKNOWLEDGE message when the message indicates inband audio
      is present instead of assuming that dialtone is present.
      
      * Using the new API, made SETUP_ACKNOWLEDGE send out an inband audio
      available indication only if dialtone is expected.  The change also makes
      the fallback behaviour of sending the PROGRESS message better by sending
      it only if dialtone is expected.
      
      * Changed receiving a PROCEEDING message to not generate an
      AST_CONTROL_PROGRESS frame if the progress indication ie indicates
      non-end-to-end-ISDN.  This helps interoperability with SIP.
      
      * Changed sending a PROCEEDING message in response to an
      AST_CONTROL_PROCEEDING frame to not indicate inband audio available.  It
      was silly to do so anyway because the channel driver doesn't know if
      inband audio is even available.  This helps interoperability with SIP.
      
      This patch and a corresponding change in libpri work together to allow
      Asterisk to control the inband audio available progress indication ie on
      the SETUP_ACKNOWLEDGE message when dialtone is present.
      
      AST-1338 #close
      Reported by: Tyler Stewart
      
      Review: https://reviewboard.asterisk.org/r/3521/
      ........
      
      Merged revisions 413714 from http://svn.asterisk.org/svn/asterisk/branches/1.8
      ........
      
      Merged revisions 413765 from http://svn.asterisk.org/svn/asterisk/branches/11
      ........
      
      Merged revisions 413771 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      8b6ab478
  20. Apr 23, 2014
    • George Joseph's avatar
      This patch adds support for spinlocks in Asterisk. · 64045f0b
      George Joseph authored
      There are cases in Asterisk where it might be desirable to lock
      a short critical code section but not incur the context switch
      and yield penalty of a mutex or rwlock.  The primary spinlock
      implementations execute exclusively in userspace and therefore
      don't incur those penalties.  Spinlocks are NOT meant to be a
      general replacement for mutexes.  They should be used only for
      protecting short blocks of critical code such as simple compares
      and assignments.  Operations that may block, hold a lock, or
      cause the thread to give up it's timeslice should NEVER be
      attempted in a spinlock.
      
      The first use case for spinlocks is in astobj2 - internal_ao2_ref.
      Currently the manipulation of the reference counter is done with
      an ast_atomic_fetchadd_int which works fine.  When weak reference
      containers are introduced however, there's an additional comparison
      and assignment that'll need to be done while the lock is held.
      A mutex would be way too expensive here, hence the spinlock.
      Given that lock contention in this situation would be infrequent,
      the overhead of the spinlock is only a few more machine instructions
      than the current ast_atomic_fetchadd_int call.
      
      ASTERISK-23553 #close
      Review: https://reviewboard.asterisk.org/r/3405/
      ........
      
      Merged revisions 412976 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412977 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      64045f0b
  21. Mar 05, 2014
  22. Jan 28, 2014
  23. Jan 08, 2014
  24. Dec 03, 2013
  25. Nov 26, 2013
  26. Nov 16, 2013
  27. Oct 08, 2013
  28. Oct 03, 2013
  29. 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
  30. Sep 28, 2013
  31. 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
  32. Aug 23, 2013
  33. Aug 01, 2013
  34. 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
  35. 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
  36. May 15, 2013
  37. Apr 25, 2013
    • Mark Michelson's avatar
      Merge the pimp_my_sip branch into trunk. · 74f23180
      Mark Michelson authored
      The pimp_my_sip branch is being merged at this point because
      it offers basic functionality, and from an API standpoint, things
      are complete.
      
      SIP work is *not* feature-complete; however, with the completion
      of the SUBSCRIBE/NOTIFY API, all APIs (except a PUBLISH API) have
      been created, and thus it is possible for developers to attempt
      to create new SIP work.
      
      API documentation can be found in the doxygen in the code, but
      usability documentation is still lacking.
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      74f23180
  38. 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
Loading