Skip to content
Snippets Groups Projects
  1. Jan 31, 2022
    • Naveen Albert's avatar
      cdr: allow disabling CDR by default on new channels · 386c5e49
      Naveen Albert authored
      Adds a new option, defaultenabled, to the CDR core to
      control whether or not CDR is enabled on a newly created
      channel. This allows CDR to be disabled by default on
      new channels and require the user to explicitly enable
      CDR if desired. Existing behavior remains unchanged.
      
      ASTERISK-29808 #close
      
      Change-Id: Ibb78c11974bda229bbb7004b64761980e0b2c6d1
      386c5e49
  2. Jan 21, 2022
    • Mike Bradeen's avatar
      sched: fix and test a double deref on delete of an executing call back · b79a5712
      Mike Bradeen authored
      sched: Avoid a double deref when AST_SCHED_DEL_UNREF is called on an
      executing call-back. This is done by adding a new variable 'rescheduled'
      to the struct sched which is set in ast_sched_runq and checked in
      ast_sched_del_nonrunning. ast_sched_del_nonrunning is a replacement for
      now deprecated ast_sched_del which returns a new possible value -2
      if called on an executing call-back with rescheduled set. ast_sched_del
      is modified to call ast_sched_del_nonrunning to maintain existing code.
      AST_SCHED_DEL_UNREF is also updated to look for the -2 in which case it
      will not throw a warning or invoke refcall.
      test_sched: Add a new unit test sched_test_freebird that will check the
      reference count in the resolved scenario.
      
      ASTERISK-29698
      
      Change-Id: Icfb16b3acbc29cf5b4cef74183f7531caaefe21d
      b79a5712
  3. Jan 04, 2022
    • Josh Soref's avatar
      test_time.c: Tolerate DST transitions · 2b614400
      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
      2b614400
  4. Dec 13, 2021
  5. Dec 02, 2021
  6. Nov 18, 2021
  7. Nov 16, 2021
    • Josh Soref's avatar
      tests: Spelling fixes · e54a9d31
      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
      e54a9d31
  8. Nov 09, 2021
  9. Oct 28, 2021
    • Kevin Harwell's avatar
      strings/json: Add string delimter match, and object create with vars methods · 67d1f881
      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
      67d1f881
  10. Oct 21, 2021
    • Mike Bradeen's avatar
      various: Fix GCC 11 compilation issues. · 99a1a427
      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
      99a1a427
  11. Sep 13, 2021
  12. Sep 10, 2021
  13. Aug 17, 2021
  14. Jul 19, 2021
  15. Mar 31, 2021
    • Kevin Harwell's avatar
      res_rtp_asterisk: Don't count 0 as a minimum lost packets · c4a376aa
      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
      c4a376aa
    • Kevin Harwell's avatar
      time: Add timeval create and unit conversion functions · eb92fb72
      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
      eb92fb72
  16. Mar 19, 2021
  17. Dec 09, 2020
    • lvl's avatar
      Introduce astcachedir, to be used for temporary bucket files · b0842713
      lvl authored
      As described in the issue, /tmp is not a suitable location for a
      large amount of cached media files, since most distributions make
      /tmp a RAM-based tmpfs mount with limited capacity.
      
      I opted for a location that can be configured separately, as opposed
      to using a subdirectory of spooldir, given the different storage
      profile (transient files vs files that might stay there indefinitely).
      
      This commit just makes the cache directory configurable, and changes
      the default location from /tmp to /var/cache/asterisk.
      
      ASTERISK-29143
      
      Change-Id: Ic54e95199405abacd9e509cef5f08fa14c510b5d
      b0842713
  18. Nov 20, 2020
  19. Oct 13, 2020
    • Joshua C. Colp's avatar
      res_pjsip: Adjust outgoing offer call pref. · dcd2ed69
      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
      dcd2ed69
  20. Sep 02, 2020
  21. Jul 24, 2020
  22. 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
  23. 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
  24. 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
  25. 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
  26. Apr 08, 2020
  27. 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
  28. Mar 31, 2020
  29. 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
  30. 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
  31. Dec 02, 2019
  32. 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
  33. 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
  34. Oct 10, 2019
  35. 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
Loading