Skip to content
Snippets Groups Projects
  1. Oct 05, 2020
  2. Oct 02, 2020
    • Kevin Harwell's avatar
      Logging: Add debug logging categories · 56028426
      Kevin Harwell authored
      Added debug logging categories that allow a user to output debug
      information based on a specified category. This lets the user limit,
      and filter debug output to data relevant to a particular context,
      or topic. For instance the following categories are now available for
      debug logging purposes:
      
        dtls, dtls_packet, ice, rtcp, rtcp_packet, rtp, rtp_packet,
        stun, stun_packet
      
      These debug categories can be enable/disable via an Asterisk CLI command.
      
      While this overrides, and outputs debug data, core system debugging is
      not affected by this patch. Statements still output at their appropriate
      debug level. As well backwards compatibility has been maintained with
      past debug groups that could be enabled using the CLI (e.g. rtpdebug,
      stundebug, etc.).
      
      ASTERISK-29054 #close
      
      Change-Id: I6e6cb247bb1f01dbf34750b2cd98e5b5b41a1849
      56028426
    • Sean Bright's avatar
      pbx.c: On error, ast_add_extension2_lockopt should always free 'data' · 51cba591
      Sean Bright authored
      In the event that the desired extension already exists,
      ast_add_extension2_lockopt() will free the 'data' it is passed before
      returning an error, so we should not be freeing it ourselves.
      
      Additionally, there were two places where ast_add_extension2_lockopt()
      could return an error without also freeing the 'data' pointer, so we
      add that.
      
      ASTERISK-29097 #close
      
      Change-Id: I904707aae55169feda050a5ed7c6793b53fe6eae
      51cba591
  3. Oct 01, 2020
    • Holger Hans Peter Freyther's avatar
      res_pjsip_sdp_rtp: Fix accidentally native bridging calls · 9c0ded6e
      Holger Hans Peter Freyther authored
      Stop advertising RFC2833 support on the rtp_engine when DTMF mode is
      auto but no tel_event was found inside SDP file.
      
      On an incoming call create_rtp will be called and when session->dtmf is
      set to AST_SIP_DTMF_AUTO, the AST_RTP_PROPERTY_DTMF will be set without
      looking at the SDP file.
      
      Once get_codecs gets called we move the DTMF mode from RFC2833 to INBAND
      but continued to advertise RFC2833 support.
      
      This meant the native_rtp bridge would falsely consider the two channels
      as compatible. In addition to changing the DTMF mode we now set or
      remove the AST_RTP_PROPERTY_DTMF.
      
      The property is checked in ast_rtp_dtmf_compatible and called by
      native_rtp_bridge_compatible.
      
      ASTERISK-29051 #close
      
      Change-Id: I1e0c1e324598a437932c0b7836bcb626aba8e287
      9c0ded6e
  4. Sep 30, 2020
  5. Sep 29, 2020
    • Torrey Searle's avatar
      res_pjsip_diversion: fix double 181 · e7bd97e2
      Torrey Searle authored
      Arming response to both AST_SIP_SESSION_BEFORE_REDIRECTING and
      AST_SIP_SESSION_BEFORE_MEDIA causes 302 to to be handled twice,
      resulting in to 181 being generated.
      
      Change-Id: I866e5461564644ffb8a5e12b6f1330b50a7b63ab
      e7bd97e2
  6. Sep 28, 2020
  7. Sep 23, 2020
  8. Sep 22, 2020
  9. Sep 16, 2020
  10. Sep 14, 2020
    • George Joseph's avatar
      res_pjsip_session: Fix issue with COLP and 491 · 53910b1f
      George Joseph authored
      The recent 491 changes introduced a check to determine if the active
      and pending topologies were equal and to suppress the re-invite if they
      were. When a re-invite is sent for a COLP-only change, the pending
      topology is NULL so that check doesn't happen and the re-invite is
      correctly sent. Of course, sending the re-invite sets the pending
      topology.  If a 491 is received, when we resend the re-invite, the
      pending topology is set and since we didn't request a change to the
      topology in the first place, pending and active topologies are equal so
      the topologies-equal check causes the re-invite to be erroneously
      suppressed.
      
      This change checks if the topologies are equal before we run the media
      state resolver (which recreates the pending topology) so that when we
      do the final topologies-equal check we know if this was a topology
      change request.  If it wasn't a change request, we don't suppress
      the re-invite even though the topologies are equal.
      
      ASTERISK-29014
      
      Change-Id: Iffd7dd0500301156a566119ebde528d1a9573314
      53910b1f
    • George Joseph's avatar
      debugging: Add enough to choke a mule · 44bb0858
      George Joseph authored
      Added to:
       * bridges/bridge_softmix.c
       * channels/chan_pjsip.c
       * include/asterisk/res_pjsip_session.h
       * main/channel.c
       * res/res_pjsip_session.c
      
      There NO functional changes in this commit.
      
      Change-Id: I06af034d1ff3ea1feb56596fd7bd6d7939dfdcc3
      44bb0858
    • George Joseph's avatar
      res_pjsip_session: Handle multi-stream re-invites better · 86f1bce1
      George Joseph authored
      When both Asterisk and a UA send re-invites at the same time, both
      send 491 "Transaction in progress" responses to each other and back
      off a specified amount of time before retrying. When Asterisk
      prepares to send its re-invite, it sets up the session's pending
      media state with the new topology it wants, then sends the
      re-invite.  Unfortunately, when it received the re-invite from the
      UA, it partially processed the media in the re-invite and reset
      the pending media state before sending the 491 losing the state it
      set in its own re-invite.
      
      Asterisk also was not tracking re-invites received while an existing
      re-invite was queued resulting in sending stale SDP with missing
      or duplicated streams, or no re-invite at all because we erroneously
      determined that a re-invite wasn't needed.
      
      There was also an issue in bridge_softmix where we were using a stream
      from the wrong topology to determine if a stream was added.  This also
      caused us to erroneously determine that a re-invite wasn't needed.
      
      Regardless of how the delayed re-invite was triggered, we need to
      reconcile the topology that was active at the time the delayed
      request was queued, the pending topology of the queued request,
      and the topology currently active on the session.  To do this we
      need a topology resolver AND we need to make stream named unique
      so we can accurately tell what a stream has been added or removed
      and if we can re-use a slot in the topology.
      
      Summary of changes:
      
       * bridge_softmix:
         * We no longer reset the stream name to "removed" in
           remove_all_original_streams().  That was causing  multiple streams
           to have the same name and wrecked the checks for duplicate streams.
      
         * softmix_bridge_stream_sources_update() was checking the old_stream
           to see if it had the softmix prefix and not considering the stream
           as "new" if it did.  If the stream in that slot has something in it
           because another re-invite happened, then that slot in old might
           have a softmix stream but the same stream in new might actually
           be a new one.  Now we check the new_stream's name instead of
           the old_stream's.
      
       * stream:
         * Instead of using plain media type name ("audio", "video", etc) as
           the default stream name, we now append the stream position to it
           to make it unique.  We need to do this so we can distinguish multiple
           streams of the same type from each other.
      
         * When we set a stream's state to REMOVED, we no longer reset its
           name to "removed" or destroy its metadata.  Again, we need to
           do this so we can distinguish multiple streams of the same
           type from each other.
      
       * res_pjsip_session:
         * Added resolve_refresh_media_states() that takes in 3 media states
           and creates an up-to-date pending media state that includes the changes
           that might have happened while a delayed session refresh was in the
           delayed queue.
      
         * Added is_media_state_valid() that checks the consistency of
           a media state and returns a true/false value. A valid state has:
           * The same number of stream entries as media session entries.
               Some media session entries can be NULL however.
           * No duplicate streams.
           * A valid stream for each non-NULL media session.
           * A stream that matches each media session's stream_num
             and media type.
      
         * Updated handle_incoming_sdp() to set the stream name to include the
           stream position number in the name to make it unique.
      
         * Updated the ast_sip_session_delayed_request structure to include both
           the pending and active media states and updated the associated delay
           functions to process them.
      
         * Updated sip_session_refresh() to accept both the pending and active
           media states that were in effect when the request was originally queued
           and to pass them on should the request need to be delayed again.
      
         * Updated sip_session_refresh() to call resolve_refresh_media_states()
           and substitute its results for the pending state passed in.
      
         * Updated sip_session_refresh() with additional debugging.
      
         * Updated session_reinvite_on_rx_request() to simply return PJ_FALSE
           to pjproject if a transaction is in progress.  This stops us from
           creating a partial pending media state that would be invalid later on.
      
         * Updated reschedule_reinvite() to clone both the current pending and
           active media states and pass them to delay_request() so the resolver
           can tell what the original intention of the re-invite was.
      
         * Added a large unit test for the resolver.
      
      ASTERISK-29014
      
      Change-Id: Id3440972943c611a15f652c6c569fa0e4536bfcb
      86f1bce1
  11. Sep 10, 2020
    • Sungtae Kim's avatar
      res_stasis.c: Added video_single option for bridge creation · aae0904c
      Sungtae Kim authored
      Currently, it was not possible to create bridge with video_mode single.
      This made hard to put the bridge in a vidoe_single mode.
      So, added video_single option for Bridge creation using the ARI.
      This allows create a bridge with video_mode single.
      
      ASTERISK-29055
      
      Change-Id: I43e720e5c83fc75fafe10fe22808ae7f055da2ae
      aae0904c
  12. Sep 03, 2020
  13. Aug 31, 2020
    • Joshua C. Colp's avatar
      parking: Copy parker UUID as well. · c4bed967
      Joshua C. Colp authored
      When fixing issues uncovered by GCC10 a copy of the parker UUID
      was removed accidentally. This change restores it so that the
      subscription has the data it needs.
      
      ASTERISK-29042
      
      Change-Id: I7d396a14ea648bd26d3c363dd78e78bd386b544a
      c4bed967
  14. 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
  15. Aug 25, 2020
  16. 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
  17. Aug 06, 2020
    • 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
  18. Aug 04, 2020
  19. 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
  20. Jul 24, 2020
    • sungtae kim's avatar
      stasis_bridge.c: Fixed wrong video_mode shown · c10ed8d4
      sungtae kim authored
      Currently, if the bridge has created by the ARI, the video_mode
      parameter was
      not shown in the BridgeCreated event correctly.
      
      Fixed it and added video_mode shown in the 'bridge show <bridge id>'
      cli.
      
      ASTERISK-28987
      
      Change-Id: I8c205126724e34c2bdab9380f523eb62478e4295
      c10ed8d4
  21. 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
  22. 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
  23. 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
  24. Jul 09, 2020
  25. 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
  26. 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
    • 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
  27. Jul 06, 2020
    • Kevin Harwell's avatar
      PJSIP_MEDIA_OFFER: override configuration on refresh · 4eba6b9e
      Kevin Harwell authored
      When using the PSJIP_MEDIA_OFFER dialplan function it was not
      overriding an endpoint's configured codecs on refresh unless
      they had a shared codec between the two.
      
      This patch makes it so whatever is set using PJSIP_MEDIA_OFFER
      is used when creating the SDP for a refresh no matter what.
      
      ASTERISK-28878 #close
      
      Change-Id: I0f7dc86fd0fb607c308e6f98ede303c54d1eacb6
      4eba6b9e
Loading