Skip to content
Snippets Groups Projects
  1. Jan 06, 2021
    • Jaco Kroon's avatar
      func_lock: fix multiple-channel-grant problems. · c7975009
      Jaco Kroon authored
      
      Under contention it becomes possible that multiple channels will be told
      they successfully obtained the lock, which is a bug.  Please refer
      
      ASTERISK-29217
      
      This introduces a couple of changes.
      
      1.  Replaces requesters ao2 container with simple counter (we don't
          really care who is waiting for the lock, only how many).  This is
          updated undex ->mutex to prevent memory access races.
      2.  Correct semantics for ast_cond_timedwait() as described in
          pthread_cond_broadcast(3P) is used (multiple threads can be released
          on a single _signal()).
      3.  Module unload races are taken care of and memory properly cleaned
          up.
      
      Change-Id: I6f68b5ec82ff25b2909daf6e4d19ca864a463e29
      Signed-off-by: default avatarJaco Kroon <jaco@uls.co.za>
      c7975009
  2. Nov 20, 2020
  3. Nov 06, 2020
    • Dovid Bender's avatar
      func_curl.c: Allow user to set what return codes constitute a failure. · bc58e84f
      Dovid Bender authored
      Currently any response from res_curl where we get an answer from the
      web server, regardless of what the response is (404, 403 etc.) Asterisk
      currently treats it as a success. This patch allows you to set which
      codes should be considered as a failure by Asterisk. If say we set
      failurecodes=404,403 then when using curl in realtime if a server gives
      a 404 error Asterisk will try to failover to the next option set in
      extconfig.conf
      
      ASTERISK-28825
      
      Reported by: Dovid Bender
      Code by: Gobinda Paul
      
      Change-Id: I94443e508343e0a3e535e51ea6e0562767639987
      bc58e84f
  4. Nov 03, 2020
  5. Sep 23, 2020
    • Sean Bright's avatar
      func_curl.c: Prevent crash when using CURLOPT(httpheader) · b11b4994
      Sean Bright authored
      Because we use shared thread-local cURL instances, we need to ensure
      that the state of the cURL instance is correct before each invocation.
      
      In the case of custom headers, we were not resetting cURL's internal
      HTTP header pointer which could result in a crash if subsequent
      requests do not configure custom headers.
      
      ASTERISK-29085 #close
      
      Change-Id: I8b4ab34038156dfba613030a45f10e932d2e992d
      b11b4994
  6. Apr 20, 2020
  7. Apr 14, 2020
  8. Apr 08, 2020
  9. Mar 31, 2020
  10. Feb 10, 2020
  11. Jan 13, 2020
    • Sean Bright's avatar
      func_curl: Add 'followlocation' option to CURLOPT() · 0c2bf166
      Sean Bright authored
      We allow for 'maxredirs' to be set, but this value is ignored when
      followlocation is not enabled which, by default, it is not.
      
      ASTERISK-17491 #close
      Reported by: candrews
      
      Change-Id: I96a4ab0142f2fb7d2e96ff976f6cf7b2982c761a
      0c2bf166
  12. Dec 11, 2019
    • Pascal Cadotte Michaud's avatar
      PJSIP_CONTACT: add missing argument documentation · bf4dd3d8
      Pascal Cadotte Michaud authored
      add missing argument "rtt" and "status" to the documentation
      
      The change to the dtd file allow an enumlist to contain one or many
      configOptionToEnum or enum.
      
      This is different from the previous patch I submitted when you could have a
      configOptionToEnum or (a configOptionToEnum followed by one or manu enums) or
      (one or many enums)
      
      ASTERISK-28626
      
      Change-Id: Ia71743ee7ec813f40297b0ddefeee7909db63b6d
      Unverified
      bf4dd3d8
    • Joshua Colp's avatar
      Revert "PJSIP_CONTACT: add missing argument documentation" · d0b198b3
      Joshua Colp authored
      This reverts commit 7e3015d7.
      
      Reason for revert: Regression in XML validation.
      
      validity error : Content model of enumlist is not determinist:
      (configOptionToEnum | (configOptionToEnum , enum+) | enum+)
      
      As we are preparing to do releases and this is not critical
      I am reverting this for now until resolved.
      
      Change-Id: I30c2295f9d7f0a0475674ee77071a7ebabf5b83f
      d0b198b3
  13. Nov 21, 2019
  14. Nov 18, 2019
    • Sean Bright's avatar
      func_env: Prevent FILE() from reading garbage at end-of-file · bf7c8086
      Sean Bright authored
      If the last line of a file does not have a terminating EOL sequence, we
      potentially add garbage to the value returned from the FILE() function.
      
      There is no overflow potential here as we are reading from a buffer of a
      known size, we are just reading too much of it.
      
      ASTERISK-26481 #close
      
      Change-Id: I50dd4fcf416fb3c83150040a1a79a59d9eb1ae01
      bf7c8086
  15. Nov 15, 2019
    • Martin Tomec's avatar
      func_curl.c: Support custom http headers · d257a089
      Martin Tomec authored
      When user wants to send json data, the default Content-Type header
      is incorect (application/x-www-form-urlencoded). This patch allows
      to set any custom headers so the Content-Type header can be
      overriden. User can set multiple headers by multiple calls of
      curlopt(). This approach is not consistent with other parameters,
      but is more readable in dialplan than one call with multiple
      headers.
      
      ASTERISK-28613
      
      Change-Id: I4dd68c3f4e25362ef941d73a3861f58348dcfbf9
      d257a089
  16. Sep 18, 2019
    • Joshua Colp's avatar
      func_jitterbuffer: Add audio/video sync support. · 7298a785
      Joshua Colp authored
      This change adds support to the JITTERBUFFER dialplan function
      for audio and video synchronization. When enabled the RTCP SR
      report is used to produce an NTP timestamp for both the audio and
      video streams. Using this information the video frames are queued
      until their NTP timestamp is equal to or behind the NTP timestamp
      of the audio. The audio jitterbuffer acts as the leader deciding
      when to shrink/grow the jitterbuffer when adaptive is in use. For
      both adaptive and fixed the video buffer follows the size of the
      audio jitterbuffer.
      
      ASTERISK-28533
      
      Change-Id: I3fd75160426465e6d46bb2e198c07b9d314a4492
      7298a785
  17. Sep 14, 2019
  18. Aug 01, 2019
    • Kevin Harwell's avatar
      various modules: json integer overflow · 3656c42c
      Kevin Harwell authored
      There were still a few places in the code that could overflow when "packing"
      a json object with a value outside the base type integer's range. For instance:
      
      unsigned int value = INT_MAX + 1
      ast_json_pack("{s: i}", value);
      
      would result in a negative number being "packed". In those situations this patch
      alters those values to a ast_json_int_t, which widens the value up to a long or
      long long.
      
      ASTERISK-28480
      
      Change-Id: Ied530780d83e6f1772adba0e28d8938ef30c49a1
      3656c42c
  19. Feb 07, 2019
    • Joshua Colp's avatar
      res_odbc: Add basic query logging. · 54a912b2
      Joshua Colp authored
      When Asterisk is connected and used with a database the response
      time of the database can cause problems in Asterisk if it is long.
      Normally the only way to see this problem would be to retrieve a
      backtrace from Asterisk and examine where things are blocked, or
      examine the database to see if there is any indication of a
      problem.
      
      This change adds some basic query logging to make it easier to
      investigate such a problem. When logging is enabled res_odbc will
      now keep track of the number of queries executed, as well as the
      query that has taken the longest time to execute. There is also
      an option which will cause a WARNING message to be output if a
      query takes longer than a configurable amount of time to execute.
      
      This makes it easier and clearer for users that their database may
      be experiencing a problem that could impact Asterisk.
      
      ASTERISK-28277
      
      Change-Id: I173cf4928b10754478a6a8c27dfa96ede0f058a6
      54a912b2
  20. Nov 21, 2018
  21. Nov 19, 2018
    • Kevin Harwell's avatar
      func_strings: HASHKEY - negative array index can cause corruption · 4b5d11ec
      Kevin Harwell authored
      This patch makes it so only matching non-empty key names, and keys created by
      the HASH function are eligible for inclusion in the comma separated string. It
      also fixes a bug where it was possible to write to a negative index if the
      result buffer was empty.
      
      ASTERISK-28159
      patches:
        ASTERISK-28159.diff submitted by Michael Walton (license 6502)
      
      Change-Id: I6e57fe7307dfd856271753aed5ba64c59b511487
      4b5d11ec
  22. Oct 24, 2018
  23. Oct 04, 2018
    • Richard Mudgett's avatar
      func_periodic_hook.c: Cleanup module resources on failure. · c6c3a636
      Richard Mudgett authored
      * Make load_module() cleanup if it failed to setup the module.
      
      * Make unload_module() always return 0.  It is silly to fail unloading if
      the hook function we try to unregister was not even registered.
      
      Change-Id: I280fc6e8ba2a7ee2588ca01d870eebaf74b4ffe6
      c6c3a636
  24. Jun 21, 2018
  25. Jun 19, 2018
  26. Jun 08, 2018
  27. Jun 07, 2018
    • Alexei Gradinari's avatar
      func_odbc: NODATA if SQLNumResultCols returned 0 columns on readsql · 65ff2f05
      Alexei Gradinari authored
      The functions acf_odbc_read/cli_odbc_read ignore a number of columns
      returned by the SQLNumResultCols.
      If the number of columns is zero it means no data.
      In this case, a SQLFetch function has to be not called,
      because it will cause an error.
      
      ASTERISK-27888 #close
      
      Change-Id: Ie0f7bdac6c405aa5bbd38932c7b831f90729ee19
      65ff2f05
  28. May 11, 2018
    • Corey Farrell's avatar
      Fix GCC 8 build issues. · b5914d90
      Corey Farrell authored
      This fixes build warnings found by GCC 8.  In some cases format
      truncation is intentional so the warning is just suppressed.
      
      ASTERISK-27824 #close
      
      Change-Id: I724f146cbddba8b86619d4c4a9931ee877995c84
      b5914d90
  29. Apr 27, 2018
    • Joshua Colp's avatar
      pjsip: Rewrite OPTIONS support with new eyes. · 882e79b7
      Joshua Colp authored
      The OPTIONS support in PJSIP has organically grown, like many things in
      Asterisk.  It has been tweaked, changed, and adapted based on situations
      run into.  Unfortunately this has taken its toll.  Configuration file
      based objects have poor performance and even dynamic ones aren't that
      great.
      
      This change scraps the existing code and starts fresh with new eyes.  It
      leverages all of the APIs made available such as sorcery observers and
      serializers to provide a better implementation.
      
      1.  The state of contacts, AORs, and endpoints relevant to the qualify
      process is maintained.  This state can be updated by external forces (such
      as a device registering/unregistering) and also the reload process.  This
      state also includes the association between endpoints and AORs.
      
      2.  AORs are scheduled and not contacts.  This reduces the amount of work
      spent juggling scheduled items.
      
      3.  Manipulation of which AORs are being qualified and the endpoint states
      all occur within a serializer to reduce the conflict that can occur with
      multiple threads attempting to modify things.
      
      4.  Operations regarding an AOR use a serializer specific to that AOR.
      
      5.  AORs and endpoint state act as state compositors.  They take input
      from lower level objects (contacts feed AORs, AORs feed endpoint state)
      and determine if a sufficient enough change has occurred to be fed further
      up the chain.
      
      6.  Realtime is supported by using observers to know when a contact has
      been registered.  If state does not exist for the associated AOR then it
      is retrieved and becomes active as appropriate.
      
      The end result of all of this is best shown with a configuration file of
      3000 endpoints each with an AOR that has a static contact.  In the old
      code it would take over a minute to load and use all 8 of my cores.  This
      new code takes 2-3 seconds and barely touches the CPU even while dealing
      with all of the OPTIONS requests.
      
      ASTERISK-26806
      
      Change-Id: I6a5ebbfca9001dfe933eaeac4d3babd8d2e6f082
      882e79b7
  30. Apr 17, 2018
    • George Joseph's avatar
      bridge_softmix: Forward TEXT frames · 4fb7967c
      George Joseph authored
      Core bridging and, more specifically, bridge_softmix have been
      enhanced to relay received frames of type TEXT or TEXT_DATA to all
      participants in a softmix bridge.  res_pjsip_messaging and
      chan_pjsip have been enhanced to take advantage of this so when
      res_pjsip_messaging receives an in-dialog MESSAGE message from a
      user in a conference call, it's relayed to all other participants
      in the call.
      
      res_pjsip_messaging already queues TEXT frames to the channel when
      it receives an in-dialog MESSAGE from an endpoint and chan_pjsip
      will send an MESSAGE when it gets a TEXT frame.  On a normal
      point-to-point call, the frames are forwarded between the two
      correctly.  bridge_softmix was not though so messages weren't
      getting forwarded to conference bridge participants.  Even if they
      were, the bridging code had no way to tell the participants who
      sent the message so it would look like it came from the bridge
      itself.
      
      * The TEXT frame type doesn't allow storage of any meta data, such
      as sender, on the frame so a new TEXT_DATA frame type was added that
      uses the new ast_msg_data structure as its payload.  A channel
      driver can queue a frame of that type when it receives a message
      from outside.  A channel driver can use it for sending messages
      by implementing the new send_text_data channel tech callback and
      setting the new AST_CHAN_TP_SEND_TEXT_DATA flag in its tech
      properties.  If set, the bridging/channel core will use it instead
      of the original send_text callback and it will get the ast_msg_data
      structure. Channel drivers aren't required to implement this.  Even
      if a TEXT_DATA enabled driver uses it for incoming messages, an
      outgoing channel driver that doesn't will still have it's send_text
      callback called with only the message text just as before.
      
      * res_pjsip_messaging now creates a TEXT_DATA frame for incoming
      in-dialog messages and sets the "from" to the display name in the
      "From" header, or if that's empty, the caller id name from the
      channel.  This allows the chat client user to set a friendly name
      for the chat.
      
      * bridge_softmix now forwards TEXT and TEXT_DATA frames to all
      participants (except the sender).
      
      * A new function "ast_sendtext_data" was added to channel which
      takes an ast_msg_data structure and calls a channel's
      send_text_data callback, or if that's not defined, the original
      send_text callback.
      
      * bridge_channel now calls ast_sendtext_data for TEXT_DATA frame
      types and ast_sendtext for TEXT frame types.
      
      * chan_pjsip now uses the "from" name in the ast_msg_data structure
      (if it exists) to set the "From" header display name on outgoing text
      messages.
      
      Change-Id: Idacf5900bfd5f22ab8cd235aa56dfad090d18489
      4fb7967c
  31. Mar 20, 2018
  32. Mar 14, 2018
    • Corey Farrell's avatar
      loader: Convert reload_classes to built-in modules. · 572a508e
      Corey Farrell authored
      * acl (named_acl.c)
      * cdr
      * cel
      * ccss
      * dnsmgr
      * dsp
      * enum
      * extconfig (config.c)
      * features
      * http
      * indications
      * logger
      * manager
      * plc
      * sounds
      * udptl
      
      These modules are now loaded at appropriate time by the module loader.
      Unlike loadable modules these use AST_MODULE_LOAD_FAILURE on error so
      the module loader will abort startup on failure of these modules.
      
      Some of these modules are still initialized or shutdown from outside the
      module loader.  logger.c is initialized very early and shutdown very
      late, manager.c is initialized by the module loader but is shutdown by
      the Asterisk core (too much uses it without holding references).
      
      Change-Id: I371a9a45064f20026c492623ea8062d02a1ab97f
      572a508e
  33. Mar 06, 2018
  34. Feb 22, 2018
  35. Jan 24, 2018
    • Corey Farrell's avatar
      Remove redundant module checks and references. · 527cf5a5
      Corey Farrell authored
      This removes references that are no longer needed due to automatic
      references created by module dependencies.
      
      In addition this removes most calls to ast_module_check as they were
      checking modules which are listed as dependencies.
      
      Change-Id: I332a6e8383d4c72c8e89d988a184ab8320c4872e
      527cf5a5
  36. Jan 15, 2018
    • Corey Farrell's avatar
      loader: Add dependency fields to module structures. · 9cfdb81e
      Corey Farrell authored
      * Declare 'requires' and 'enhances' text fields on module info structure.
      * Rename 'nonoptreq' to 'optional_modules'.
      * Update doxygen comments.
      
      Still need to investigate dependencies among modules I cannot compile.
      
      Change-Id: I3ad9547a0a6442409ff4e352a6d897bef2cc04bf
      9cfdb81e
  37. Jan 04, 2018
  38. Dec 29, 2017
    • Corey Farrell's avatar
      datastore: Add automatic module references. · 0fe7df64
      Corey Farrell authored
      Add a reference to the calling module when it is active to protect
      access to datastore->info.  Remove module references done by
      func_periodic_hook as the datastore now handles it.
      
      ASTERISK-25128 #close
      
      Change-Id: I8357a3711e77591d0d1dd8ab4211a7eedd782c89
      0fe7df64
  39. Dec 28, 2017
Loading