Skip to content
Snippets Groups Projects
  1. Sep 23, 2020
  2. Sep 22, 2020
  3. Sep 16, 2020
  4. 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
  5. 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
  6. Sep 03, 2020
  7. 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
  8. 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
  9. Aug 25, 2020
  10. 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
  11. 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
  12. Aug 04, 2020
  13. 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
  14. 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
  15. 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
  16. 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
  17. 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
  18. Jul 09, 2020
  19. 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
  20. 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
  21. 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
  22. Jun 26, 2020
    • Joshua C. Colp's avatar
      res_pjsip: Apply AOR outbound proxy to static contacts. · 4f86118b
      Joshua C. Colp authored
      The outbound proxy for an AOR was not being applied to
      any statically configured Contacts. This resulted in the
      OPTIONS requests being sent to the wrong target.
      
      This change sets the outbound proxy on statically configured
      contacts once the AOR configuration is done being
      applied.
      
      ASTERISK-28965
      
      Change-Id: Ia60f3e93ea63f819c5a46bc8b54be2e588dfa9e0
      4f86118b
  23. Jun 22, 2020
    • Università di Bologna - CESIA VoIP's avatar
      res_corosync: Fix crash in huge distributed environment. · 0c1c3866
      1) Fix memory-leaks
         Added code to release ast_events extracted from corosync and stasis messages
      
      2) Clean stasis cache when a member of the corosync cluster leaves the group
         Added code to remove from the stasis cache of the members remained on the
         group all the messages with the EID of the left member.
         If the device states of the left member remain in the stasis cache of other
         members, they will not be updated anymore and high priority cached values,
         like BUSY, will take precedence over current device states.
      
      3) Stop corosync event propagation when node is not joined to the group
         Updated dispatch_thread_handler code to detect when asterisk is not joined
         to the corosync group and added some condition in publish_event_to_corosync
         code to send corosync messages only when joined.
         When a node is not joined its corosync daemon can't send messages:
         the cpg_mcast_joined function append new messages to the FIFO buffer until
         it's full and then it blocks indefinitely.
         In this scenario if the stasis_message_cb callback, registered by
         res_corosync to handle stasis messages, try to send a corosync messages,
         the thread of the stasis thread-pool will be blocked until the node join
         the corosync cluster.
      
      ASTERISK-28888
      Reported by: Università di Bologna - CESIA VoIP
      
      Change-Id: Ie8e99bc23f141a73c13ae6fb1948d148d4de17f2
      0c1c3866
    • Moises Silva's avatar
      res_http_websocket: Add payload masking to the websocket client · 9445dac4
      Moises Silva authored
      ASTERISK-28949
      
      Change-Id: Id465030f2b1997b83d408933fdbabe01827469ca
      9445dac4
  24. Jun 19, 2020
    • Joshua C. Colp's avatar
      res_pjsip_session: Preserve label on incoming re-INVITE. · ee8ea927
      Joshua C. Colp authored
      When a re-INVITE is received we create a new set of
      streams that are then swapped in as the active streams.
      We did not preserve the SDP label from the previous
      streams, resulting in the label getting lost.
      
      This change ensures that if an SDP label is present
      on the previous stream then it is set on the new stream.
      
      ASTERISK-28953
      
      Change-Id: I9dd63b88b562fe96ce5c791a3dae5bcaca258445
      ee8ea927
  25. Jun 18, 2020
    • Joshua C. Colp's avatar
      res_sorcery_memory_cache: Disallow per-object expire with full backend. · a143c3a7
      Joshua C. Colp authored
      The AMI action and CLI command did not take into account the properties
      of full backend caching. This resulted in an expired object remaining
      removed until a full backend update occurred, instead of having the
      object updated when needed.
      
      This change makes it so that the AMI action and CLI command for object
      expire will now fail instead of putting the cache into an undesired
      state. If full backend caching is enabled then only operations
      which act on the entire cache are available.
      
      ASTERISK-28942
      
      Change-Id: Id662d888f177ab566c8e802ad583083b742d21f4
      a143c3a7
    • Ben Ford's avatar
      res_stir_shaken: Add outbound INVITE support. · 12741171
      Ben Ford authored
      Integrated STIR/SHAKEN support with outgoing INVITEs. When an INVITE is
      sent, the caller ID will be checked to see if there is a certificate
      that corresponds to it. If so, that information will be retrieved and an
      Identity header will be added to the SIP message. The format is:
      
      header.payload.signature;info=<public_key_url>alg=ES256;ppt=shaken
      
      Header, payload, and signature are all BASE64 encoded. The public key
      URL is retrieved from the certificate. Currently the algorithm and ppt
      are ES256 and shaken, respectively. This message is signed and can be
      used for verification on the receiving end.
      
      Two new configuration options have been added to the certificate object:
      attestation and origid. The attestation is required and must be A, B, or
      C. origid is the origination identifier.
      
      A new utility function has been added as well that takes a string,
      allocates space, BASE64 encodes it, then returns it, eliminating the
      need to calculate the size yourself.
      
      Change-Id: I1f84d6a5839cb2ed152ef4255b380cfc2de662b4
      12741171
  26. Jun 17, 2020
  27. Jun 16, 2020
    • Kevin Harwell's avatar
      pjproject: Upgrade bundled version to pjproject 2.10 · 415b55af
      Kevin Harwell authored
      This patch makes the usual necessary changes when upgrading to a new
      version pjproject. For instance, version number bump, patches removed
      from third-party, new *.md5 file added, etc..
      
      This patch also includes a change to the Asterisk pjproject Makefile to
      explicitly create the 'source/pjsip-apps/lib' directory. This directory
      is no longer there by default so needs to be added so the Asterisk
      malloc debug can be built.
      
      This patch also includes some minor changes to Asterisk that were a result
      of the upgrade. Specifically, there was a backward incompatibility change
      made in 2.10 that modified the "expires header" variable field from a
      signed to an unsigned value. This potentially effects comparison. Namely,
      those check for a value less than zero. This patch modified a few locations
      in the Asterisk code that may have been affected.
      
      Lastly, this patch adds a new macro PJSIP_MINVERSION that can be used to
      check a minimum version of pjproject at compile time.
      
      ASTERISK-28899 #close
      
      Change-Id: Iec8821c6cbbc08c369d0e3cd2f14e691b41d0c81
      415b55af
  28. Jun 12, 2020
Loading