Skip to content
Snippets Groups Projects
  1. Feb 20, 2019
    • Sungtae Kim's avatar
      http.c: Support separated HTTP request · b4ccaad6
      Sungtae Kim authored
      Currently, the Asterisk does not support seperated HTTP request.
      This patch make the Asterisk enables to wait lest part of HTTP request.
      Also increases acceptable HTTP body length to 40k to support more
      larger request.
      
      ASTERISK-28236
      
      Change-Id: I48a401aa64a21c3b37bf3cb4e0486d64b7dd8aa1
      b4ccaad6
    • Joshua C. Colp's avatar
      stasis: Store subscriber uniqueids with topic statistics. · a286f546
      Joshua C. Colp authored
      This change provides an easier mechanism to determine which
      subscribers are subscribed to a topic. Using this you can
      inspect the specific subscribers for further details.
      
      Change-Id: I8deea21703cd5c5357b85593b46c3eaf24e18c0c
      a286f546
    • George Joseph's avatar
      taskprocessor: Enable subsystems and overload by subsystem · c2adeb9d
      George Joseph authored
      To prevent one subsystem's taskprocessors from causing others
      to stall, new capabilities have been added to taskprocessors.
      
      * Any taskprocessor name that has a '/' will have the part
        before the '/' saved as its "subsystem".
        Examples:
        "sorcery/acl-0000006a" and "sorcery/aor-00000019"
        will be grouped to subsystem "sorcery".
        "pjsip/distributor-00000025" and "pjsip/distributor-00000026"
        will bn grouped to subsystem "pjsip".
        Taskprocessors with no '/' have an empty subsystem.
      
      * When a taskprocessor enters high-water alert status and it
        has a non-empty subsystem, the subsystem alert count will
        be incremented.
      
      * When a taskprocessor leaves high-water alert status and it
        has a non-empty subsystem, the subsystem alert count will be
        decremented.
      
      * A new api ast_taskprocessor_get_subsystem_alert() has been
        added that returns the number of taskprocessors in alert for
        the subsystem.
      
      * A new CLI command "core show taskprocessor alerted subsystems"
        has been added.
      
      * A new unit test was addded.
      
      REMINDER: The taskprocessor code itself doesn't take any action
      based on high-water alerts or overloading.  It's up to taskprocessor
      users to check and take action themselves.  Currently only the pjsip
      distributor does this.
      
      * A new pjsip/global option "taskprocessor_overload_trigger"
        has been added that allows the user to select the trigger
        mechanism the distributor uses to pause accepting new requests.
        "none": Don't pause on any overload condition.
        "global": Pause on ANY taskprocessor overload (the default and
        current behavior)
        "pjsip_only": Pause only on pjsip taskprocessor overloads.
      
      * The core pjsip pool was renamed from "SIP" to "pjsip" so it can
        be properly grouped into the "pjsip" subsystem.
      
      * stasis taskprocessor names were changed to "stasis" as the
        subsystem.
      
      * Sorcery core taskprocessor names were changed to "sorcery" to
        match the object taskprocessors.
      
      Change-Id: I8c19068bb2fc26610a9f0b8624bdf577a04fcd56
      c2adeb9d
  2. Feb 19, 2019
    • Kevin Harwell's avatar
      json.c/strings.c - Add a couple of utility functions · 8f1b3edd
      Kevin Harwell authored
      Added 'ast_json_object_string_get' to the JSON wrapper in order to make it a
      little easier to retrieve a string field from the JSON object.
      
      Also added an 'ast_strings_equal' function that safely checks (checks for NULLs)
      for equality between two strings.
      
      Change-Id: I26f0a16d61537505eb41b4b05ef2e6d67fc2541b
      8f1b3edd
  3. Feb 05, 2019
    • Sungtae Kim's avatar
      main/cdr: Fixed cdr start overwriting · 5a2a7d65
      Sungtae Kim authored
      The CDR was overwriting the start time when the call continued the
      dialplan from the ARI stasis or a Local channel was originated.
      
      This change fixes this by no longer reinitializing the CDR when
      transitioning out of the dialed pending state to the single state.
      
      ASTERISK-28181
      
      Change-Id: I921bc04064b6cff1deb2eea56a94d86489561cdc
      5a2a7d65
    • Giuseppe Sucameli's avatar
      Fix deadlock handling subscribe req during res_parking reload · e2bbab17
      Giuseppe Sucameli authored
      Split destroy_hint method to separate hint removal and extension hint
      state changed callback, the latter now called via stasis.
      This avoids deadlock between res_parking reload that is removing the
      parking lot and the related hint and subscribe requests coming for the
      same parking lot.
      
      ASTERISK-28173
      
      Change-Id: I5b03c3455b3b12b6f83cea4cc34f4b4b20444f7e
      e2bbab17
  4. Feb 04, 2019
  5. Jan 28, 2019
    • George Joseph's avatar
      media_index.c: Refactored so it doesn't cache the index · 7071e9d6
      George Joseph authored
      Testing revealed that the cache added no benefit but that it could
      consume excessive memory.
      
      Two new index related functions were created:
      ast_sounds_get_index_for_file() and ast_media_index_update_for_file()
      which restrict index updating to specific sound files.
      
      The original ast_sounds_get_index() and ast_media_index_update()
      calls are still available but since they no longer cache the results
      internally, developers should re-use an index they may already have
      instead of calling ast_sounds_get_index() repeatedly.  If information
      for only a single file is needed, ast_sounds_get_index_for_file()
      should be called instead of ast_sounds_get_index().
      
      The media_index directory scan code was elimininated in favor of
      using the existing ast_file_read_dirs() function.
      
      Since there's no more cache, ast_sounds_index_init now only
      registers the sounds cli commands instead of generating the
      initial index and subscribing to stasis format register/unregister
      messages.
      
      "sounds" is no longer a valid target for the "module reload"
      command.
      
      Both the sounds cli commands and the sounds ari resources were
      refactored to only call ast_sounds_get_index() once per invocation
      and to use ast_sounds_get_index_for_file() when a specific sound
      file is requested.
      
      Change-Id: I1cef327ba1b0648d85d218b70ce469ad07f4aa8d
      7071e9d6
  6. Jan 22, 2019
    • Gerald Schnabel's avatar
      manager_channels: Fix throwing of HangupHandler manager events · f9ca0afb
      Gerald Schnabel authored
      The type value extracted from stasis message data in channel_hangup_handler_cb
      isn't compared against the valid values "run", "pop" and "push". Thus the
      manager events HangupHandlerPush, HangupHandlerPop and HangupHandlerRun are
      never thrown.
      
      This regression was introduced by ASTERISK_21462.
      
      ASTERISK-28252
      
      Change-Id: I9956e35e18da1873113644df1ddc3c7cd37bf524
      f9ca0afb
    • Chris-Savinovich's avatar
      Test_cel: Fails when DONT_OPTIMIZE is off · 1c8378bb
      Chris-Savinovich authored
      A bug in GCC causes TEST_CEL to return failure under the following
      conditions:
      1. TEST_FRAMEWORK on
      2. DONT_OPTIMIZE off
      3. Fedora and Ubuntu
      4. GCC 8.2.1
      5. Test name: test_cel_dial_pickup
      6. There must exist a certain combination of multithreading.
      The bug affects arithmetic calculations when the optimization level
      is bigger than O1 and the -fpartial-inline flag is on. Provided these
      conditions, function ast_str_to_lower() fails to convert to lower case
      due to said function being of type force_inline.  The solution is to
      remove the "force_inline" type declaration from function ast_str_to_lower()
      
      Change-Id: Ied32e0071f12ed9d5f3b4cdd878b2532a1c769d7
      1c8378bb
  7. Jan 20, 2019
    • Valentin Vidic's avatar
      channel.c: Fix segfault with Monitor(wav,file,i) · 17f76d27
      Valentin Vidic authored
      If the Monitor is started with the i option the read_stream will be
      NULL. One code path in channel.c checks if write_stream is set but than
      uses read_stream instead causing a segfault.
      
      ASTERISK-28249
      
      Change-Id: I1bae9126537be54895c7fea2d08dd9488d8cc525
      17f76d27
  8. Jan 17, 2019
    • Joshua C. Colp's avatar
      stasis / manager / ari: Better filter messages. · 1323730f
      Joshua C. Colp authored
      Previously both AMI and ARI used a default route on
      their stasis message router to handle some of the
      messages for publishing out their respective
      connection. This caused messages to be given to
      their subscription that could not be formatted
      into AMI or JSON.
      
      This change adds an API call to the stasis message
      router which allows a default route to be set as well
      as formatters that the default route is expecting.
      This allows both AMI and ARI to specify that their
      default route only wants messages of their given
      formatter. By doing so stasis can more intelligently
      filter at publishing time so that they do not receive
      messages which will not be turned into AMI or JSON.
      
      ASTERISK-28244
      
      Change-Id: I65272819a53ce99f869181d1d370da559a7d1703
      1323730f
    • Sean Bright's avatar
      sched: Make sched_settime() return void because it cannot fail · 58b55f2a
      Sean Bright authored
      Change-Id: I66b8b2b2778f186919d73ae9bf592104b8fb1cd5
      58b55f2a
  9. Jan 14, 2019
    • mohitdhiman's avatar
      stasis/endpoint: Fix memory leak of channel_ids in ast_endpoint structure. · d60ee2ee
      mohitdhiman authored
      During Bridging of two channels if masquerade operation is performed on a
      channel (clone channel) which was created with endpoint details
      (ast_channel_alloc_with_endpoint()) and the original channel which is created
      without endpoint details (ast_channel_alloc()) then both the channels must
      exchange their endpoint details or else after masquerade when clone channel
      is being destroyed the endpoint cleanup callbacks will be destroyed too and
      after call completion unique_id of original channel will still be there in
      ast_endpoint structure's channel_ids container.
      
      ASTERISK-28197
      
      Change-Id: I97ce73da390af20fd082fb09d722a6fe9cb2f39d
      d60ee2ee
  10. Jan 02, 2019
    • Richard Mudgett's avatar
      stasic.c: Fix printf format type mismatches with arguments. · 7c08ff51
      Richard Mudgett authored
      An int64_t is not likely the same size as a long.
      
      * Changed the int64_t values in the statistics structs to longs so casting
      is not necessary when generating the formatted CLI output.  The offending
      members did not need to be int64_t anyway as they were only set by an int
      type variable which was already truncating bits.
      
      * Reordered the statistics structs to reduce potential padding bytes.
      
      Change-Id: Ic090a070e9dc4ca650ebdb9c01ed50a581289962
      7c08ff51
  11. Dec 26, 2018
  12. Dec 19, 2018
    • Richard Mudgett's avatar
      backtrace.c: Fix casting pointer to/from integral type. · 314782e8
      Richard Mudgett authored
      The backtrace library bfd.h include file does not get the sizes of
      pointers and ints right on some platforms.  On my old test box the size
      of bfd_vma is 8 while the size of a pointer is 4.  gcc on the box
      complains of the integer casting to/from pointers size mismatch.
      
      * uintptr_t to the rescue by doing an appropriate two stage cast.
      
      Change-Id: Icb2621583f50c8728de08a3c824d95fe53cc45d0
      314782e8
  13. Dec 12, 2018
    • Joshua C. Colp's avatar
      stasis: Add statistics gathering in developer mode. · fe070936
      Joshua C. Colp authored
      This change adds statistics gathering to Stasis topics,
      subscriptions, and message types. These can be viewed using
      CLI commands and provide insight into how Stasis is used
      and how long certain operations take to execute.
      
      These are only available when Asterisk is compiled in
      developer mode and do not have any impact under normal
      operation.
      
      ASTERISK-28117
      
      Change-Id: I94411b53767f89ee01714daaecf0c2f1666e863f
      fe070936
  14. Dec 11, 2018
  15. Dec 07, 2018
    • Sean Bright's avatar
      utils: Wrap socket() and pipe() to reduce syscalls · 6d69fb3c
      Sean Bright authored
      Some platforms provide an implementation of socket() and pipe2() that allow the
      caller to specify that the resulting file descriptors should be non-blocking.
      
      Using these allows us to potentially elide 3 calls into 1 by avoiding extraneous
      calls to fcntl() to set the O_NONBLOCK flag afterwards.
      
      In passing, change ast_alertpipe_init() to use pipe2() directly instead of the
      wrapper if it is available.
      
      Change-Id: I3ebe654fb549587537161506c6c950f4ab298bb0
      6d69fb3c
    • George Joseph's avatar
      stasis: Allow filtering by formatter · 3f3dd992
      George Joseph authored
      A subscriber can now indicate that it only wants messages
      that have formatters of a specific type.  For instance,
      manager can indicate that it only wants messages that have a
      "to_ami" formatter.  You can combine this with the existing
      filter for message type to get only messages with specific
      formatters or messages of specific types.
      
      ASTERISK-28186
      
      Change-Id: Ifdb7a222a73b6b56c6bb9e4ee93dc8a394a5494c
      3f3dd992
  16. Dec 03, 2018
    • Sean Bright's avatar
      core: Add some documentation to the malloc_trim code · 8f5df046
      Sean Bright authored
      This adds documentation to handle_cli_malloc_trim() indicating how it
      can be useful when debugging OOM conditions.
      
      Change-Id: I1936185e78035bf123cd5e097b793a55eeebdc78
      8f5df046
    • Chris-Savinovich's avatar
      core: Merge malloc_trim patch · 58e50e56
      Chris-Savinovich authored
      We've had multiple opportunities where Richard Mudgett's
      malloc_trim patch has been useful. Let's get it
      pushed up to gerrit and merged.
      
      Since malloc_trim is only available in libc, an entry is
      added to configure.ac to create a definition for
      HAVE_MALLOC_TRIM.
      
      Change-Id: Ia38308c550149d9d6eae4ca414a649957de9700c
      58e50e56
  17. Nov 26, 2018
    • George Joseph's avatar
      bridges: Remove reliance on stasis caching · 3667c5e1
      George Joseph authored
      * The bridging core no longer uses the stasis cache for bridge
        snapshots.  The latest bridge snapshot is now stored on the
        ast_bridge structure itself.
      
      * The following APIs are no longer available since the stasis cache
        is no longer used:
          ast_bridge_topic_cached()
          ast_bridge_topic_all_cached()
      
      * A topic pool is now used for individual bridge topics.
      
      * The ast_bridge_cache() function was removed since there's no
        longer a separate container of snapshots.
      
      * A new function "ast_bridges()" was created to retrieve the
        container of all bridges.  Users formerly calling
        ast_bridge_cache() can use the new function to iterate over
        bridges and retrieve the latest snapshot directly from the
        bridge.
      
      * The ast_bridge_snapshot_get_latest() function was renamed to
        ast_bridge_get_snapshot_by_uniqueid().
      
      * A new function "ast_bridge_get_snapshot()" was created to retrieve
        the bridge snapshot directly from the bridge structure.
      
      * The ast_bridge_topic_all() function now returns a normal topic
        not a cached one so you can't use stasis cache functions on it
        either.
      
      * The ast_bridge_snapshot_type() stasis message now has the
        ast_bridge_snapshot_update structure as it's data.  It contains
        the last snapshot and the new one.
      
      * cdr, cel, manager and ari have been updated to use the new
        arrangement.
      
      Change-Id: I7049b80efa88676ce5c4666f818fa18ad1985369
      3667c5e1
    • Joshua Colp's avatar
      stasis: Segment channel snapshot to reduce creation cost. · 50ac85cb
      Joshua Colp authored
      When a channel snapshot was created it used to be done
      from scratch, copying all data (many strings). This incurs
      a cost when doing so.
      
      This change segments the channel snapshot into different
      components which can be reused if unchanged from the
      previous snapshot creation, reducing the cost. In normal
      cases this results in some pointers being copied with
      reference count being bumped, some integers being set,
      and a string or two copied. The other benefit is that it
      is now possible to determine if a channel snapshot update
      is redundant and thus stop it before a message is published
      to stasis.
      
      The specific segments in the channel snapshot were split up
      based on whether they are changed together, how often they
      are changed, and their general grouping. In practice only
      1 (or 0) of the segments actually get changed in normal
      operation.
      
      Invalidation is done by setting a flag on the channel when
      the segment source is changed, forcing creation of a new
      segment when the channel snapshot is created.
      
      ASTERISK-28119
      
      Change-Id: I5d7ef3df963a88ac47bc187d73c5225c315f8423
      50ac85cb
    • Joshua Colp's avatar
      stasis: Use an implementation specific channel snapshot cache. · d0ccbb33
      Joshua Colp authored
      Channels no longer use the Stasis cache for channel snapshots. Instead
      they are stored in a hash table in stasis_channels which reduces the
      number of Stasis messages created and allows better storage.
      
      As a result the following APIs are no longer available since the stasis
      cache is no longer used:
      ast_channel_topic_cached()
      ast_channel_topic_all_cached()
      
      The ast_channel_cache_all() and ast_channel_cache_by_name() functions
      now return an ao2_container of ast_channel_snapshots rather than
      a container of stasis_messages therefore you can't (and don't need
      to) call stasis_cache functions on it.
      
      The ast_channel_topic_all() function now returns a normal topic not
      a cached one so you can't use stasis cache functions on it either.
      
      The ast_channel_snapshot_type() stasis message now has the
      ast_channel_snapshot_update structure as it's data. It contains the
      last snapshot and the new one.
      
      ast_channel_snapshot_get_latest() still returns the latest snapshot.
      
      The latest snapshot is now stored on the channel itself to eliminate
      cache hits when Stasis messages that have the snapshot as a payload
      are created.
      
      ASTERISK-28102
      
      Change-Id: I9334febff60a82d7c39703e49059fa3a68825786
      d0ccbb33
  18. Nov 21, 2018
    • Corey Farrell's avatar
      astobj2: Remove legacy ao2_container_alloc routine. · 021ce938
      Corey Farrell authored
      Replace usage of ao2_container_alloc with ao2_container_alloc_hash or
      ao2_container_alloc_list.  Remove ao2_container_alloc macro.
      
      Change-Id: I0907d78bc66efc775672df37c8faad00f2f6c088
      021ce938
    • Corey Farrell's avatar
      astobj2: Create function to copy weak proxied objects from container. · bc7f4f4d
      Corey Farrell authored
      Create ao2_container_dup_weakproxy_objs to perform a similar function to
      ao2_container_dup.  This function expects the source container to have
      weakproxy objects, inserts the associated non-weak objects into the
      destination container.  Orphaned weakproxy objects are ignored.
      
      Create test for this new function and for ao2_weakproxy_find.
      
      Change-Id: I898387f058057e08696fe9070f8cd94ef3a27482
      bc7f4f4d
  19. Nov 19, 2018
    • George Joseph's avatar
      backtrace: Refactor ast_bt_get_symbols so it doesn't crash · ece5f801
      George Joseph authored
      We've been seeing crashes in libbfd when we attempt to generate
      a stack trace from multiple threads.  It turns out that libbfd
      is NOT thread-safe.  It can cache the bfd structure and give it to
      multiple threads without protecting itself.  To get around this,
      we've added a global mutex around the bfd functions and also have
      refactored the use of those functions to be more efficient and
      to provide more information about inlined functions.
      
      Also added a few more tests to test_pbx.c.  One just calls
      ast_assert() and the other calls ast_log_backtrace().  Neither are
      run by default.
      
      WARNING:  This change necessitated changing the return value of
      ast_bt_get_symbols() from an array of strings to a VECTOR of
      strings.  However, the use of this function outside Asterisk is not
      likely.
      
      ASTERISK-28140
      
      Change-Id: I79d02862ddaa2423a0809caa4b3b85c128131621
      ece5f801
  20. Nov 18, 2018
    • Joshua C. Colp's avatar
      stasis: Remove stringfields and lock from change message. · 56eb18f3
      Joshua C. Colp authored
      When a subscribe or unsubscribe occurs a message is published
      containing this information. This change makes it so that the
      message no longer uses stringfields or a lock, as both are not
      really needed for the message.
      
      Change-Id: I3f4831931d79f94fd979baf48048738df5dc1632
      56eb18f3
    • Joshua Colp's avatar
      stasis: Add internal filtering of messages. · 3077ad0c
      Joshua Colp authored
      This change adds the ability for subscriptions to indicate
      which message types they are interested in accepting. By
      doing so the filtering is done before being dispatched
      to the subscriber, reducing the amount of work that has
      to be done.
      
      This is optional and if a subscriber does not add
      message types they wish to accept and set the subscription
      to selective filtering the previous behavior is preserved
      and they receive all messages.
      
      There is also the ability to explicitly force the reception
      of all messages for cases such as AMI or ARI where a large
      number of messages are expected that are then generically
      converted into a different format.
      
      ASTERISK-28103
      
      Change-Id: I99bee23895baa0a117985d51683f7963b77aa190
      3077ad0c
  21. Nov 16, 2018
    • Corey Farrell's avatar
      taskprocessor: Prevent race creating new taskprocessor. · 9abd5e10
      Corey Farrell authored
      Task processors are retrieved using a 'get or create' pattern.  The
      singleton container was unlocked between the get and create steps so
      it's possible that two threads could create task processors with the
      same name at the same time.
      
      Change-Id: Id64fae94a6a1e940ddf38fde622dcd4391635382
      9abd5e10
  22. Nov 15, 2018
  23. Nov 14, 2018
    • George Joseph's avatar
      AST-2018-010: Fix length of buffer needed for SRV and NAPTR results · eb5b83b8
      George Joseph authored
      When dn_expand was being called on SRV and NAPTR results, the
      return value was being used to calculate the size of the buffer
      needed to store the host names.  Since dn_expand returns the
      length of the COMPRESSED name the buffer could be too short
      to hold the EXPANDED name.  The expanded name is NULL terminated
      so using strlen() is the correct way to determine the length
      actually needed for the buffer.
      
      ASTERISK-28127
      Reported by: Jan Hoffmann
      
      patches:
        patch.diff submitted by janhoffmann (license 6986)
      
      Change-Id: I4d35d6c431c6c6836cb61d37b1378cc47f0b414d
      eb5b83b8
  24. Nov 12, 2018
  25. Nov 11, 2018
  26. Oct 24, 2018
    • Richard Mudgett's avatar
      logger.c: Fix default console logging when no logger.conf available. · 1b397ebd
      Richard Mudgett authored
      Default logging was not setup correctly when there was no logger.conf.
      This resulted in many expected log messages not actually getting out to
      the console.
      
      Change-Id: I542e61c03b2f630ff5327f9de5641d776c6fa70c
      1b397ebd
    • George Joseph's avatar
      bridge_softmix: Add SDP "label" attribute to streams · 8d1c6bb6
      George Joseph authored
      Adding the "label" attribute used for participant info correlation
      was previously done in app_confbridge but it wasn't working
      correctly because it didn't have knowledge about which video
      streams belonged to which channel.  Only bridge_softmix has that
      data so now it's set when the bridge topology is changed.
      
      ASTERISK-28107
      
      Change-Id: Ieddeca5799d710cad083af3fcc3e677fa2a2a499
      8d1c6bb6
Loading