Skip to content
Snippets Groups Projects
  1. Nov 21, 2017
    • Corey Farrell's avatar
      CLI: Remove calls to ast_cli_generator. · a02cbc2e
      Corey Farrell authored
      The ability to add to localized storage cannot be supported by
      ast_cli_generator.  The only calls to ast_cli_generator should be by
      functions that need to proxy the CLI generator, for example 'cli check
      permissions' or 'core show help'.
      
      * ast_cli_generatornummatches now retrieves the vector of matches and
        reports the number of elements (not including 'best' match).
      * test_substitution retrieves and iterates the vector.
      
      Change-Id: I8cd6b93905363cf7a33a2d2b0e2a8f8446d9f248
      a02cbc2e
  2. Nov 20, 2017
  3. Nov 19, 2017
    • Corey Farrell's avatar
      tests: Fix warnings found on Mac. · 75cb4037
      Corey Farrell authored
      test_pbx used raise without explicitly including signal.h.  On Mac for
      some reason nothing else includes it.
      
      test_logger checked if an unsigned int was negative.  Switch the
      variable to 'int' so that error check can be effective.
      
      Change-Id: Ie1db5dd1818ac25cc2ae41b644f848b5865b1362
      75cb4037
  4. Nov 17, 2017
    • Corey Farrell's avatar
      menuselect: Remove ineffective weak attribute detection. · b9f4bb59
      Corey Farrell authored
      menuselect detects compiler support for multiple styles of weak
      functions.  This is a remnant from 2013 when OPTIONAL_API required weak
      functions.  It is no longer correct for menuselect to switch
      dependencies from optional to required based on lack of weak function
      support.
      
      Note an issue remains - dependencies should switch from optional to
      required based on OPTIONAL_API being enabled or disabled.  I don't think
      this is possible.  menuselect needs to know at startup if OPTIONAL_API
      is enabled or disabled, so the only way to fix this is to remove
      OPTIONAL_API from menuselect and create a configure option.  I've left
      the code that switches in place but it's preprocessed out.
      
      Additionally removed:
      - WEAKREF variable from Asterisk makeopts.in.
      - Related disabled code from test_utils.
      - Pointless AC_REVISION call from menuselect/configure.ac.
      
      Change-Id: Ifa702e5f98eb45f338b2f131a93354632a8fb389
      b9f4bb59
  5. Nov 06, 2017
  6. Nov 02, 2017
  7. Oct 23, 2017
    • Corey Farrell's avatar
      test_config: Fix failure and segfault when config_hook is run twice. · a9e96089
      Corey Farrell authored
      On second run the config_hook test was unexpectedly failing to load
      test_config.conf because it was still unmodified since the last load.
      This is fixed by not passing CONFIG_FLAG_FILEUNCHANGED for the initial
      loads, only using it when we are tested that a reload of unmodified
      files do not initiate the hook.
      
      ASTERISK-25960
      
      Change-Id: Ifd679509a23ed163e5cc647490bf7df4ae3cd856
      a9e96089
  8. Oct 06, 2017
  9. Aug 22, 2017
    • Richard Mudgett's avatar
      channel: Fix topology API locking. · 9c70c883
      Richard Mudgett authored
      * ast_channel_request_stream_topology_change() must not be called with any
      channel locks held.
      
      * ast_channel_stream_topology_changed() must be called with only the
      passed channel lock held.
      
      ASTERISK-27212
      
      Change-Id: I843de7956d9f1cc7cc02025aea3463d8fe19c691
      9c70c883
  10. Aug 16, 2017
    • Kevin Harwell's avatar
      manager: hook event is not being raised · e4e2e53c
      Kevin Harwell authored
      When the iostream code went in it introduced a conditional that made it so the
      hook event was not being raised even if a hook is present. This patch adds a
      check to see if a hook is present in astman_append. If so then call into the
      send_string function, which in turn raises the even for specified hook.
      
      Also updated the ami hooks unit test, so the test could be automated.
      
      ASTERISK-27200 #close
      
      Change-Id: Iff37f02f9708195d8f23e68f959d6eab720e1e36
      e4e2e53c
  11. Aug 04, 2017
    • Corey Farrell's avatar
      Correct some leaks in unit tests. · 7f8f3ca4
      Corey Farrell authored
      * chan_sip: channel in test_sip_rtpqos_1.
      * test_config: config hook, config info and global config holder.
      * test_core_format: format in format_attribute_set_without_interface.
      * test_stream: unneeded frame duplication.
      * test_taskprocessor: task_data.
      
      Change-Id: I94d364d195cf3b3b5de2bf3ad565343275c7ad31
      7f8f3ca4
  12. Jul 13, 2017
    • Corey Farrell's avatar
      core: Add PARSE_TIMELEN support to ast_parse_arg and ACO. · 78a50b03
      Corey Farrell authored
      This adds support for parsing timelen values from config files.  This
      includes support for all flags which apply to PARSE_INT32.  Support for
      this parser is added to ACO via the OPT_TIMELEN_T option type.
      
      Fixes an issue where extra characters provided to ast_app_parse_timelen
      were ignored, they now cause an error.
      
      Testing is included.
      
      ASTERISK-27117 #close
      
      Change-Id: I6b333feca7e3f83b4ef5bf2636fc0fd613742554
      78a50b03
  13. Jun 20, 2017
    • Richard Mudgett's avatar
      SDP: Create declined m= SDP lines using remote SDP if applicable. · d2fbbdd6
      Richard Mudgett authored
      * Update SDP unit tests to test negotiating with declined streams.
      Generation of declined m= lines created and responded tested.
      
      Change-Id: I5cb99f5010994ab0c7d9cf2d395eca23fab37b98
      d2fbbdd6
    • Richard Mudgett's avatar
      SDP: Rework SDP offer/answer model and update capabilities merges. · 3a18a090
      Richard Mudgett authored
      The SDP offer/answer model requires an answer to an offer before a new SDP
      can be processed.  This allows our local SDP creation to be deferred until
      we know that we need to create an offer or an answer SDP.  Once the local
      SDP is created it won't change until the SDP negotiation is restarted.
      
      An offer SDP in an initial SIP INVITE can receive more than one answer
      SDP.  In this case, we need to merge each answer SDP with our original
      offer capabilities to get the currently negotiated capabilities.  To
      satisfy this requirement means that we cannot update our proposed
      capabilities until the negotiations are restarted.
      
      Local topology updates from ast_sdp_state_update_local_topology() are
      merged together until the next offer SDP is created.  These accumulated
      updates are then merged with the current negotiated capabilities to create
      the new proposed capabilities that the offer SDP is built.
      
      Local topology updates are merged in several passes to attempt to be smart
      about how streams from the system are matched with the previously
      negotiated stream slots.  To allow for T.38 support when merging, type
      matching considers audio and image types to be equivalent.  First streams
      are matched by stream name and type.  Then streams are matched by stream
      type only.  Any remaining unmatched existing streams are declined.  Any
      new active streams are either backfilled into pre-merge declined slots or
      appended onto the end of the merged topology.  Any excess new streams
      above the maximum supported number of streams are simply discarded.
      
      Remote topology negotiation merges depend if the topology is an offer or
      answer.  An offer remote topology negotiation dictates the stream slot
      ordering and new streams can be added.  A remote offer can do anything to
      the previously negotiated streams except reduce the number of stream
      slots.  An answer remote topology negotiation is limited to what our offer
      requested.  The answer can only decline streams, pick codecs from the
      offered list, or indicate the remote's stream hold state.
      
      I had originally kept the RTP instance if the remote offer SDP changed a
      stream type between audio and video since they both use RTP.  However, I
      later removed this support in favor of simply creating a new RTP instance
      since the stream's purpose has to be changing anyway.  Any RTP packets
      from the old stream type might cause mischief for the bridged peer.
      
      * Added ast_sdp_state_restart_negotiations() to restart the SDP
      offer/answer negotiations.  We will thus know to create a new local SDP
      when it is time to create an offer or answer.
      
      * Removed ast_sdp_state_reset().  Save the current topology before
      starting T.38.  To recover from T.38 simply update the local topology to
      the saved topology and restart the SDP negotiations to get the offer SDP
      renegotiating the previous configuration.
      
      * Allow initial topology for ast_sdp_state_alloc() to be NULL so an
      initial remote offer SDP can dictate the streams we start with.  We can
      always update the local topology later if it turns out we need to offer
      SDP first because the remote chose to defer sending us a SDP.
      
      * Made the ast_sdp_state_alloc() initial topology limit to max_streams,
      limit to configured codecs, handle declined streams, and discard
      unsupported types.
      
      * Convert struct ast_sdp to ao2 object.  Needed to easily save off a
      remote SDP to refer to later for various reasons such as generating
      declined m= lines in the local SDP.
      
      * Improve converting remote SDP streams to a topology including stream
      state.  A stream state of AST_STREAM_STATE_REMOVED indicates the stream is
      declined/dead.
      
      * Improve merging streams to take into account the stream state.
      
      * Added query for remote hold state.
      
      * Added maximum streams allowed SDP config option.
      
      * Added ability to create new streams as needed.  New streams are created
      with configured default audio, video, or image codecs depending on stream
      type.
      
      * Added global locally_held state along with a per stream local hold
      state.  Historically, Asterisk only has a global locally held state
      because when the we put the remote on hold we do it for all active
      streams.
      
      * Added queries for a rejected offer and current SDP negotiation role.
      The rejected query allows the using module to know how to respond to a
      failed remote SDP set.  Should the using module respond with a 488 Not
      Acceptable Here or 500 Internal Error to the offer SDP?
      
      * Moved sdp_state_capabilities.connection_address to ast_sdp_state.  There
      seems no reason to keep it in the sdp_state_capabilities struct since it
      was only used by the ast_sdp_state.proposed_capabilities instance.
      
      * Callbacks are now available to allow the using module some customization
      of negotiated streams and to complete setting up streams for use.  See the
      typedef doxygen for each callback for what is allowable and when they are
      called.
          * Added topology answerer modify callback.
          * Added topology pre and post apply callbacks.
          * Added topology offerer modify callback.
          * Added topology offerer configure callback.
      
      * Had to rework the unit tests because I changed how SDP topologies are
      merged.  Replaced several unit tests with new negotiation tests.
      
      Change-Id: If07fe6d79fbdce33968a9401d41d908385043a06
      3a18a090
  14. Jun 15, 2017
  15. Jun 13, 2017
    • Joshua Colp's avatar
      bridge: Add a deferred queue. · d6386a8f
      Joshua Colp authored
      This change adds a deferred queue to bridging. If a bridge
      technology determines that a frame can not be written and
      should be deferred it can indicate back to bridging to do so.
      Bridging will then requeue any deferred frames upon a new
      channel joining the bridge.
      
      This change has been leveraged for T.38 request negotiate
      control frames. Without the deferred queue there is a race
      condition between the bridge receiving the T.38 request
      negotiate and the second channel joining and being in the
      bridge. If the channel is not yet in the bridge then the T.38
      negotiation fails.
      
      A unit test has also been added that confirms that a T.38
      request negotiate control frame is deferred when no other
      channel is in the bridge and that it is requeued when a new
      channel joins the bridge.
      
      ASTERISK-26923
      
      Change-Id: Ie05b08523f399eae579130f4a5f562a344d2e415
      d6386a8f
  16. May 30, 2017
    • George Joseph's avatar
      test_json: Fix test names with reserved words · 80206cdc
      George Joseph authored
      Some of the test names were actually reserved words (true, false,
      int, null, string, bool).  When the jenkins test results analyzer
      does its thing it tries to create a map using the test names as
      keys and fails because they're reserved words.
      
      Added "type_" to those test names.
      
      Change-Id: I90d809f46969c78a1c605b736ff0635196a2cf1b
      80206cdc
  17. May 24, 2017
    • George Joseph's avatar
      unittests: Add a unit test that causes a SEGV and... · 08edd54c
      George Joseph authored
      ...that can only be run by explicitly calling it with
      'test execute category /DO_NOT_RUN/ name RAISE_SEGV'
      
      This allows us to more easily test CI and debugging tools that
      should do certain things when asterisk coredumps.
      
      To allow this a new member was added to the ast_test_info
      structure named 'explicit_only'.  If set by a test, the test
      will be skipped during a 'test execute all' or
      'test execute category ...'.
      
      Change-Id: Ia3a11856aae4887df9a02b6b081cc777b36eb6ed
      08edd54c
  18. May 17, 2017
    • Kevin Harwell's avatar
      core/conversions: Added string to unsigned integer and long conversions · 51375686
      Kevin Harwell authored
      Added functions that convert a string to an unsigned integer or unsigned long.
      A couple of unit test were also created to test the routines. The reasons for
      adding these conversion utilities (and hopefully eventually more) are as
      follows:
      
        * Conversion routines are functionally contained with consistent and
          better error checking
        * The function names offer a better description of what is happening
        * It encourages code reuse for easier bug fixing at a single source
        * It's simpler to use
        * It's unit testable
      
      For instance, currently in a lot of places when converting to an integer or
      similar the "sscanf" function is used. When using "sscanf" it may not be
      immediately clear what's happening as it lacks semantic naming. Limited error
      checking is usually done as well. For example, most of the time a check is done
      to make sure the value converted, but does not check for overflows or negative
      valued conversions when converting unsigned numbers.
      
      Why use/wrap "strtoul" and not "sscanf" then? Primarily, it lacks some of the
      built in error handling that "strtoul" has. For instance "strtoul" contains
      overflow checks. Less so, but can still factor as reasons, "sscanf" is slightly
      more complex in its use. And maybe a bit controversial, but it may be ("big if")
      potentially slower than "strtoul" in some cases.
      
      Change-Id: If7eaca4a48f8c7b89cc8b5a1f4bed2852fca82bb
      51375686
  19. May 09, 2017
  20. May 08, 2017
    • George Joseph's avatar
      logger: Added logger_queue_limit to the configuration options. · 201346fb
      George Joseph authored
      All log messages go to a queue serviced by a single thread
      which does all the IO.  This setting controls how big that
      queue can get (and therefore how much memory is allocated)
      before new messages are discarded. The default is 1000.
      Should something go bezerk and log tons of messages in a tight
      loop, this will prevent memory escalation.
      
      When the limit is reached, a WARNING is logged to that effect
      and messages are discarded until the queue is empty again.  At
      that time another WARNING will be logged with the count of
      discarded messages.  There's no "low water mark" for this queue
      because the logger thread empties the entire queue and processes it
      in 1 batch before going back and waiting on the queue again.
      Implementing a low water mark would mean additional locking as
      the thread processes each message and it's not worth it.
      
      A "test" was added to test_logger.c but since the outcome is
      non-deterministic, it's really just a cli command, not a unit
      test.
      
      Change-Id: Ib4520c95e1ca5325dbf584c7989ce391649836d1
      201346fb
  21. May 03, 2017
    • Kevin Harwell's avatar
      bridge_simple: Added support for streams · 7b0e3b92
      Kevin Harwell authored
      This patch is the first cut at adding stream support to the bridging framework.
      Changes were made to the framework that allows mapping of stream topologies to
      a bridge's supported media types.
      
      The first channel to enter a bridge initially defines the media types for a
      bridge (i.e. a one to one mapping is created between the bridge and the first
      channel). Subsequently added channels merge their media types into the bridge's
      adding to it when necessary. This allows channels with different sized
      topologies to map correctly to each other according to media type. The bridge
      drops any frame that does not have a matching index into a given write stream.
      
      For now though, bridge_simple will align its two channels according to size or
      first to join. Once both channels join the bridge the one with the most streams
      will indicate to the other channel to update its streams to be the same as that
      of the other. If both channels have the same number of streams then the first
      channel to join is chosen as the stream base.
      
      A topology change source was also added to a channel when a stream toplogy
      change request is made. This allows subsystems to know whether or not they
      initiated a change request. Thus avoiding potential recursive situations.
      
      ASTERISK-26966 #close
      
      Change-Id: I1eb5987921dd80c3cdcf52accc136393ca2d4163
      7b0e3b92
  22. Apr 27, 2017
    • Mark Michelson's avatar
      SDP API: Add SSRC-level attributes · d6535c00
      Mark Michelson authored
      RFC 5576 defines how SSRC-level attributes may be added to SDP media
      descriptions. In general, this is useful for grouping related SSRCes,
      indicating SSRC-level format attributes, and resolving collisions in RTP
      SSRC values. These attributes are used widely by browsers during WebRTC
      communications, including attributes defined by documents outside of RFC
      5576.
      
      This commit introduces the addition of SSRC-level attributes into SDPs
      generated by Asterisk. Since Asterisk does not tend to use multiple
      SSRCs on a media stream, the initial support is minimal. Asterisk
      includes an SSRC-level CNAME attribute if configured to do so. This at
      least gives browsers (and possibly others) the ability to resolve SSRC
      collisions at offer-answer time.
      
      In order to facilitate this, the RTP engine API has been enhanced to be
      able to retrieve the SSRC and CNAME on a given RTP instance.
      
      res_rtp_asterisk currently does not provide meaningful CNAME values in
      its RTCP SDES items, and therefore it currently will always return an
      empty string as the CNAME value. A task in the near future will result
      in res_rtp_asterisk generating more meaningful CNAMEs.
      
      Change-Id: I29e7f23e7db77524f82a3b6e8531b1195ff57789
      d6535c00
    • Joshua Colp's avatar
      channel: Add ability to request an outgoing channel with stream topology. · 2b22c3c8
      Joshua Colp authored
      This change extends the ast_request functionality by adding another
      function and callback to create an outgoing channel with a requested
      stream topology. Fallback is provided by either converting the
      requested stream topology into a format capabilities structure if
      the channel driver does not support streams or by converting the
      requested format capabilities into a stream topology if the channel
      driver does support streams.
      
      The Dial application has also been updated to request an outgoing
      channel with the stream topology of the calling channel.
      
      ASTERISK-26959
      
      Change-Id: Ifa9037a672ac21d42dd7125aa09816dc879a70e6
      2b22c3c8
  23. Apr 26, 2017
    • Kevin Harwell's avatar
      vector: defaults and indexes · cf3429b9
      Kevin Harwell authored
      Added an pre-defined integer vector declaration. This makes integer vectors
      easier to declare and pass around. Also, added the ability to default a vector
      up to a given size with a default value. Lastly, added functionality that
      returns the "nth" index of a matching value.
      
      Also, updated a unit test to test these changes.
      
      Change-Id: Iaf4b51b2540eda57cb43f67aa59cf1d96cdbcaa5
      cf3429b9
  24. Apr 25, 2017
    • Joshua Colp's avatar
      sdp: Add support for T.38 · 19a79ae1
      Joshua Colp authored
      This change adds a T.38 format which can be used in a stream
      topology to specify that a UDPTL stream needs to be created.
      The SDP API has been changed to understand T.38 and create
      the UDPTL session, add the attributes, and parse the attributes.
      
      This change does not change the boundary of the T.38 state
      machine. It is still up to the channel driver to implement and
      act on it (such as queueing control frames or reacting to them).
      
      ASTERISK-26949
      
      Change-Id: If28956762ccb8ead562ac6c03d162d3d6014f2c7
      19a79ae1
    • Mark Michelson's avatar
      SDP: Ensure SDPs "merge" properly. · 32b3e36c
      Mark Michelson authored
      The gist of this work ensures that when a remote SDP is received, it is
      merged properly with the local capabilities. The remote SDP is converted
      into a stream topology. That topology is then merged with the current
      local topology on the SDP state. That new merged topology is then used
      to create an SDP. Finally, adjustments are made to RTP instances based
      on knowledge gained from the remote SDP.
      
      There are also a battery of tests in this commit that ensure that some
      basic SDP merges work as expected.
      
      While this may not sound like a big change, it has the property that it
      caused lots of ancillary changes.
      
      * The remote SDP is no longer stored on the SDP state. Biggest reason:
        there's no need for it. The remote SDP is used at the time it is being
        set and nowhere else.
      
      * Some new SDP APIs were added in order to find attributes and convert
        generic SDP attributes into rtpmap structures.
      
      * Writing tests made me realize that retrieving a value from an SDP
        options structure, the SDP options needs to be made const.
      
      * The SDP state machine was essentially gutted by a previous commit.
        Initially, I attempted to reinstate it, but I found that as it had
        been defined, it was not all that useful. What was more useful was
        knowing the role we play in SDP negotiation, so the SDP state machine
        has been transformed into an indicator of role.
      
      * Rather than storing separate local and joint stream state
        capabilities, it makes more sense to keep track of current stream
        state and update it as things change.
      
      Change-Id: I5938c2be3c6f0a003aa88a39a59e0880f8b2df3d
      32b3e36c
  25. Apr 12, 2017
    • George Joseph's avatar
      modules: change module LOAD_FAILUREs to LOAD_DECLINES (14) · 6db0939b
      George Joseph authored
      Change-Id: If99e3b4fc2d7e86fc3e61182aa6c835b407ed49e
      6db0939b
    • George Joseph's avatar
      modules: change module LOAD_FAILUREs to LOAD_DECLINES · 747beb1e
      George Joseph authored
      In all non-pbx modules, AST_MODULE_LOAD_FAILURE has been changed
      to AST_MODULE_LOAD_DECLINE.  This prevents asterisk from exiting
      if a module can't be loaded.  If the user wishes to retain the
      FAILURE behavior for a specific module, they can use the "require"
      or "preload-require" keyword in modules.conf.
      
      A new API was added to logger: ast_is_logger_initialized().  This
      allows asterisk.c/check_init() to print to the error log once the
      logger subsystem is ready instead of just to stdout.  If something
      does fail before the logger is initialized, we now print to stderr
      instead of stdout.
      
      Change-Id: I5f4b50623d9b5a6cb7c5624a8c5c1274c13b2b25
      747beb1e
  26. Mar 27, 2017
    • Joshua Colp's avatar
      channel: Remove old epoll support and fixed max number of file descriptors. · 5d938045
      Joshua Colp authored
      This change removes the old epoll support which has not been used or
      maintained in quite some time.
      
      The fixed number of file descriptors on a channel has also been removed.
      File descriptors are now contained in a growable vector. This can be
      used like before by specifying a specific position to store a file
      descriptor at or using a new API call, ast_channel_fd_add, which adds
      a file descriptor to the channel and returns its position.
      
      Tests have been added which cover the growing behavior of the vector
      and the new API call.
      
      ASTERISK-26885
      
      Change-Id: I1a754b506c009b83dfdeeb08c2d2815db30ef928
      5d938045
  27. Mar 07, 2017
    • Joshua Colp's avatar
      core: Add stream topology changing primitives with tests. · 3ed05bad
      Joshua Colp authored
      This change adds a few things to facilitate stream topology changing:
      
      1. Control frame types have been added for use by the channel driver
      to notify the application that the channel wants to change the stream
      topology or that a stream topology change has been accepted. They are
      also used by the indicate interface to the channel that the application
      uses to indicate it wants to do the same.
      
      2. Legacy behavior has been adopted in ast_read() such that if a
      channel requests a stream topology change it is denied automatically
      and the current stream topology is preserved if the application is
      not capable of handling streams.
      
      Tests have also been written which confirm the multistream and
      non-multistream behavior.
      
      ASTERISK-26839
      
      Change-Id: Ia68ef22bca8e8457265ca4f0f9de600cbcc10bc9
      3ed05bad
  28. Mar 01, 2017
    • George Joseph's avatar
      stream: Unit tests for stream read and tweaks framework · 0560c323
      George Joseph authored
      * Removed the AST_CHAN_TP_MULTISTREAM tech property.  We now rely
        on read_stream being set to indicate a multi stream channel.
      * Added ast_channel_is_multistream convenience function.
      * Fixed issue where stream and default_stream weren't being set on
        a frame retrieved from the queue.
      * Now testing for NULL being returned from the driver's read or
        read_stream callback.
      * Fixed issue where the dropnondefault code was crashing on a
        NULL f.
      * Now enforcing that if either read_stream or write_stream are
        set when ast_channel_tech_set is called that BOTH are set.
      * Added the unit tests.
      
      ASTERISK-26816
      
      Change-Id: If7792b20d782e71e823dabd3124572cf0a4caab2
      0560c323
  29. Feb 23, 2017
    • Joshua Colp's avatar
      channel: Add support for writing to a specific stream. · 6cc890b8
      Joshua Colp authored
      This change adds an ast_write_stream function which allows
      writing a frame to a specific media stream. It also moves
      ast_write() to using this underneath by writing media
      frames provided to it to the default streams of the channel.
      Existing functionality (such as audiohooks, framehooks, etc)
      are limited to being applied to the default stream only.
      
      Unit tests have also been added which test the behavior of
      both non-multistream and multistream channels to confirm that
      the write() and write_stream() callbacks are invoked
      appropriately.
      
      ASTERISK-26793
      
      Change-Id: I4df20d1b65bd4d787fce0b4b478e19d2dfea245c
      6cc890b8
  30. Feb 16, 2017
  31. Feb 15, 2017
    • Joshua Colp's avatar
      stream: Add unit tests for channel stream usage. · a9c15a0e
      Joshua Colp authored
      This change adds unit tests cover the following:
      
      1. That retrieving the first media stream of a specific media
      type from a stream topology retrieves the expected media
      stream.
      
      2. That setting the native formats of a channel which does
      not support streams results in the creation of streams on
      its behalf according to the formats of the channel.
      
      3. That setting a stream topology on a channel which supports
      streams sets the topology to the provided one.
      
      ASTERISK-26790
      
      Change-Id: Ic53176dd3e4532e8c3e97d9e22f8a4b66a2bb755
      a9c15a0e
  32. Feb 14, 2017
  33. Feb 13, 2017
    • Joshua Colp's avatar
      stream: Add stream topology unit tests and fix uncovered bugs. · 6c4657e2
      Joshua Colp authored
      This change adds unit tests for the various API calls relating
      to stream topologies. This includes creation, destruction,
      inspection, and manipulation.
      
      Through this a few bugs were uncovered in the implementation:
      
      1. Creating a topology using a format capabilities would fail as
      the code considered a return value of 0 from the append stream
      function to indicate an error which is incorrect.
      
      2. Not all functions which placed a stream into a topology
      set the position on the stream itself.
      
      3. Appending a stream would cause a frack if the position
      provided was the last one. This occurred because the existing
      stream was queried but the index was outside of what the
      vector was currently at for size.
      
      ASTERISK-26786
      
      Change-Id: Id5590e87c8a605deea1a89e53169a9c011d66fa0
      6c4657e2
Loading