Skip to content
Snippets Groups Projects
  1. Jan 04, 2022
    • Josh Soref's avatar
      test_time.c: Tolerate DST transitions · a5cdee36
      Josh Soref authored
      When test_timezone_watch runs very near a DST transition,
      two time zones that would otherwise be expected to report the same
      time can differ because of the DST transition.
      
      Instead of having the test fail when this happens, report the
      times, time zones, and dst flags.
      
      ASTERISK-29722
      
      Change-Id: Id59bdac8b277e14343ccdf0c99b89e92f79f316a
      a5cdee36
  2. Dec 13, 2021
  3. Dec 02, 2021
  4. Nov 18, 2021
  5. Nov 16, 2021
    • Josh Soref's avatar
      tests: Spelling fixes · 4fc59ccc
      Josh Soref authored
      Correct typos of the following word families:
      
      mounting
      jitterbuffer
      thrashing
      original
      manipulating
      entries
      actual
      possibility
      tasks
      options
      positives
      taskprocessor
      other
      dynamic
      declarative
      
      ASTERISK-29714
      
      Change-Id: I6b94659d045eec5d8d020fce2e9b6e2f593dfeb6
      4fc59ccc
  6. Nov 09, 2021
  7. Oct 28, 2021
    • Kevin Harwell's avatar
      strings/json: Add string delimter match, and object create with vars methods · ae97aaed
      Kevin Harwell authored
      Add a function to check if there is an exact match a one string between
      delimiters in another string.
      
      Add a function that will create an ast_json object out of a list of
      Asterisk variables. An excludes string can also optionally be passed
      in.
      
      Also, add a macro to make it easier to get object integers.
      
      Change-Id: I5f34f18e102126aef3997f19a553a266d70d6226
      ae97aaed
  8. Oct 21, 2021
    • Mike Bradeen's avatar
      various: Fix GCC 11 compilation issues. · 0b2646ae
      Mike Bradeen authored
      test_voicemail_api: Use empty char* for empty_msg_ids.
      chan_skinny: Fix size of calledParty to be maximum extension.
      menuselect: Change Makefile to stop deprecated warnings. Added comments
      test_linkedlist: 'bogus' variable was manually allocated from a macro
      and the test fails if this happens but the compiler couldn't 'see' this
      and returns a warning. memset to all 0's after allocation.
      chan_ooh323: Fixed various indentation issues that triggered misleading
       indentation warnings.
      
      ASTERISK-29682
      Reported by: George Joseph
      
      Change-Id: If4fe42222c8444dc16828a42731ee53b4ce5cbbe
      0b2646ae
  9. Sep 13, 2021
  10. Sep 10, 2021
  11. Jul 19, 2021
    • Sean Bright's avatar
      res_http_media_cache.c: Parse media URLs to find extensions. · 76c09b1c
      Sean Bright authored
      Use the URI parsing functions to parse playback URLs in order to find
      their file extensions.
      
      For backwards compatibility, we first look at the full URL, then at
      any Content-Type header, and finally at just the path portion of the
      URL.
      
      ASTERISK-27871 #close
      
      Change-Id: I16d0682f6d794be96539261b3e48f237909139cb
      76c09b1c
  12. Mar 31, 2021
    • Kevin Harwell's avatar
      res_rtp_asterisk: Don't count 0 as a minimum lost packets · 0ad1ff8a
      Kevin Harwell authored
      The calculated minimum lost packets represents the lowest number of
      lost packets missed during an RTCP report interval. Zero of course
      is the lowest, but the idea is that this value contain the lowest
      number of lost packets once some have been missed.
      
      This patch checks to make sure the number of lost packets over an
      interval is not zero before checking and setting the minimum value.
      
      Also, this patch updates the rtp lost packet test to check for
      packet loss over several reports vs one.
      
      Change-Id: I07d6e21cec61e289c2326138d6bcbcb3c3d5e008
      0ad1ff8a
    • Kevin Harwell's avatar
      time: Add timeval create and unit conversion functions · 15de2f17
      Kevin Harwell authored
      Added a TIME_UNIT enumeration, and a function that converts a
      string to one of the enumerated values. Also, added functions
      that create and initialize a timeval object using a specified
      value, and unit type.
      
      Change-Id: Ic31a1c3262a44f77a5ef78bfc85dcf69a8d47392
      15de2f17
  13. Mar 19, 2021
  14. Nov 20, 2020
  15. Oct 13, 2020
    • Joshua C. Colp's avatar
      res_pjsip: Adjust outgoing offer call pref. · 412b385d
      Joshua C. Colp authored
      This changes the outgoing offer call preference
      default option to match the behavior of previous
      versions of Asterisk.
      
      The additional advanced codec negotiation options
      have also been removed from the sample configuration
      and marked as reserved for future functionality in
      XML documentation.
      
      The codec preference options have also been fixed to
      enforce local codec configuration.
      
      ASTERISK-29109
      
      Change-Id: Iad19347bd5f3d89900c15ecddfebf5e20950a1c2
      412b385d
  16. Sep 02, 2020
  17. Jul 24, 2020
  18. Jul 01, 2020
    • George Joseph's avatar
      Streams: Add features for Advanced Codec Negotiation · 8d1064ea
      George Joseph authored
      The Streams API becomes the home for the core ACN capabilities.
      These include...
      
       * Parsing and formatting of codec negotation preferences.
       * Resolving pending streams and topologies with those configured
         using configured preferences.
       * Utility functions for creating string representations of
         streams, topologies, and negotiation preferences.
      
      For codec negotiation preferences:
       * Added ast_stream_codec_prefs_parse() which takes a string
         representation of codec negotiation preferences, which
         may come from a pjsip endpoint for example, and populates
         a ast_stream_codec_negotiation_prefs structure.
       * Added ast_stream_codec_prefs_to_str() which does the reverse.
       * Added many functions to parse individual parameter name
         and value strings to their respectrive enum values, and the
         reverse.
      
      For streams:
       * Added ast_stream_create_resolved() which takes a "live" stream
         and resolves it with a configured stream and the negotiation
         preferences to create a new stream.
       * Added ast_stream_to_str() which create a string representation
         of a stream suitable for debug or display purposes.
      
      For topology:
       * Added ast_stream_topology_create_resolved() which takes a "live"
         topology and resolves it, stream by stream, with a configured
         topology stream and the negotiation preferences to create a new
         topology.
       * Added ast_stream_topology_to_str() which create a string
         representation of a topology suitable for debug or display
         purposes.
       * Renamed ast_format_caps_from_topology() to
         ast_stream_topology_get_formats() to be more consistent with
         the existing ast_stream_get_formats().
      
      Additional changes:
       * A new function ast_format_cap_append_names() appends the results
         to the ast_str buffer instead of replacing buffer contents.
      
      Change-Id: I2df77dedd0c72c52deb6e329effe057a8e06cd56
      8d1064ea
  19. Jun 30, 2020
    • George Joseph's avatar
      Scope Trace: Add some new tracing macros and an ast_str helper · 7440fd03
      George Joseph authored
      Created new SCOPE_ functions that don't depend on RAII_VAR.  Besides
      generating less code, the use of the explicit SCOPE_EXIT macros
      capture the line number where the scope exited.  The RAII_VAR
      versions can't do that.
      
       * SCOPE_ENTER(level, ...): Like SCOPE_TRACE but doesn't use
         RAII_VAR and therefore needs needs one of...
      
       * SCOPE_EXIT(...): Decrements the trace stack counter and optionally
         prints a message.
      
       * SCOPE_EXIT_EXPR(__expr, ...): Decrements the trace stack counter,
         optionally prints a message, then executes the expression.
         SCOPE_EXIT_EXPR(break, "My while got broken\n");
      
       * SCOPE_EXIT_RTN(, ...): Decrements the trace stack counter,
         optionally prints a message, then returns without a value.
         SCOPE_EXIT_RTN("Bye\n");
      
       * SCOPE_EXIT_RTN_VALUE(__return_value, ...): Decrements the trace
         stack counter, optionally prints a message, then returns the value
         specified.
         SCOPE_EXIT_RTN_VALUE(rc, "Returning with RC: %d\n", rc);
      
      Create an ast_str helper ast_str_tmp() that allocates a temporary
      ast_str that can be passed to a function that needs it, then frees
      it.  This makes using the above macros easier.  Example:
      
         SCOPE_ENTER(1, Format Caps 1: %s  Format Caps 2: %s\n",
             ast_str_tmp(32, ast_format_cap_get_names(cap1, &STR_TMP),
             ast_str_tmp(32, ast_format_cap_get_names(cap2, &STR_TMP));
      
      The calls to ast_str_tmp create an ast_str of the specified initial
      length which can be referenced as STR_TMP.  It then calls the
      expression, which must return a char *, ast_strdupa's it, frees
      STR_TMP, then returns the ast_strdupa'd string.  That string is
      freed when the function returns.
      
      Change-Id: I44059b20d55a889aa91440d2f8a590865998be51
      7440fd03
  20. Jun 10, 2020
    • Kevin Harwell's avatar
      Compiler fixes for gcc 10 · 3d1bf3c5
      Kevin Harwell authored
      This patch fixes a few compile warnings/errors that now occur when using gcc
      10+.
      
      Also, the Makefile.rules check to turn off partial inlining in gcc versions
      greater or equal to 8.2.1 had a bug where it only it only checked against
      versions with at least 3 numbers (ex: 8.2.1 vs 10). This patch now ensures
      any version above the specified version is correctly compared.
      
      Change-Id: I54718496eb0c3ce5bd6d427cd279a29e8d2825f9
      3d1bf3c5
  21. Jun 02, 2020
    • George Joseph's avatar
      Scope Tracing: A new facility for tracing scope enter/exit · ca3c22c5
      George Joseph authored
      What's wrong with ast_debug?
      
        ast_debug is fine for general purpose debug output but it's not
        really geared for scope tracing since it doesn't present its
        output in a way that makes capturing and analyzing flow through
        Asterisk easy.
      
      How is scope tracing better?
      
        Scope tracing uses the same "cleanup" attribute that RAII_VAR
        uses to print messages to a separate "trace" log level.  Even
        better, the messages are indented and unindented based on a
        thread-local call depth counter.  When output to a separate log
        file, the output is uncluttered and easy to follow.
      
        Here's an example of the output. The leading timestamps and
        thread ids are removed and the output cut off at 68 columns for
        commit message restrictions but you get the idea.
      
      --> res_pjsip_session.c:3680 handle_incoming PJSIP/1173-00000001
      	--> res_pjsip_session.c:3661 handle_incoming_response PJSIP/1173
      		--> res_pjsip_session.c:3669 handle_incoming_response PJSIP/
      			--> chan_pjsip.c:3265 chan_pjsip_incoming_response_after
      				--> chan_pjsip.c:3194 chan_pjsip_incoming_response P
      					    chan_pjsip.c:3245 chan_pjsip_incoming_respon
      				<-- chan_pjsip.c:3194 chan_pjsip_incoming_response P
      			<-- chan_pjsip.c:3265 chan_pjsip_incoming_response_after
      		<-- res_pjsip_session.c:3669 handle_incoming_response PJSIP/
      	<-- res_pjsip_session.c:3661 handle_incoming_response PJSIP/1173
      <-- res_pjsip_session.c:3680 handle_incoming PJSIP/1173-00000001
      
        The messages with the "-->" or "<--" were produced by including
        the following at the top of each function:
      
        SCOPE_TRACE(1, "%s\n", ast_sip_session_get_name(session));
      
        Scope isn't limited to functions any more than RAII_VAR is.  You
        can also see entry and exit from "if", "for", "while", etc blocks.
      
        There is also an ast_trace() macro that doesn't track entry or
        exit but simply outputs a message to the trace log using the
        current indent level.  The deepest message in the sample
        (chan_pjsip.c:3245) was used to indicate which "case" in a
        "select" was executed.
      
      How do you use it?
      
        More documentation is available in logger.h but here's an overview:
      
        * Configure with --enable-dev-mode.  Like debug, scope tracing
          is #ifdef'd out if devmode isn't enabled.
      
        * Add a SCOPE_TRACE() call to the top of your function.
      
        * Set a logger channel in logger.conf to output the "trace" level.
      
        * Use the CLI (or cli.conf) to set a trace level similar to setting
          debug level... CLI> core set trace 2 res_pjsip.so
      
      Summary Of Changes:
      
        * Added LOG_TRACE logger level.  Actually it occupies the slot
          formerly occupied by the now defunct "event" level.
      
        * Added core asterisk option "trace" similar to debug.  Includes
      	ability to specify global trace level in asterisk.conf and CLI
      	commands to turn on/off and set levels.  Levels can be set
      	globally (probably not a good idea), or by module/source file.
      
        * Updated sample asterisk.conf and logger.conf.  Tracing is
          disabled by default in both.
      
        * Added __ast_trace() to logger.c which keeps track of the indent
          level using TLS. It's #ifdef'd out if devmode isn't enabled.
      
        * Added ast_trace() and SCOPE_TRACE() macros to logger.h.
          These are all #ifdef'd out if devmode isn't enabled.
      
      Why not use gcc's -finstrument-functions capability?
      
        gcc's facility doesn't allow access to local data and doesn't
        operate on non-function scopes.
      
      Known Issues:
      
        The only know issue is that we currently don't know the line
        number where the scope exited.  It's reported as the same place
        the scope was entered.  There's probably a way to get around it
        but it might involve looking at the stack and doing an 'addr2line'
        to get the line number.  Kind of like ast_backtrace() does.
        Not sure if it's worth it.
      
      Change-Id: Ic5ebb859883f9c10a08c5630802de33500cad027
      ca3c22c5
  22. Apr 08, 2020
  23. Apr 06, 2020
    • George Joseph's avatar
      test_res_pjsip_session_caps: Create unit test · 7ba6d430
      George Joseph authored
      This unit test runs through combinations of...
      	* Local codecs
      	* Remote Codecs
      	* Codec Preference
      	* Incoming/Outgoing
      
      A few new APIs were created to make it easier to test
      the functionality but didn't result in any actual
      functional change.
      
      ASTERISK_28777
      
      Change-Id: Ic8957c43e7ceeab0e9272af60ea53f056164f164
      7ba6d430
  24. Mar 31, 2020
  25. Mar 13, 2020
    • George Joseph's avatar
      CI: Create generic jenkinsfile · 00a7e4b5
      George Joseph authored
      This is a generic jenkinsfile to build Asterisk and optionally
      perform one or more of the following:
       * Publish the API docs to the wiki
       * Run the Unit tests
       * Run Testsuite Tests
      
      This job can be triggered manually from Jenkins or be triggered
      automatically on a schedule based on a cron string.
      
      Change-Id: Id9d22a778a1916b666e0e700af2b9f1bacda0852
      00a7e4b5
  26. Jan 08, 2020
    • George Joseph's avatar
      CI: Update buildAsterisk.sh to do a "make full" · d5f3ec92
      George Joseph authored
      If you do a "make all" when building Asterisk the xml documentation
      produced will be missing certain AMI events where their
      documentation is located not at the top of the c source file but
      embedded further down next to the event's manager_event()
      registration call.  See main/manager_mwi.c for an example.
      
      "make full" does produce the correct documentation so we're changing
      it in the build script.  A separate commit/issue will address the
      problem with "make all".
      
      ASTERISK-28507
      Reported by: David Lee
      
      Change-Id: I4a22635d6eef99eacecc0efb69e28360eebdb86c
      d5f3ec92
  27. Dec 02, 2019
  28. Nov 19, 2019
    • George Joseph's avatar
      CI: Fix missing script block in jenkinsfiles · 2a6a2800
      George Joseph authored
      Change-Id: I9f44a3d5085ea7880fad1a3883a4820907e29ea3
      (cherry picked from commit 95213b01)
      2a6a2800
    • George Joseph's avatar
      CI: Fix missing script block in jenkinsfiles · 4abb54b2
      George Joseph authored
      Change-Id: Ib4b6e4887695f230ea7a5b0c879b29fc5a13be4f
      (cherry picked from commit d60f23ec)
      (cherry picked from commit ce8a23fd)
      (cherry picked from commit f0d1ce50)
      4abb54b2
    • George Joseph's avatar
      CI: Increase clone depth and do better cleanup · e8e1314f
      George Joseph authored
      The original clone depth of 10 was causing the need to rebase
      changes whose parent was older than the 10 commits.  The clone
      depth has been increased to 100.
      
      Workspace cleanup was only happening for successful builds which
      wasn't enough to keep the 8G workspace in-memory drives on the
      docker slaves from filling up.  Now the workspaces are cleaned up
      after every build regardless of success/failure.  If you need to
      preserve builds temporarily, you can log into Jenkins/Manage
      Jenkins/Configure System and change the CLEANUP_WS_* environment
      variable for the job type you're troubleshooting to "FALSE".
      
      Change-Id: I0d7366e87cea714e5dbc9488caf718802fce75ca
      e8e1314f
  29. Oct 14, 2019
    • Joshua Colp's avatar
      test_res_rtp: Enable FIR and REMB nominal tests. · a60d2e90
      Joshua Colp authored
      Now that both FIR and REMB are being sent in compound packets
      these tests can be enabled.
      
      This also extends the REMB nominal test to cover the REMB
      contents itself.
      
      Change-Id: Ibfee526ad780eefcce5dd787f53785382210024a
      a60d2e90
  30. Oct 10, 2019
  31. Oct 07, 2019
    • Kevin Harwell's avatar
      serializer: move/add asterisk serializer pool functionality · c0efe19c
      Kevin Harwell authored
      Serializer pools have previously existed in Asterisk. However, for the most
      part the code has been duplicated across modules. This patch abstracts the
      code into an 'ast_serializer_pool' object. As well the code is now centralized
      in serializer.c/h.
      
      In addition serializer pools can now optionally be monitored by a shutdown
      group. This will prevent the pool from being destroyed until all serializers
      have completed.
      
      Change-Id: Ib1e906144b90ffd4d5ed9826f0b719ca9c6d2971
      c0efe19c
  32. Sep 10, 2019
    • Ben Ford's avatar
      res_rtp: Add unit tests for RTCP stats. · 0e56643d
      Ben Ford authored
      Added unit tests for RTCP video stats. These tests include NACK, REMB,
      FIR/FUR/PLI, SR/RR/SDES, and packet loss statistics. The REMB and FIR
      tests are currently disabled due to a bug. We expect to receive a
      compound packet, but the code sends this out as a single packet, which
      the browser accepts, but makes Asterisk upset.
      
      While writing these tests, I noticed an issue with NACK as well. Where
      it is handling a received NACK request, it was reading in only the first
      8 bits of following packets that were also lost. This has been changed
      to the correct value of 16 bits.
      
      Also made a minor fix to the data buffer unit test.
      
      Change-Id: I56107c7411003a247589bbb6086d25c54719901b
      0e56643d
  33. Sep 04, 2019
    • Chris-Savinovich's avatar
      test_utils.c: Skip test adsi_loaded_test if module not loaded. · ed757cc7
      Chris-Savinovich authored
      Module res_adsi.so is deprecated, therefore it does not load by default.
      Module not loaded causes it to yield a FAIL when tested by tests/test_utils.c.
      This fix checks if the corresponding module is loaded at the start of the test,
      and if not, it passes the test and exits with a message.
      
      This fix is applied to all versions where the module is marked deprecated.
      
      Change-Id: I52be64c8f6af222e15148a856d1f10cb113e1e94
      ed757cc7
  34. Aug 08, 2019
    • George Joseph's avatar
      CI: Escape backslashes in printenv/sort/tr · 446bac73
      George Joseph authored
      Change-Id: I52be64c8f6af2bbe15148a856d1f10cb113e1e94
      (cherry picked from commit c6558e09)
      446bac73
    • George Joseph's avatar
      CI: Add "throttle" label and "skip_gate" capability · be613060
      George Joseph authored
      To make throttling by label fully active, the "throttle" option
      has to be specified with a specific label.
      
      You can now specify "skip_gate" in the Gerrit comments when you
      do a +2 code review to tell Jenkins not to actually run the
      gate.  You'd do this if you plan to manually merge the change.
      
      Also updated the "printenv" debug output to better sort multi-line
      comments.
      
      Change-Id: I4c0b1085acec4805f2ca207eebac50aad81f27e2
      be613060
  35. Aug 06, 2019
    • George Joseph's avatar
      CI: Make node labels job-specific · c01dd2a4
      George Joseph authored
      Originally, the eligible nodes for a job were labelled only by
      "swdev-docker".  So basically any node could run any job.  We had
      found that allowing a node to run more than 1 gate at a time was
      problematic so we limited the nodes to processing 1 job at a time.
      With the creation of the Asterisk 17 branches however, we now have
      so many active branches that getting checks and gates through in
      a timely manner is problematic when a node can run only 1 job
      at a time.
      
      Now the nodes are also labelled by the job type they can run.
      For instance: "asterisk-check", "asterisk-gate", etc.  With the
      "Throttle Concurrent Builds" plugin, we can now allow a node to
      run more than 1 job BUT throttle by job type.  For instance:
        Allow 2 jobs but only 1 asterisk-gate at a time.
      Now a node can run 2 checks or 1 check and 1 gate or 1 gate but
      not 2 gates at a time.
      
      Change-Id: I2032bf6afbcec5c341d9b852214c0c812d3d6db5
      c01dd2a4
  36. Jul 24, 2019
Loading