Skip to content
Snippets Groups Projects
  1. Jun 22, 2020
  2. 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
  3. 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
  4. Jun 17, 2020
  5. 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
  6. Jun 12, 2020
  7. Jun 11, 2020
    • Joshua C. Colp's avatar
      res_rtp_asterisk: Don't assume setting retrans props means to enable. · c84d962e
      Joshua C. Colp authored
      The "value" passed in when setting an RTP property determines
      whether it should be enabled or disabled. The RTP send and
      receive retrans props did not examine this to know if the
      buffers should be enabled. They assumed they always should be.
      
      This change makes it so that the "value" passed in is
      respected.
      
      ASTERISK-28939
      
      Change-Id: I9244cdbdc5fd065c7f6b02cbfa572bc55c7123dc
      c84d962e
  8. Jun 10, 2020
    • George Joseph's avatar
      res_fax: Don't start a gateway if either channel is hung up · 41f3a7da
      George Joseph authored
      When fax_gateway_framehook is called and a gateway hasn't already
      been started, the framehook gets the t38 state for both the current
      channel and the peer.  That call trickles down to the channel
      driver which determines the state.  If either channel is hung up
      (or in the process of being hung up), the channel driver's tech_pvt
      is going to be NULL which, in the case of chan_pjsip, will cause a
      segfault.
      
      * Added a hangup check for both the channel and peer channel
        before starting a fax gateway.
      
      * Added a check for NULL tech_pvt to chan_pjsip_queryoption
        so we don't attempt to reference a tech_pvt that's already
        gone.
      
      ASTERISK-28923
      Reported by: Yury Kirsanov
      
      Change-Id: I4e10e63b667bbb68c1c8623f977488f5d807897c
      41f3a7da
    • Kevin Harwell's avatar
      Compiler fixes for gcc 10 · 3d1bf3c5
      Kevin Harwell authored
      This patch fixes a few compile warnings/errors that now occur when using gcc
      10+.
      
      Also, the Makefile.rules check to turn off partial inlining in gcc versions
      greater or equal to 8.2.1 had a bug where it only it only checked against
      versions with at least 3 numbers (ex: 8.2.1 vs 10). This patch now ensures
      any version above the specified version is correctly compared.
      
      Change-Id: I54718496eb0c3ce5bd6d427cd279a29e8d2825f9
      3d1bf3c5
  9. Jun 09, 2020
    • sungtae kim's avatar
      res_ari: Fix create request body parameter parsing. · fa7c69f4
      sungtae kim authored
      If parameters were passed in the body as JSON to the
      create route they were not being parsed before checking
      to ensure that required fields were set.
      
      This change moves the parsing so it occurs before
      checking.
      
      ASTERISK-28940
      
      Change-Id: I898b4c3c7ae1cde19a6840e59f498822701cf5cf
      fa7c69f4
  10. Jun 08, 2020
    • Walter Doekes's avatar
      pjsip: Prevent invalid memory access when attempting to contact a non-sip URI · e74dde51
      Walter Doekes authored
      You cannot cast a pjsip_uri to a pjsip_sip_uri using pjsip_uri_get_uri,
      without checking that it's a PJSIP_URI_SCHEME_IS_SIP(S).
      
      ASTERISK-28936
      
      Change-Id: I9f572b3677e4730458e9402719e580f8681afe2a
      e74dde51
    • Ben Ford's avatar
      res_stir_shaken: Add inbound INVITE support. · 3927f79c
      Ben Ford authored
      Integrated STIR/SHAKEN support with incoming INVITES. Upon receiving an
      INVITE, the Identity header is retrieved, parsing the message to verify
      the signature. If any of the parsing fails,
      AST_STIR_SHAKEN_VERIFY_NOT_PRESENT will be added to the channel for this
      caller ID. If verification itself fails,
      AST_STIR_SHAKEN_VERIFY_SIGNATURE_FAILED will be added. If anything in
      the payload does not line up with the SIP signaling,
      AST_STIR_SHAKEN_VERIFY_MISMATCH will be added. If all of the above steps
      pass, then AST_STIR_SHAKEN_VERIFY_PASSED will be added, completing the
      verification process.
      
      A new config option has been added to the general section for
      stir_shaken.conf. "signature_timeout" is the amount of time a signature
      will be considered valid. If an INVITE is received and the amount of
      time between when it was received and when it was signed is greater than
      signature_timeout, verification will fail.
      
      Some changes were also made to signing and verification. There was an
      error where the whole JSON string was being signed rather than the
      header combined with the payload. This has been changed to sign the
      correct thing. Verification has been changed to do this as well, and the
      unit tests have been updated to reflect these changes.
      
      A couple of utility functions have also been added. One decodes a BASE64
      string and returns the decoded string, doing all the length calculations
      for you. The other retrieves a string value from a header in a rdata
      object.
      
      Change-Id: I855f857be3d1c63b64812ac35d9ce0534085b913
      3927f79c
  11. Jun 05, 2020
    • Joshua C. Colp's avatar
      res_fax: Don't consume frames given to fax gateway on write. · d2500c62
      Joshua C. Colp authored
      In a particular fax gateway scenario whereby it would
      have to translate using the read translation path on a
      channel the frame being translated would be consumed.
      When the frame is in the write path it is not permitted
      to free the frame as the caller expects it to continue
      to exist.
      
      This change makes it so that the frame is only consumed
      on the read path where it is acceptable to free it.
      
      ASTERISK-28900
      
      Change-Id: I011c321288a1b056d92b37c85e229f4a28ee737d
      d2500c62
    • Pirmin Walthert's avatar
      res_pjsip_logger: use the correct pointer when logging tx_messages to pcap · e8c6e9ae
      Pirmin Walthert authored
      When writing tx messages to pcap files, Asterisk is using the wrong
      pointer resulting in lots of wasted space. This patch fixes it to use
      the correct pointer.
      
      ASTERISK-28932 #close
      
      Change-Id: I5b8253dd59a083a2ca2c81f232f1d14d33c6fd23
      e8c6e9ae
  12. Jun 01, 2020
    • Pirmin Walthert's avatar
      res_pjsip_logger.c: correct the return value checks when writing to pcap · c16937cd
      Pirmin Walthert authored
      files
      
      fwrite() does return the number of elements written and not the
      number of bytes. However asterisk is currently comparing the return
      value to the size of the written element what means that asterisk logs
      five WARNING messages on every packet written to the pcap file.
      
      This patch changes the code to check for the correct value, which will
      always be 1.
      
      ASTERISK-28921 #close
      
      Change-Id: I2455032d9cb4c5a500692923f9e2a22e68b08fc2
      c16937cd
  13. May 27, 2020
    • Joshua C. Colp's avatar
      res_pjsip: Use correct pool for storing the contact_user value. · 9c2871ed
      Joshua C. Colp authored
      When replacing the user portion of the Contact URI the code
      was using the ephemeral pool instead of the tdata pool. This
      could cause the Contact user value to become invalid after a
      period of time.
      
      The code will now use the tdata pool which persists for the
      lifetime of the message instead.
      
      ASTERISK-28794
      
      Change-Id: I31e7b958e397cbdaeedd0ebb70bcf8dd2ed3c4d5
      9c2871ed
  14. May 22, 2020
  15. May 20, 2020
    • Joshua C. Colp's avatar
      res_sorcery_config: Always reload configuration on errors. · ec7890d7
      Joshua C. Colp authored
      When a configuration file in Asterisk is loaded
      information about it is stored such that on a
      reload it is not reloaded if nothing has changed.
      This can be problematic when an error exists in
      a configuration file in PJSIP since the error
      will be output at start and not subsequently on
      reload if the file is unchanged.
      
      This change makes it so that if an error is
      encountered when res_sorcery_config is loading
      a configuration file a reload will always read
      in the configuration file, allowing the error
      to be seen easier.
      
      Change-Id: If2e05a017570f1f5f4f49120da09601e9ecdf9ed
      ec7890d7
    • Alexander Traud's avatar
      res_srtp: Set all possible flags while selecting the Crypto Suite. · 4de0e50c
      Alexander Traud authored
      The flags of a previous selection could have been set within the
      object 'srtp', for example, when the previous selection returned
      failure after setting just 'some' flags. Now, not to clutter the
      code, all possible flags are cleared first, and then the selected
      flags are set as before.
      
      ASTERISK-28903
      
      Change-Id: I1b9d7aade7d5120244ce7e3a8865518cbd6e0eee
      4de0e50c
    • Ben Ford's avatar
      res_stir_shaken: Add unit tests for signing and verification. · f506cc48
      Ben Ford authored
      Added two unit tests, one for signing and another for verifying.
      stir_shaken_sign checks to make sure that all the required parameters
      are passed in and then signs the actual payload. If a signature is
      produced and a payload returned as a result, the test passes.
      stir_shaken_verify takes the signature from a signed payload to verify.
      This unit test also verifies that all the required information is passed
      in, and then attempts to verify the signature. If verification is
      successful and a payload is returned, the test passes.
      
      Change-Id: I9fa43380f861ccf710cd0f6b6c102a517c86ea13
      f506cc48
    • Joshua C. Colp's avatar
      res_pjsip_logger: Expand functionality to improve logging. · a7aaee70
      Joshua C. Colp authored
      The PJSIP packet logger now has the following CLI commands:
      
      pjsip set logger pcap <filename>
      
      When used this will create a pcap file containing the incoming
      and outgoing SIP packets, in unencrypted form.
      
      pjsip set logger verbose <on / off>
      
      This allows you to toggle logging to verbose on and off.
      
      pjsip set logger host <IP/subnet mask> add
      
      This allows you to add an additional IP address or subnet
      mask to logging, allowing you to log multiple instead of
      just a single IP address or all traffic.
      
      The normal "pjsip set logger host" CLI command has also been
      expanded to allow subnet masks as well.
      
      ASTERISK-28895
      
      Change-Id: If5859161a72b0d7dd2d1f92d45bed88e0cd07d0e
      a7aaee70
    • Nicholas John Koch's avatar
      res_musiconhold: Added check for dot character in path of playlist entries to avoid warnings · fef97a9a
      Nicholas John Koch authored
      A warning was triggered that there may be a problem regarding file
      extension (which is correct and should not be set anyway). The warning
      also appeared if there was dot within the path itself.
      
      E.g.
      [sales-queue-hold]
      mode=playlist
      entry=/var/www/domain.tld/moh/funky_music
      
      The music played correctly but you get a warning message.
      
      Now there will be a check if the position of a potential dot character
      is after the last position of a slash character. This dot charachter
      will be treated as a extension naming. Dots within the path then ignored.
      
      ASTERISK-28892
      Reported-By: Nicholas John Koch
      
      Change-Id: I2ec35a613413affbf5fcc01c8c181eba24865b9e
      fef97a9a
  16. May 18, 2020
  17. May 15, 2020
    • Joshua C. Colp's avatar
      ari: Allow variables to be set on channel create. · 15cbff9d
      Joshua C. Colp authored
      This change adds the same variable functionality that
      is available for originating a channel to the create
      call. Now when creating a channel you can specify
      dialplan variables to set instead of having to do another
      API call.
      
      ASTERISK-28896
      
      Change-Id: If13997ba818136d7c070585504fc4164378aa992
      15cbff9d
  18. May 13, 2020
    • Roger James's avatar
      pjsip_resolver.c: Ensure AAAA dns requests are made. · c8dec423
      Roger James authored
      1. Modify sip_resolve and sip_resolve_callback to request AAAA lookups
         when an IPV6 transport type has been requested.
      
      2. Rename all occurrences of pjsip_transport_get_type_name to
         pjsip_transport_get_type_desc. This ensures that the log/debug info
         shows whether the transport is IPv6 or IPv4.
      
      3. Do not add the constant PJSIP_TRANSPORT_IPV6 to existing transport
         types. This results in invalid values. Use a bitwise or instead.
      
      ASTERISK-26780
      Patches:
          pjsip_resolver.c uploaded by Peter Sokolov (License #7070)
      
      Change-Id: I8b1e298f8efa682d0a7644113258fe76d9889c58
      c8dec423
    • Ben Ford's avatar
      res_stir_shaken: Added dialplan function and API call. · e29df34d
      Ben Ford authored
      Adds the "STIR_SHAKEN" dialplan function and an API call to add a
      STIR_SHAKEN verification result to a channel. This information will be
      held in a datastore on the channel that can later be queried through the
      "STIR_SHAKEN" dialplan funtion to get information on STIR_SHAKEN results
      including identity, attestation, and verify_result. Here are some
      examples:
      
      STIR_SHAKEN(count)
      STIR_SHAKEN(0, identity)
      STIR_SHAKEN(1, attestation)
      STIR_SHAKEN(2, verify_result)
      
      Getting the count can be used to iterate through the results and pull
      information by specifying the index and the field you want to retrieve.
      
      Change-Id: Ice6d52a3a7d6e4607c9c35b28a1f7c25f5284a82
      e29df34d
  19. May 11, 2020
  20. May 01, 2020
    • Joshua C. Colp's avatar
      res_stir_shaken: Use ast_asprintf for creating file path. · 1cfd30bd
      Joshua C. Colp authored
      Change-Id: Ice5d92ecea2f1101c80487484f48ef98be2f1824
      1cfd30bd
    • Ben Ford's avatar
      res_stir_shaken: Implemented signature verification. · 9acf840f
      Ben Ford authored
      There are a lot of moving parts in this patch, but the focus of it is on
      the verification of the signature using a public key located at the
      public key URL provided in the JSON payload. First, we check the
      database to see if we have already downloaded the key. If so, check to
      see if it has expired. If it has, redownload from the URL. If we don't
      have an entry in the database, just go ahead and download the public
      key. The expiration is tested each time we download the file. After
      that, read the public key from the file and use it to verify the
      signature. All sanity checking is done when the payload is first
      received, so the verification is complete once this point is reached.
      
      The XML has also been added since a new config option was added to
      general (curl_timeout). The maximum amount of time to wait for a
      download can be configured through this option, with a low value by
      default.
      
      Change-Id: I3ba4c63880493bf8c7d17a9cfca1af0e934d1a1c
      9acf840f
  21. Apr 28, 2020
    • Guido Falsi's avatar
      res_rtp_asterisk: Protect access to nochecksums with #ifdef · e4366308
      Guido Falsi authored
      Recently code accessing nochecksums variable has been added without including #ifdef SO_NO_CHECK protection, while the variable is created only when such constant is defined.
      
      ASTERISK-28852 #close
      
      Change-Id: I381718893b80599ab8635f2b594a10c1000d595e
      e4366308
  22. Apr 23, 2020
    • Joshua C. Colp's avatar
      stream: Enforce formats immutability and ensure formats exist. · 1c5e6858
      Joshua C. Colp authored
      Some places in Asterisk did not treat the formats on a stream
      as immutable when they are.
      
      The ast_stream_get_formats function is now const to enforce this
      and parts of Asterisk have been updated to take this into account.
      Some violations of this were also fixed along the way.
      
      An additional minor tweak is that streams are now allocated with
      an empty format capabilities structure removing the need in various
      places to check that one is present on the stream.
      
      ASTERISK-28846
      
      Change-Id: I32f29715330db4ff48edd6f1f359090458a9bfbe
      1c5e6858
  23. Apr 22, 2020
    • sungtae kim's avatar
      res_ari_channels: Fixed endpoint 80 characters limit · 9ad3d282
      sungtae kim authored
      Fixed it to copy the entire string from the requested endpoint body except tech-prefix.
      
      ASTERISK-28847
      
      Change-Id: I91b5f6708a1200363f3267b847dd6a0915222c25
      9ad3d282
    • Joshua C. Colp's avatar
      fax: Fix crashes in PJSIP re-negotiation scenarios. · e56f4de7
      Joshua C. Colp authored
      This change fixes a few re-negotiation issues
      uncovered with fax.
      
      1. The fax support uses its own mechanism for
      re-negotiation by conveying T.38 information in
      its own frames. The new support for re-negotiating
      when adding/removing/changing streams was also
      being triggered for this causing multiple re-INVITEs.
      The new support will no longer trigger when
      transitioning between fax.
      
      2. In off-nominal re-negotiation cases it was
      possible for some state information to be left
      over and used by the next re-negotiation. This
      is now cleared.
      
      ASTERISK-28811
      ASTERISK-28839
      
      Change-Id: I8ed5924b53be9fe06a385c58817e5584b0f25cc2
      e56f4de7
  24. Apr 21, 2020
  25. Apr 20, 2020
  26. Apr 17, 2020
    • Pirmin Walthert's avatar
      res_rtp_asterisk: Resolve loop when receive buffer is flushed · d50fd0ac
      Pirmin Walthert authored
      When the receive buffer was flushed by a received packet while it
      already contained a packet with the same sequence number, Asterisk
      never left the while loop which tried to order the packets.
      
      This change makes it so if the packet is in the receive buffer it
      is retrieved and freed allowing the buffer to empty.
      
      ASTERISK-28827
      
      Change-Id: Idaa376101bc1ac880047c49feb6faee773e718b3
      d50fd0ac
Loading