Skip to content
Snippets Groups Projects
  1. Jun 08, 2015
    • Corey Farrell's avatar
      Fix unsafe uses of ast_context pointers. · 53658a14
      Corey Farrell authored
      Although ast_context_find, ast_context_find_or_create and
      ast_context_destroy perform locking of the contexts table,
      any context pointer can become invalid at any time that the
      contexts table is unlocked. This change adds locking around
      all complete operations involving these functions.
      
      Places where ast_context_find was followed by ast_context_destroy
      have been replaced with calls ast_context_destroy_by_name.
      
      ASTERISK-25094 #close
      Reported by: Corey Farrell
      
      Change-Id: I1866b6787730c9c4f3f836b6133ffe9c820734fa
      53658a14
  2. Apr 11, 2015
  3. Mar 19, 2015
    • Matthew Jordan's avatar
      funcs/func_env: Fix regression caused in FILE read operation · 1e130f92
      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
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      1e130f92
  4. Nov 06, 2014
  5. Nov 05, 2014
    • George Joseph's avatar
      config: Make text_file_save and 'dialplan save' escape semicolons in values. · 03fcc1ad
      George Joseph authored
      When a config file is read, an unescaped semicolon signals comments which are
      stripped from the value before it's stored.  Escaped semicolons are then
      unescaped and become part of the value.  Both of these behaviors are normal
      and expected.  When the config is serialized either by 'dialplan save' or
      AMI/UpdateConfig however, the now unescaped semicolons are written as-is.
      If you actually reload the file just saved, the unescaped semicolons are
      now treated as start of comments.
      
      Since true comments are stripped on read, any semicolons in
      ast_variable.value must have been escaped originally.  This patch
      re-escapes semicolons in ast_variable.values before they're written to
      file either by 'dialplan save' or config/ast_config_text_file_save which
      is called by AMI/UpdateConfig. I also fixed a few pre-existing formatting
      issues nearby in pbx_config.c
      
      Tested-by: George Joseph
      ASTERISK-20127 #close
      
      Review: https://reviewboard.asterisk.org/r/4132/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@427328 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      03fcc1ad
  6. Oct 10, 2014
  7. Aug 27, 2014
  8. Jul 22, 2014
  9. Oct 24, 2013
  10. Oct 23, 2013
  11. Sep 04, 2013
  12. Aug 30, 2013
  13. Aug 14, 2013
  14. Jan 12, 2013
    • David M. Lee's avatar
      Fix XML encoding of 'identity display' in NOTIFY messages. · 12c51024
      David M. Lee authored
      XML encoding in chan_sip is accomplished by naively building the XML
      directly from strings. While this usually works, it fails to take into
      account escaping the reserved characters in XML.
      
      This patch adds an 'ast_xml_escape' function, which works similarly to
      'ast_uri_encode'. This is used to properly escape the local_display
      attribute in XML formatted NOTIFY messages.
      
      Several things to note:
       * The Right Thing(TM) to do would probably be to replace the
         ast_build_string stuff with building an ast_xml_doc. That's a much
         bigger change, and out of scope for the original ticket, so I
         refrained myself.
       * It is with great sadness that I wrote my own ast_xml_escape
         function. There's one in libxml2, but it's knee-deep in
         libxml2-ness, and not easily used to one-off escape a
         string.
       * I only escaped the string we know is causing problems
         (local_display). At least some of the other strings are
         URI-encoded, which should be XML safe. Rather than figuring out
         what's safe and escaping what's not, it would be much cleaner to
         simply build an ast_xml_doc for the messages and let the XML
         library do the XML escaping. Like I said, that's out of scope.
      
      (closes issue ABE-2902)
      Reported by: Guenther Kelleter
      Tested by: Guenther Kelleter
      Review: http://reviewboard.digium.internal/r/365/
      
      ........
      
      Merged revision 378919 from https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
      ........
      
      Merged revisions 378933 from http://svn.asterisk.org/svn/asterisk/branches/1.8
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@378934 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      12c51024
  15. Nov 15, 2012
    • David M. Lee's avatar
      Migrate hashtest/hashtest2 to be unit tests. · bbf35263
      David M. Lee authored
      Both hashtest and hashtest2 are manual testing apps that thrash hash
      tables (hashtab and ao2 containers, respectively), by spinning up
      several threads that randomly insert, delete, lookup and iterate over
      the hash table. If the app doesn't crash, the hash table probably passes
      the test. Those utils are not a part of the typical Asterisk build, so
      they do not usually get compiled. This all makes them less that useful.
      
      This patch removes those manual test programs and replaces them with
      Asterisk unit test modules (test_{hashtab,astobj2}_thrash.so). It also
      attempts to make the tests more deterministic.
      
      * Rather than spinning up some number of threads that operate on the
        hash table randomly, spin up four threads that concurrenly add,
        remove, lookup and iterate over the hash table.
      * Each thread checks the state of the hash table both during and after
        execution, and indicates a test failure if things are not as expected.
      * Each thread times out after 60 seconds to prevent deadlocking the unit
        test run.
      
      (closes issue ASTERISK-20505)
      Reported by: Matt Jordan
      Review: https://reviewboard.asterisk.org/r/2189/
      ........
      
      Merged revisions 376306 from http://svn.asterisk.org/svn/asterisk/branches/1.8
      ........
      
      Merged revisions 376315 from http://svn.asterisk.org/svn/asterisk/branches/10
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@376339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      bbf35263
  16. Oct 01, 2012
    • Sean Bright's avatar
      app_queue: Support persisting and loading of long member lists. · 1449b2ca
      Sean Bright authored
      Greenlight in #asterisk brought up that he was receiving an error message "Could
      not create persistent member string, out of space" when running app_queue in
      Asterisk 10.  dump_queue_members() made an assumption that 8K would be enough to
      store the generated string, but with queues that have large member lists this is
      not always the case.  This patch removes the limitation and uses ast_str instead
      of a fixed sized buffer.
      
      The complicating factor comes from the fact that ast_db_get requires a buffer
      and buffer size argument, which doesn't let us pull back more than what we pass
      in, so I introduced a new ast_db_get_allocated() which returns an ast_strdup()'d
      copy of the value from astdb.
      
      As an aside, I did some testing on the maximum size of data that we can store in
      the BDB library we distribute and was able to store a 10MB string and retrieve
      it with no problems, so I feel this is a safe patch.
      
      Review: https://reviewboard.asterisk.org/r/2136/
      ........
      
      Merged revisions 374108 from http://svn.asterisk.org/svn/asterisk/branches/1.8
      ........
      
      Merged revisions 374135 from http://svn.asterisk.org/svn/asterisk/branches/10
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@374150 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      1449b2ca
  17. Jul 31, 2012
  18. Jul 30, 2012
    • Russell Bryant's avatar
      Fix ast_event_new unit test. · ee04ec77
      Russell Bryant authored
      One of my recent commits broke this test.  The error was:
      
      [test_event.c:event_new_test:214]: Events expected to be identical
      have different size: 69 != 59
      
      The difference in size occurred because the first event had
      the EID IE added to the event twice.  ast_event_new() now always
      adds it automatically.  Previously it only added it if there
      were no IEs specified, which was kind of weird.
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      ee04ec77
  19. Jul 24, 2012
  20. Jul 23, 2012
    • Matthew Jordan's avatar
      Unit tests for the Jitter Buffer API; remove unnecessary resync · b6a0ae0b
      Matthew Jordan authored
      This patch includes the following:
      * Unit tests for the abstract Jitter Buffer API.  This includes both fixed
        and adaptive flavors, testing nominal creation, frame input, frame retrieval,
        resyncing; off nominal frame input overflow, out of order, and others.
      * Tweaks to the abstract_jb API to remove the unnecessary resync_threshold
        parameter from the create function (resync_threshold is already in the
        struct passed into the create function)
      * Ensure the fixed jitter buffer is empty before destroying it, to avoid an
        ASSERT
      * Don't "resync" the adaptive jitter buffer.  The mechanism that was being
        used actually causes the jitter buffer to think its being overflowed by going
        around the jitterbuf API and attempting to 'resynch' it improperly.  If a
        resync is needed, the jitter buffer will do it properly by itself.  Note that
        this is only an optimization needed for trunk, as the worst that happens is 
        the loss of three voice packets before the adaptive jitter buffer will resync
        anyway.
        
      Review: https://reviewboard.asterisk.org/r/2035
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370387 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      b6a0ae0b
  21. Jul 12, 2012
  22. Jun 28, 2012
  23. Jun 14, 2012
  24. Jun 07, 2012
  25. Jun 04, 2012
    • Mark Michelson's avatar
      Merge changes dealing with support for Digium phones. · 14a98556
      Mark Michelson authored
      Presence support has been added. This is accomplished by
      allowing for presence hints in addition to device state
      hints. A dialplan function called PRESENCE_STATE has been
      added to allow for setting and reading presence. Presence
      can be transmitted to Digium phones using custom XML
      elements in a PIDF presence document.
      
      Voicemail has new APIs that allow for moving, removing,
      forwarding, and playing messages. Messages have had a new
      unique message ID added to them so that the APIs will work
      reliably. The state of a voicemail mailbox can be obtained
      using an API that allows one to get a snapshot of the mailbox.
      A voicemail Dialplan App called VoiceMailPlayMsg has been
      added to be able to play back a specific message.
      
      Configuration hooks have been added. Configuration hooks
      allow for a piece of code to be executed when a specific
      configuration file is loaded by a specific module. This is
      useful for modules that are dependent on the configuration
      of other modules.
      
      chan_sip now has a public method that allows for a custom
      SIP INFO request to be sent mid-dialog. Digium phones use
      this in order to display progress bars when files are played.
      
      Messaging support has been expanded a bit. The main
      visible difference is the addition of an AMI action
      MessageSend.
      
      Finally, a ParkingLots manager action has been added in order
      to get a list of parking lots.
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      14a98556
  26. Jun 01, 2012
  27. May 16, 2012
  28. May 07, 2012
  29. May 03, 2012
    • Michael L. Young's avatar
      Update security events unit tests · fdf3cd0e
      Michael L. Young authored
      The security events framework API was changed in Asterisk 10 but the unit tests
      were not updated at the same time.
      
      This patch does the following:
      * Adds two more security events that were added to the API 
      * Add challenge, received_challenge and received_hash in the inval_password 
        security event unit test
      
      (Closes issue ASTERISK-19760)
      Reported by: Michael L. Young
      Tested by: Michael L. Young
      Patches:
      issue-asterisk-19760-trunk.diff uploaded by Michael L. Young (license 5026)
      
      Review: https://reviewboard.asterisk.org/r/1897/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365248 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      fdf3cd0e
  30. Apr 27, 2012
  31. Apr 19, 2012
  32. Apr 18, 2012
  33. Mar 27, 2012
    • Richard Mudgett's avatar
      Add global ao2 array container. · 38e892b3
      Richard Mudgett authored
      Global ao2 objects must always exist after initialization because there is
      no access control to obtain another reference to the global object.
      
      It is expected that module configuration could use these new API calls to
      replace an active configuration parameter object with an updated
      configuration parameter object.
      
      With these new API calls, the global object could be replaced, removed, or
      referenced without the risk of someone using a stale global object
      pointer.
      
      Review: https://reviewboard.asterisk.org/r/1824/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      38e892b3
  34. Mar 14, 2012
    • Matthew Jordan's avatar
      Add tests for main/jitterbuf.c · a699bb72
      Matthew Jordan authored
      This patch adds unit tests for main/jitterbuf.c.  This includes checking for
      the following:
        * Nominal insertion and retrieval of frames
        * Insertion and retrieval of frames where the frames are inserted out of
          order with respect to the previous frame
        * Insertion and retrieval of frames where some number of frames that would
          occur in the expected sequence are instead dropped
        * Insertion and retrieval of frames with an arrival time that does not occur
          at the same rate as the surrounding frames
        * Resynchronization of the jitter buffer when an inserted frame breaks the
          resynchronization threshold
        * Overfilling of the jitter buffer
      
      For each of the tests, both JB_TYPE_VOICE and JB_TYPE_CONTROL permutations
      exist.
      
      Review: https://reviewboard.asterisk.org/r/1815
      
      (issue: ASTERISK-18964)
      Reported by: Kris Shaw
      Tested by: Kris Shaw, Matt Jordan
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359406 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      a699bb72
  35. Mar 13, 2012
    • Terry Wilson's avatar
      Make hints for invalid SIP devices return Unavail, not idle · 699d2bd7
      Terry Wilson authored
      This patch drastically simplifies the device state aggegation code.
      The old method was not only overly complex, but also made it impossible
      to return AST_DEVICE_INVALID from the aggregation code. The unit test
      update is as a result of fixing that bug.
      
      The SIP change stems from a bug introduced by removing a DNS lookup
      for hostname-based SIP channels.
      
      (closes issue ASTERISK-16702)
      Review: https://reviewboard.asterisk.org/r/1808/
      ........
      
      Merged revisions 358943 from http://svn.asterisk.org/svn/asterisk/branches/1.8
      ........
      
      Merged revisions 358944 from http://svn.asterisk.org/svn/asterisk/branches/10
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      699d2bd7
    • Tilghman Lesher's avatar
      Enable macros in 1.8 to find the next highest "h" extension in a context, like in 1.4. · 9af5c769
      Tilghman Lesher authored
      This change restores functionality that was present in 1.4, when AEL macros
      were implemented with the Macro dialplan application.  Macros are fraught with
      functionality issues, because they consume a large portion of the underlying
      application stack.  This limits the ability of AEL users to call many layers
      of subroutines, an issue which Gosub does not have (originally tested to
      100,000 levels deep).  Therefore, starting in 1.6.0, AEL macros were
      implemented with Gosub.
      
      However, there were some implicit behaviors of Macro, which were not replicated
      at the same time as with the transition to Gosub, one of which is documented in
      the related issue.  In particular, the "h" extension is designed to execute not
      in the Macro context, but in the topmost calling context.  Due to legacy issues
      with a misapplied bugfix many years ago, when a macro exited in 1.4, it looks
      in all calling contexts, bubbling up from the deepest level until it finds an
      "h" extension.
      
      Since AEL hides the complexity of the underlying dialplan logic from the AEL
      programmer, it's reasonable to assume that this behavior should not change in
      the transition from Asterisk 1.4 LTS to Asterisk 1.8 LTS, lest we break
      working AEL configurations in the transition to Asterisk 1.8 LTS.  This fix
      is the result, which implements a search for the "h" extension in all calling
      Gosub contexts.
      
      Fixes ASTERISK-19336
      
      Patch: 20120308__ael_bugfix_for_trunk__2.diff (License #5003) by Tilghman Lesher
      	(with slight modifications for 1.8)
      
      Tested by: Johan Wilfer
      
      Review: https://reviewboard.asterisk.org/r/1776/
      ........
      
      Merged revisions 358810 from http://svn.asterisk.org/svn/asterisk/branches/1.8
      ........
      
      Merged revisions 358811 from http://svn.asterisk.org/svn/asterisk/branches/10
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358812 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      9af5c769
  36. Mar 02, 2012
Loading