Skip to content
Snippets Groups Projects
  1. May 07, 2015
    • George Joseph's avatar
      vector: Additional enhancements and fixes · c886be5d
      George Joseph authored
      After using the new vector stuff for real I found...
      
      A bug in AST_VECTOR_INSERT_AT that could cause a seg fault.
      
      The callbacks needed to be closer to ao2_callback in behavior
      WRT to CMP_MATCH and CMP_STOP behavior and the ability to return
      a vector of matched entries.
      
      A pre-existing issue with APPEND and REPLACE was also fixed.
      
      I also added a new macro to test.h that acts like ast_test_validate
      but also accepts a return code variable and a cleanup label.  As well
      as printing the error, it sets the rc variable to AST_TEST_FAIL and
      does a goto to the specified label on error.  I had a local version
      of this in test_vector so I just moved it.
      
      ASTERISK-25045
      
      Change-Id: I05e5e47fd02f61964be13b7e8942bab5d61b29cc
      c886be5d
  2. May 05, 2015
    • George Joseph's avatar
      vector: Traversal, retrieval, insert and locking enhancements · 6d594129
      George Joseph authored
      Renamed AST_VECTOR_INSERT to AST_VECTOR_REPLACE because it really
      does replace not insert.  The few users of AST_VECTOR_INSERT were
      refactored.  Because these are macros, there should be no ABI
      compatibility issues.
      
      Added AST_VECTOR_INSERT_AT that actually inserts an element into the
      vector at a specific index pushing existing elements to the right.
      
      Added AST_VECTOR_GET_CMP that can retrieve from the vector based
      on a user-provided compare function.
      
      Added AST_VECTOR_CALLBACK function that will execute a function
      for each element in the vector.  Similar to ao2_callback and
      ao2_callback_data functions although the vector callback can take
      a variable number of arguments.  This should allow easy migration
      to a vector where a container might be too heavy.
      
      Added read/write locked vector and lock manipulation macros.
      
      Added unit tests.
      
      ASTERISK-25045 #close
      
      Change-Id: I2e07ecc709d2f5f91bcab8904e5e9340609b00e0
      6d594129
  3. Apr 29, 2015
    • Corey Farrell's avatar
      Astobj2: Add ao2_weakproxy_ref_object function. · c9c03998
      Corey Farrell authored
      This function allows code to run ao2_ref against the real
      object associated with a weakproxy.  It is useful when
      all of the following conditions are true:
      * You have a pointer to weakproxy.
      * You do not have or need a pointer to the real object.
      * You need to ensure the real object exists and is not
        destroyed during a process.
      
      In this case it's wasteful to store a pointer to the real
      object just for the sake of releasing it later.
      
      Change-Id: I38a319b83314de75be74207a8771aab269bcca46
      c9c03998
  4. Apr 22, 2015
    • Joshua Colp's avatar
      dns: Make query sets hold on to queries for their lifetime. · 7216e3c6
      Joshua Colp authored
      The query set documentation states that upon completion queries can be
      retrieved for the lifetime of the query set. This is a reasonable
      expectation but does not currently occur. This was originally done
      to resolve a circular reference between queries and query sets, but
      in practice the query can be kept.
      
      This change makes it so a query does not have a reference to the
      query set until it begins resolving. It also makes it so that the
      reference is given up upon the query being completed. This allows
      the queries to remain for the lifetime of the query set. As the
      query set on the query is only useful to the query set functionality
      and only for the lifetime that the query is resolving this is safe
      to do.
      
      ASTERISK-24994 #close
      Reported by: Joshua Colp
      
      Change-Id: I54e09c0cb45475896654e7835394524e816d1aa0
      7216e3c6
  5. 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
  6. Apr 14, 2015
    • Corey Farrell's avatar
      test_astobj2_weaken: Fix source file registration. · f89481e3
      Corey Farrell authored
      Update test_astobj2_weaken to use the new AST_REGISTER_FILE macro.
      
      Change-Id: Ieedadf16610f2e042f393e0501a36447cd07f83d
      f89481e3
    • Corey Farrell's avatar
      astobj2: Add support for weakproxy objects. · cb6bf309
      Corey Farrell authored
      This implements "weak" references.  The weakproxy object is a real ao2 with
      normal reference counting of its own.  When a weakproxy is pointed to a normal
      object they hold references to each other.  The normal object is automatically
      freed when a single reference remains (the weakproxy).  The weakproxy also
      supports subscriptions that will notify callbacks when it does not point
      to any real object.
      
      ASTERISK-24936 #close
      Reported by: Corey Farrell
      
      Change-Id: Ib9f73c02262488d314d9d9d62f58165b9ec43c67
      cb6bf309
  7. Apr 13, 2015
    • Matt Jordan's avatar
      git migration: Refactor the ASTERISK_FILE_VERSION macro · 4a582616
      Matt Jordan authored
      Git does not support the ability to replace a token with a version
      string during check-in. While it does have support for replacing a
      token on clone, this is somewhat sub-optimal: the token is replaced
      with the object hash, which is not particularly easy for human
      consumption. What's more, in practice, the source file version was often
      not terribly useful. Generally, when triaging bugs, the overall version
      of Asterisk is far more useful than an individual SVN version of a file. As a
      result, this patch removes Asterisk's support for showing source file
      versions.
      
      Specifically, it does the following:
      
      * Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and
        remove passing the version in with the macro. Other facilities
        than 'core show file version' make use of the file names, such as
        setting a debug level only on a specific file. As such, the act of
        registering source files with the Asterisk core still has use. The
        macro rename now reflects the new macro purpose.
      
      * main/asterisk:
        - Refactor the file_version structure to reflect that it no longer
          tracks a version field.
        - Remove the "core show file version" CLI command. Without the file
          version, it is no longer useful.
        - Remove the ast_file_version_find function. The file version is no
          longer tracked.
        - Rename ast_register_file_version/ast_unregister_file_version to
          ast_register_file/ast_unregister_file, respectively.
      
      * main/manager: Remove value from the Version key of the ModuleCheck
        Action. The actual key itself has not been removed, as doing so would
        absolutely constitute a backwards incompatible change. However, since
        the file version is no longer tracked, there is no need to attempt to
        include it in the Version key.
      
      * UPGRADE: Add notes for:
        - Modification to the ModuleCheck AMI Action
        - Removal of the "core show file version" CLI command
      
      Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
      4a582616
  8. Apr 11, 2015
  9. Apr 09, 2015
  10. Apr 06, 2015
  11. Apr 01, 2015
  12. Mar 25, 2015
  13. Mar 19, 2015
    • Matthew Jordan's avatar
      funcs/func_env: Fix regression caused in FILE read operation · 627cc16a
      Matthew Jordan authored
      When r432935 was merged, it did correctly fix a situation where a FILE read
      operation on the middle of a file buffer would not read the requested length
      in the parameters passed to the FILE function. Unfortunately, it would also
      allow the FILE function to append more bytes than what was available in the
      buffer if the length exceeded the end of the buffer length.
      
      This patch takes the minimum of the remaining bytes in the buffer along with
      the calculated length to append provided by the original patch, and uses
      that as the length to append in the return result. This patch also updates
      the unit tests with the scenarios that were originally pointed out in
      ASTERISK-21765 that the original implementation treated incorrectly.
      
      ASTERISK-21765
      ........
      
      Merged revisions 433173 from http://svn.asterisk.org/svn/asterisk/branches/11
      ........
      
      Merged revisions 433174 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      627cc16a
  14. Jan 07, 2015
  15. Dec 23, 2014
  16. Dec 11, 2014
  17. Dec 05, 2014
  18. Dec 03, 2014
  19. Dec 02, 2014
  20. Dec 01, 2014
    • Matthew Jordan's avatar
      main/stasis: Allow subscriptions to use a threadpool for message delivery · 1106e8fd
      Matthew Jordan authored
      Prior to this patch, all Stasis subscriptions would receive a dedicated
      thread for servicing published messages. In contrast, prior to r400178
      (see review https://reviewboard.asterisk.org/r/2881/), the subscriptions
      shared a thread pool. It was discovered during some initial work on Stasis
      that, for a low subscription count with high message throughput, the
      threadpool was not as performant as simply having a dedicated thread per
      subscriber.
      
      For situations where a subscriber receives a substantial number of messages
      and is always present, the model of having a dedicated thread per subscriber
      makes sense. While we still have plenty of subscriptions that would follow
      this model, e.g., AMI, CDRs, CEL, etc., there are plenty that also fall into
      the following two categories:
      * Large number of subscriptions, specifically those tied to endpoints/peers.
      * Low number of messages. Some subscriptions exist specifically to coordinate
        a single message - the subscription is created, a message is published, the
        delivery is synchronized, and the subscription is destroyed.
      In both of the latter two cases, creating a dedicated thread is wasteful (and
      in the case of a large number of peers/endpoints, harmful). In those cases,
      having shared delivery threads is far more performant.
      
      This patch adds the ability of a subscriber to Stasis to choose whether or not
      their messages are dispatched on a dedicated thread or on a threadpool. The
      threadpool is configurable through stasis.conf.
      
      Review: https://reviewboard.asterisk.org/r/4193
      
      ASTERISK-24533 #close
      Reported by: xrobau
      Tested by: xrobau
      ........
      
      Merged revisions 428681 from http://svn.asterisk.org/svn/asterisk/branches/12
      ........
      
      Merged revisions 428687 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      1106e8fd
  21. Nov 24, 2014
  22. Nov 21, 2014
  23. Nov 14, 2014
    • Matthew Jordan's avatar
      tests/test_cel: Unlock bridge on off nominal paths · 32685449
      Matthew Jordan authored
      If the test fails due to memory allocation errors, we may as well attempt to
      unlock the bridge on the way out.
      ........
      
      Merged revisions 427927 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      32685449
    • Mark Michelson's avatar
      Fix race condition that could result in ARI transfer messages not being sent. · 2d9471ab
      Mark Michelson authored
      From reviewboard:
      
      "During blind transfer testing, it was noticed that tests were failing
      occasionally because the ARI blind transfer event was not being sent.
      After investigating, I detected a race condition in the blind transfer
      code. When blind transferring a single channel, the actual transfer
      operation (i.e. removing the transferee from the bridge and directing
      them to the proper dialplan location) is queued onto the transferee
      bridge channel. After queuing the transfer operation, the blind transfer
      Stasis message is published. At the time of publication, snapshots of
      the channels and bridge involved are created. The ARI subscriber to the
      blind transfer Stasis message then attempts to determine if the bridge
      or any of the involved channels are subscribed to by ARI applications.
      If so, then the blind transfer message is sent to the applications. The
      way that the ARI blind transfer message handler works is to first see
      if the transferer channel is subscribed to. If not, then iterate over
      all the channel IDs in the bridge snapshot and determine if any of
      those are subscribed to. In the test we were running, the lone
      transferee channel was subscribed to, so an ARI event should have been
      sent to our application. Occasionally, though, the bridge snapshot did
      not have any channels IDs on it at all. Why?
      
      The problem is that since the blind transfer operation is handled by a
      separate thread, it is possible that the transfer will have completed and
      the channels removed from the bridge before we publish the blind transfer
      Stasis message. Since the blind transfer has completed, the bridge on
      which the transfer occurred no longer has any channels on it, so the
      resulting bridge snapshot has no channels on it. Through investigation of
      the code, I found that attended transfers can have this issue too for the
      case where a transferee is transferred to an application."
      
      The fix employed here is to decouple the creation of snapshots for the transfer
      messages from the publication of the transfer messages. This way, snapshots
      can be created to reflect what they are at the time of the transfer operation.
      
      Review: https://reviewboard.asterisk.org/r/4135
      ........
      
      Merged revisions 427848 from http://svn.asterisk.org/svn/asterisk/branches/12
      ........
      
      Merged revisions 427870 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427873 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      2d9471ab
  24. Nov 06, 2014
  25. Nov 05, 2014
  26. Oct 17, 2014
  27. Oct 16, 2014
  28. Oct 14, 2014
  29. Oct 13, 2014
    • George Joseph's avatar
      manager/config: Support templates and non-unique category names via AMI · c7e6b6ba
      George Joseph authored
      This patch provides the capability to manipulate templates and categories
      with non-unique names via AMI.
      
      Summary of changes:
      
      GetConfig and GetConfigJSON: Added "Filter" parameter:  A comma separated list
      of name_regex=value_regex expressions which will cause only categories whose
      variables match all expressions to be considered.  The special variable name
      TEMPLATES can be used to control whether templates are included.  Passing
      'include' as the value will include templates along with normal categories.
      Passing 'restrict' as the value will restrict the operation to ONLY templates.
      Not specifying a TEMPLATES expression results in the current default behavior
      which is to not include templates.
      
      UpdateConfig: NewCat now includes options for allowing duplicate category
      names, indicating if the category should be created as a template, and
      specifying templates the category should inherit from.  The rest of the
      actions now accept a filter string as defined above.  If there are non-unique
      category names, you can now update specific ones based on variable values.
      
      To facilitate the new capabilities in manager, corresponding changes had to be
      made to config, most notably the addition of filter criteria to many of the
      APIs.  In some cases it was easy to change the references to use the new
      prototype but others would have required touching too many files for this
      patch so a wrapper with the original prototype was created.  Macros couldn't
      be used in this case because it would break binary compatibility with modules
      such as res_digium_phone that are linked to real symbols.
      
      Tested-by: George Joseph
      
      Review: https://reviewboard.asterisk.org/r/4033/
      ........
      
      Merged revisions 425383 from http://svn.asterisk.org/svn/asterisk/branches/12
      ........
      
      Merged revisions 425384 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      c7e6b6ba
  30. Oct 10, 2014
  31. Sep 26, 2014
  32. Sep 23, 2014
    • Mark Michelson's avatar
      Make CDR and CEL unit tests less FRACKy. · a89964a5
      Mark Michelson authored
      Prior to this commit, CDR and CEL tests were expected to trigger
      FRACKs (i.e. assertions) due to the fact that the channels they
      create have no formats on them. Some code was independently added
      recently that attempts to prevent FRACKs from occurring by failing
      early when attempting to set up translation paths if one or both
      channels support no formats. Unfortunately, this attempt to be helpful
      made the CDR and CEL tests go from simply FRACKing to outright
      failing and in some cases, failing so badly as to crash Asterisk.
      
      This commit seeks to correct past mistakes by adding the ulaw format
      to channels created by the CDR and CEL unit tests. This makes setting
      up translation paths succeed, eliminates previously-seen FRACKs, and
      ultimately causes the unit tests to succeed again.
      
      Review: https://reviewboard.asterisk.org/r/4014
      ........
      
      Merged revisions 423783 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423784 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      a89964a5
  33. Sep 18, 2014
  34. Aug 27, 2014
  35. Aug 20, 2014
  36. Aug 14, 2014
Loading