Skip to content
Snippets Groups Projects
  1. Aug 27, 2020
    • Nickolay Shmyrev's avatar
      res_speech: Bump reference on format object · 5b9ac905
      Nickolay Shmyrev authored
      Properly bump reference on format object to avoid memory corruption on double free
      
      ASTERISK-29040 #close
      
      Change-Id: Ic5a7faabfe2ef965ddb024186e1de7ca4542e2a3
      5b9ac905
    • Torrey Searle's avatar
      res_pjsip_diversion: handle 181 · 04051b32
      Torrey Searle authored
      Adapt the response handler so it also called when 181 is received.
      In the case 181 is received, also generate the 181 response.
      
      ASTERISK-29001 #close
      
      Change-Id: I73cfee46a8ca85371280ebdb38674f8fde7510df
      04051b32
  2. Aug 25, 2020
    • Sean Bright's avatar
      app_voicemail: Process urgent messages with mailcmd · c925ed0e
      Sean Bright authored
      Rather than putting messages into INBOX and then moving them to Urgent
      later, put them directly in to the Urgent folder. This prevents
      mailcmd from being skipped.
      
      ASTERISK-27273 #close
      
      Change-Id: I49934e093290d308506ab8d45a40ef705c5ae4f5
      c925ed0e
    • Evandro César Arruda's avatar
      app_queue: Member lastpause time reseting · b2bd38a4
      Evandro César Arruda authored
      This fixes the reseting members lastpause problem when realtime members is being used,
      the function rt_handle_member_record was forcing the reset members lastpause because it
      does not exist in realtime
      
      ASTERISK-29034 #close
      
      Change-Id: Ic9107e4456732a1f78412a32adb2ef87f5da40b5
      b2bd38a4
    • Joshua C. Colp's avatar
      res_pjsip_session: Don't aggressively terminate on failed re-INVITE. · 71ceefa7
      Joshua C. Colp authored
      Per the RFC when an outgoing re-INVITE is done we should
      only terminate the dialog if a 481 or 408 is received.
      
      ASTERISK-29033
      
      Change-Id: I6c3ff513aa41005d02de0396ba820083e9b18503
      71ceefa7
    • Sean Bright's avatar
      bridge_channel: Ensure text messages are zero terminated · 35531929
      Sean Bright authored
      T.140 data in RTP is not zero terminated, so when we are queuing a text
      frame on a bridge we need to ensure that we are passing a zero
      terminated string.
      
      ASTERISK-28974 #close
      
      Change-Id: Ic10057387ce30b2094613ea67e3ae8c5c431dda3
      35531929
    • Sean Bright's avatar
      res_musiconhold.c: Use ast_file_read_dir to scan MoH directory · 057fda46
      Sean Bright authored
      Two changes of note in this patch:
      
      * Use ast_file_read_dir instead of opendir/readdir/closedir
      
      * If the files list should be sorted, do that at the end rather than as
        we go which improves performance for large lists
      
      Change-Id: Ic7e9c913c0f85754c99c74c9cf6dd3514b1b941f
      057fda46
  3. Aug 24, 2020
    • George Joseph's avatar
      scope_trace: Added debug messages and added additional macros · 64ca2d48
      George Joseph authored
      The SCOPE_ENTER and SCOPE_EXIT* macros now print debug messages
      at the same level as the scope level.  This allows the same
      messages to be printed to the debug log when AST_DEVMODE
      isn't enabled.
      
      Also added a few variants of the SCOPE_EXIT macros that will
      also call ast_log instead of ast_debug to make it easier to
      use scope tracing and still print error messages.
      
      Change-Id: I7fe55f7ec28069919a0fc0b11a82235ce904cc21
      64ca2d48
  4. Aug 20, 2020
    • George Joseph's avatar
      stream.c: Added 2 more debugging utils and added pos to stream string · 118cb3f0
      George Joseph authored
       * Added ast_stream_to_stra and ast_stream_topology_to_stra() macros
         which are shortcuts for
            ast_str_tmp(256, ast_stream_to_str(stream, &STR_TMP))
      
       * Added the stream position to the string representation of the
         stream.
      
       * Fixed some formatting in ast_stream_to_str().
      
      Change-Id: Idaf4cb0affa46d4dce58a73a111f35435331cc4b
      118cb3f0
  5. Aug 18, 2020
    • Dennis Buteyn's avatar
      chan_sip: Clear ToHost property on peer when changing to dynamic host · aab666bb
      Dennis Buteyn authored
      The ToHost parameter was not cleared when a peer's host value was
      changed to dynamic. This causes invites to be sent to the original host.
      
      ASTERISK-29011 #close
      
      Change-Id: I9678d512741f71baca8f131a65b7523020b07d5c
      aab666bb
    • George Joseph's avatar
      ACN: Changes specific to the core · 647c53c4
      George Joseph authored
      Allow passing a topology from the called channel back to the
      calling channel.
      
       * Added a new function ast_queue_answer() that accepts a stream
         topology and queues an ANSWER CONTROL frame with it as the
         data.  This allows the called channel to indicate its resolved
         topology.
      
       * Added a new virtual function to the channel tech structure
         answer_with_stream_topology() that allows the calling channel
         to receive the called channel's topology.  Added
         ast_raw_answer_with_stream_topology() that invokes that virtual
         function.
      
       * Modified app_dial.c and features.c to grab the topology from the
         ANSWER frame queued by the answering channel and send it to
         the calling channel with ast_raw_answer_with_stream_topology().
      
       * Modified frame.c to automatically cleanup the reference
         to the topology on ANSWER frames.
      
      Added a few debugging messages to stream.c.
      
      Change-Id: I0115d2ed68d6bae0f87e85abcf16c771bdaf992c
      647c53c4
  6. Aug 14, 2020
    • cmaj's avatar
      Makefile: Fix certified version numbers · 3040edcb
      cmaj authored
      Adds sed before awk to produce reasonable ASTERISKVERSIONNUM
      on certified versions of Asterisk eg. 16.8-cert3 is 160803
      instead of the previous 00800.
      
      ASTERISK-29021 #close
      
      Change-Id: Icf241df0ff6db09011b8c936a317a84b0b634e16
      3040edcb
  7. Aug 11, 2020
    • Sean Bright's avatar
      res_musiconhold.c: Prevent crash with realtime MoH · b7c22054
      Sean Bright authored
      The MoH class internal file vector is potentially being manipulated by
      multiple threads at the same time without sufficient locking. Switch to
      a reference counted list and operate on copies where necessary.
      
      ASTERISK-28927 #close
      
      Change-Id: I479c5dcf88db670956e8cac177b5826c986b0217
      b7c22054
    • Joshua C. Colp's avatar
      res_pjsip: Fix codec preference defaults. · 447f6cc3
      Joshua C. Colp authored
      When reading in a codec preference configuration option
      the value would be set on the respective option before
      applying any default adjustments, resulting in the
      configuration not being as expected.
      
      This was exposed by the REST API push configuration as
      it used the configuration returned by Asterisk to then do
      a modification. In the case of codec preferences one of
      the options had a transcode value of "unspecified" when the
      defaults should have ensured it would be "allow" instead.
      
      This also renames the options in other places that were
      missed.
      
      Change-Id: I4ad42e74fdf181be2e17bc75901c62591d403964
      447f6cc3
  8. Aug 10, 2020
    • Sean Bright's avatar
      vector.h: Fix implementation of AST_VECTOR_COMPACT() for empty vectors · 048b12b5
      Sean Bright authored
      The assumed behavior of realloc() - that it was effectively a free() if
      its second argument was 0 - is Linux specific behavior and is not
      guaranteed by either POSIX or the C specification.
      
      Instead, if we want to resize a vector to 0, do it explicitly.
      
      Change-Id: Ife31d4b510ebab41cb5477fdc7ea4e3138ca8b4f
      048b12b5
    • Michael Neuhauser's avatar
      pjproject: clone sdp to protect against (nat) modifications · e8c2ce28
      Michael Neuhauser authored
      PJSIP, UDP transport with external_media_address and session timers
      enabled. Connected to SIP server that is not in local net. Asterisk
      initiated the connection and is refreshing the session after 150s
      (timeout 300s). The 2nd refresh-INVITE triggered by the pjsip timer has
      a malformed IP address in its SDP (garbage string). This only happens
      when the SDP is modified by the nat-code to replace the local IP address
      with the configured external_media_address.
      Analysis: the code to modify the SDP (in
      res_pjsip_session.c:session_outgoing_nat_hook() and also (redundantly?)
      in res_pjsip_sdp_rtp.c:change_outgoing_sdp_stream_media_address()) uses
      the tdata->pool to allocate the replacement string. But the same
      pjmedia_sdp_stream that was modified for the 1st refresh-INVITE is also
      used for the 2nd refresh-INVITE (because it is stored in pjmedia's
      pjmedia_sdp_neg structure). The problem is, that at that moment, the
      tdata->pool that holds the stringified external_media_address from the
      1. refresh-INVITE has long been reused for something else.
      Fix by Sauw Ming of pjproject (see
      https://github.com/pjsip/pjproject/pull/2476): the local, potentially
      modified pjmedia_sdp_stream is cloned in
      pjproject/source/pjsip/src/pjmedia/sip_neg.c:process_answer() and the
      clone is stored, thereby detaching from the tdata->pool (which is only
      released *after* process_answer())
      
      ASTERISK-28973
      Reported-by: Michael Neuhauser
      
      Change-Id: I272ac22436076596e06aa51b9fa23fd1c7734a0e
      e8c2ce28
  9. Aug 06, 2020
    • Ben Ford's avatar
      utils.c: NULL terminate ast_base64decode_string. · 9ed6387c
      Ben Ford authored
      With the addition of STIR/SHAKEN, the function ast_base64decode_string
      was added for convenience since there is a lot of converting done during
      the STIR/SHAKEN process. This function returned the decoded string for
      you, but did not NULL terminate it, causing some issues (specifically
      with MALLOC_DEBUG). Now, the returned string is NULL terminated, and the
      documentation has been updated to reflect this.
      
      Change-Id: Icdd7d05b323b0c47ff6ed43492937a03641bdcf5
      9ed6387c
    • George Joseph's avatar
      ACN: Configuration renaming for pjsip endpoint · a15e64aa
      George Joseph authored
      This change renames the codec preference endpoint options.
      incoming_offer_codec_prefs becomes codec_prefs_incoming_offer
      to keep the options together when showing an endpoint.
      
      Change-Id: I6202965b4723777f22a83afcbbafcdafb1d11c8d
      a15e64aa
  10. Aug 04, 2020
  11. Jul 28, 2020
    • George Joseph's avatar
      res_pjsip_session: Ensure reused streams have correct bundle group · 1f78ee9d
      George Joseph authored
      When a bundled stream is removed, its bundle_group is reset to -1.
      If that stream is later reused, the bundle parameters on session
      media need to be reset correctly it could mistakenly be rebundled
      with a stream that was removed and never reused.  Since the removed
      stream has no rtp instance, a crash will result.
      
      Change-Id: Ie2b792220f9291587ab5f9fd123145559dba96d7
      1f78ee9d
    • Joshua C. Colp's avatar
      res_pjsip_registrar: Don't specify an expiration for static contacts. · 921b1a02
      Joshua C. Colp authored
      Statically configured contacts on an AOR don't have an expiration
      time so when adding them to the resulting 200 OK if an endpoint
      registers ensure they are marked as such.
      
      ASTERISK-28995
      
      Change-Id: I9f0e45eb2ccdedc9a0df5358634a19ccab0ad596
      921b1a02
    • Sean Bright's avatar
      utf8.c: Add UTF-8 validation and utility functions · 7d96b3e4
      Sean Bright authored
      There are various places in Asterisk - specifically in regards to
      database integration - where having some kind of UTF-8 validation would
      be beneficial. This patch adds:
      
      * Functions to validate that a given string contains only valid UTF-8
        sequences.
      
      * A function to copy a string (similar to ast_copy_string) stopping when
        an invalid UTF-8 sequence is encountered.
      
      * A UTF-8 validator that allows for progressive validation.
      
      All of this is based on the excellent UTF-8 decoder by Björn Höhrmann.
      More information is available here:
      
          https://bjoern.hoehrmann.de/utf-8/decoder/dfa/
      
      The API was written in such a way that should allow us to replace the
      implementation later should we determine that we need something more
      comprehensive.
      
      Change-Id: I3555d787a79e7c780a7800cd26e0b5056368abf9
      7d96b3e4
  12. Jul 24, 2020
  13. Jul 23, 2020
    • Joshua C. Colp's avatar
      websocket / pjsip: Increase maximum packet size. · 9f641483
      Joshua C. Colp authored
      When dealing with a lot of video streams on WebRTC
      the resulting SDPs can grow to be quite large. This
      effectively doubles the maximum size to allow more
      streams to exist.
      
      The res_http_websocket module has also been changed
      to use a buffer on the session for reading in packets
      to ensure that the stack space usage is not excessive.
      
      Change-Id: I31d4351d70c8e2c11564807a7528b984f3fbdd01
      9f641483
  14. Jul 21, 2020
  15. Jul 20, 2020
    • Sean Bright's avatar
      acl.c: Coerce a NULL pointer into the empty string · c3588d9c
      Sean Bright authored
      If an ACL is misconfigured in the realtime database (for instance, the
      "rule" is blank) and Asterisk attempts to read the ACL, Asterisk will
      crash.
      
      ASTERISK-28978 #close
      
      Change-Id: Ic1536c4df856231bfd2da00128f7822224d77610
      c3588d9c
    • Joshua C. Colp's avatar
      pjsip: Include timer patch to prevent cancelling timer 0. · f1d7de12
      Joshua C. Colp authored
      I noticed this while looking at another issue and brought
      it up with Teluu. It was possible for an uninitialized timer
      to be cancelled, resulting in the invalid timer id of 0
      being placed into the timer heap causing issues.
      
      This change is a backport from the pjproject repository
      preventing this from happening.
      
      Change-Id: I1ba318b1f153a6dd7458846396e2867282b428e7
      f1d7de12
  16. Jul 15, 2020
  17. Jul 13, 2020
    • Nickolay Shmyrev's avatar
      res_http_websocket: Avoid reading past end of string · e4d24f51
      Nickolay Shmyrev authored
      We read beyond the end of the buffer when copying the string out of the
      buffer when we used ast_copy_string() because the original string was
      not null terminated. Instead switch to ast_strndup() which does not
      exhibit the same behavior.
      
      ASTERISK-28975 #close
      
      Change-Id: Ib4a75cffeb1eb8cf01136ef30306bd623e531a2a
      e4d24f51
  18. Jul 10, 2020
    • Ben Ford's avatar
      res_stir_shaken: Add stir_shaken option and general improvements. · 5fbed5af
      Ben Ford authored
      Added a new configuration option for PJSIP endpoints - stir_shaken. If
      set to yes, then STIR/SHAKEN support will be added to inbound and
      outbound INVITEs. The default is no. Alembic has been updated to include
      this option.
      
      Previously the dialplan function was not trimming the whitespace from
      the parameters it recieved. Now it does.
      
      Also added a conditional that, when TEST_FRAMEWORK is enabled, the
      timestamp in the identity header will be overlooked. This is just for
      testing, since the testsuite will rely on a SIPp scenario with a preset
      identity header to trigger the MISMATCH result.
      
      Change-Id: I43d67f1489b8c1c5729ed3ca8d71e35ddf438df1
      5fbed5af
  19. Jul 09, 2020
  20. Jul 08, 2020
    • George Joseph's avatar
      ACN: Add tracing to existing code · 9bd1d686
      George Joseph authored
      Prior to making any modifications to the pjsip infrastructure
      for ACN, I've added the tracing functions to the existing code.
      This should make the final commit easier to review, but we can also
      now run a "before and after" trace.
      
      No functional changes were made with this commit.
      
      Change-Id: Ia83a1a2687ccb96f2bc8a2a3928a5214c4be775c
      9bd1d686
    • George Joseph's avatar
      ACN: res_pjsip endpoint options · 2d22e342
      George Joseph authored
      This commit adds the endpoint options required to control
      Advanced Codec Negotiation.
      
      incoming_offer_codec_prefs
      outgoing_offer_codec_prefs
      incoming_answer_codec_prefs
      outgoing_answer_codec_prefs
      
      The documentation may need tweaking and some additional edits
      added, especially for the "answer" prefs.  That'll be handled
      when things finalize.
      
      This commit is safe to merge as it doens't alter any existing
      functionality nor does it alter the previous codec negotiation
      work which may now be obsolete.
      
      Change-Id: I920ba925d7dd36430dfd2ebd9d82d23f123d0e11
      2d22e342
  21. Jul 07, 2020
    • sungtae kim's avatar
      res_pjsip.c: Added disable_rport option for pjsip.conf · 81b5e4a7
      sungtae kim authored
      Currently when the pjsip making an outgoing request, it keep adding the
      rport parameter in a request message as a default.
      
      This causes unexpected rport handle at the other end.
      
      Added option for disable this behaviour in the pjsip.conf.
      
      This is a system option, but working as a gloabl option.
      
      ASTERISK-28959
      
      Change-Id: I9596675e52a742774738b5aad5d1fec32f477abc
      81b5e4a7
    • George Joseph's avatar
      frame.c: Make debugging easier · d093e44b
      George Joseph authored
       * ast_frame_subclass2str() and ast_frame_type2str() now return
         a pointer to the buffer that was passed in instead of void.
         This makes it easier to use these functions inline in
         printf-style debugging statements.
      
       * Added many missing control frame entries in
         ast_frame_subclass2str.
      
      Change-Id: Ifd0d6578e758cd644c96d17a5383ff2128c572fc
      d093e44b
    • George Joseph's avatar
      Scope Trace: Make it easier to trace through synchronous tasks · 955b7b4f
      George Joseph authored
      Tracing through synchronous tasks was a little troublesome because
      the new thread's stack counter reset to 0.  This change allows
      a synchronous task to set its trace level to be the same as the
      thread that pushed the task.  For now, the task's level has to be
      passed in the task's data structure but a future enhancement to the
      taskprocessor subsystem could automatically set the trace level
      of the servant to be that of the caller.
      
      This doesn't really make sense for async tasks because you never
      know when they're going to run anyway.
      
      Change-Id: Ib8049c0b815063a45d8c7b0cb4e30b7b87b1d825
      955b7b4f
    • Nickolay Shmyrev's avatar
      res_http_websocket.c: Continue reading after ping/pong · 7163efd9
      Nickolay Shmyrev authored
      Do not return error if the client received ping frame
      while looking for a string and just wait for another frame.
      
      ASTERISK-28958 #close
      
      Change-Id: I4d06b4827bd71e56cbaafc011ffdcef9f0332922
      7163efd9
Loading