Skip to content
Snippets Groups Projects
  1. Jun 08, 2021
  2. May 27, 2021
    • George Joseph's avatar
      res_pjsip_messaging: Refactor outgoing URI processing · 8e2672d2
      George Joseph authored
       * Implemented the new "to" parameter of the MessageSend()
         dialplan application.  This allows a user to specify
         a complete SIP "To" header separate from the Request URI.
      
       * Completely refactored the get_outbound_endpoint() function
         to actually handle all the destination combinations that
         we advertized as supporting.
      
       * We now also accept a destination in the same format
         as Dial()...  PJSIP/number@endpoint
      
       * Added lots of debugging.
      
      ASTERISK-29404
      Reported by Brian J. Murrell
      
      Change-Id: I67a485196d9199916468f7f98bfb9a0b993a4cce
      8e2672d2
  3. May 26, 2021
    • Naveen Albert's avatar
      func_math: Three new dialplan functions · 9106c9d1
      Naveen Albert authored
      Introduces three new dialplan functions, MIN and MAX,
      which can be used to calculate the minimum or
      maximum of up to two numbers, and ABS, an absolute
      value function.
      
      ASTERISK-29431
      
      Change-Id: I2bda9269d18f9d54833c85e48e41fce0e0ce4d8d
      9106c9d1
    • Ben Ford's avatar
      STIR/SHAKEN: Add Date header, dest->tn, and URL checking. · 26a38c40
      Ben Ford authored
      STIR/SHAKEN requires a Date header alongside the Identity header, so
      that has been added. Still on the outgoing side, we were missing the
      dest->tn section of the JSON payload, so that has been added as well.
      Moving to the incoming side, URL checking has been added to the public
      cert URL to ensure that it starts with http.
      
      https://wiki.asterisk.org/wiki/display/AST/OpenSIPit+2021
      
      Change-Id: Idee5b1b5e45bc3b483b3070e46ce322dca5b3f1c
      26a38c40
    • Joshua C. Colp's avatar
      res_pjsip: On partial transport reload also move factories. · 16e4a9d8
      Joshua C. Colp authored
      For connection oriented transports PJSIP uses factories to
      produce transports. When doing a partial transport reload
      we need to also move the factory of the transport over so
      that anything referencing the transport (such as an endpoint)
      has the factory available.
      
      ASTERISK-29441
      
      Change-Id: Ieae0fb98eab2d9257cad996a1136e5a62d307161
      16e4a9d8
    • Naveen Albert's avatar
      func_volume: Add read capability to function. · 033c2a22
      Naveen Albert authored
      Up until now, the VOLUME function has been write
      only, so that TX/RX values can be set but not
      read afterwards. Now, previously set TX/RX values
      can be read later.
      
      ASTERISK-29439
      
      Change-Id: Ia23e92fa2e755c36e9c8e69f2940d2703ccccb5f
      033c2a22
    • Evgenios_Greek's avatar
      stasis: Fix "FRACK!, Failed assertion bad magic number" when unsubscribing · 59d15c4c
      Evgenios_Greek authored
      When unsubscribing from an endpoint technology a FRACK
      would occur due to incorrect reference counting. This fixes
      that issue, along with some other issues.
      
      Fixed a typo in get_subscription when calling ao2_find as it
      needed to pass the endpoint ID and not the entire object.
      
      Fixed scenario where a subscription would get returned when
      it shouldn't have been when searching based on endpoint
      technology.
      
      A doulbe unreference has also been resolved by only explicitly
      releasing the reference held by tech_subscriptions.
      
      ASTERISK-28237 #close
      Reported by: Lucas Tardioli Silveira
      
      Change-Id: Ia91b15f8e5ea68f850c66889a6325d9575901729
      59d15c4c
    • Joseph Nadiv's avatar
      res_pjsip.c: Support endpoints with domain info in username · b21d4d1b
      Joseph Nadiv authored
      In multidomain environments, it is desirable to create
      PJSIP endpoints with the domain info in the endpoint name
      in pjsip_endpoint.conf.  This resulted in an error with
      registrations, NOTIFY, and OPTIONS packet generation.
      
      This commit will detect if there is an @ in the endpoint
      identifier and generate the URI accordingly so NOTIFY and
      OPTIONS From headers will generate correctly.
      
      ASTERISK-28393
      
      Change-Id: I96f8d01dfdd5573ba7a28299e46271dd4210b619
      b21d4d1b
    • Joshua C. Colp's avatar
      res_rtp_asterisk: Set correct raddr port on RTCP srflx candidates. · 3aed3637
      Joshua C. Colp authored
      RTCP ICE candidates use a base address derived from the RTP
      candidate. The port on the base address was not being updated to
      the RTCP port.
      
      This change sets the base port to the RTCP port and all is well.
      
      ASTERISK-29433
      
      Change-Id: Ide2d2115b307bfd3c2dfbc4d187515d724519040
      3aed3637
  4. May 25, 2021
  5. May 21, 2021
  6. May 20, 2021
    • George Joseph's avatar
      res_pjsip_outbound_authenticator_digest: Be tolerant of RFC8760 UASs · 655ee680
      George Joseph authored
      RFC7616 and RFC8760 allow more than one WWW-Authenticate or
      Proxy-Authenticate header per realm, each with different digest
      algorithms (including new ones like SHA-256 and SHA-512-256).
      Thankfully however a UAS can NOT send back multiple Authenticate
      headers for the same realm with the same digest algorithm.  The
      UAS is also supposed to send the headers in order of preference
      with the first one being the most preferred.  We're supposed to
      send an Authorization header for the first one we encounter for a
      realm that we can support.
      
      The UAS can also send multiple realms, especially when it's a
      proxy that has forked the request in which case the proxy will
      aggregate all of the Authenticate headers and then send them all
      back to the UAC.
      
      It doesn't stop there though... Each realm can require a
      different username from the others.  There's also nothing
      preventing each digest algorithm from having a unique password
      although I'm not sure if that adds any benefit.
      
      So now... For each Authenticate header we encounter, we have to
      determine if we support the digest algorithm and, if not, just
      skip the header.  We then have to find an auth object that
      matches the realm AND the digest algorithm or find a wildcard
      object that matches the digest algorithm. If we find one, we add
      it to the results vector and read the next Authenticate header.
      If the next header is for the same realm AND we already added an
      auth object for that realm, we skip the header. Otherwise we
      repeat the process for the next header.
      
      In the end, we'll have accumulated a list of credentials we can
      pass to pjproject that it can use to add Authentication headers
      to a request.
      
      NOTE: Neither we nor pjproject can currently handle digest
      algorithms other than MD5.  We don't even have a place for it in
      the ast_sip_auth object. For this reason, we just skip processing
      any Authenticate header that's not MD5.  When we support the
      others, we'll move the check into the loop that searches the
      objects.
      
      Changes:
      
       * Added a new API ast_sip_retrieve_auths_vector() that takes in
         a vector of auth ids (usually supplied on a call to
         ast_sip_create_request_with_auth()) and populates another
         vector with the actual objects.
      
       * Refactored res_pjsip_outbound_authenticator_digest to handle
         multiple Authenticate headers and set the stage for handling
         additional digest algorithms.
      
       * Added a pjproject patch that allows them to ignore digest
         algorithms they don't support.  This patch has already been
         merged upstream.
      
       * Updated documentation for auth objects in the XML and
         in pjsip.conf.sample.
      
       * Although res_pjsip_authenticator_digest isn't affected
         by this change, some debugging and a testsuite AMI event
         was added to facilitate testing.
      
      Discovered during OpenSIPit 2021.
      
      ASTERISK-29397
      
      Change-Id: I3aef5ce4fe1d27e48d61268520f284d15d650281
      655ee680
  7. May 19, 2021
    • Joseph Nadiv's avatar
      res_pjsip_dialog_info_body_generator: Add LOCAL/REMOTE tags in dialog-info+xml · 83c2a16b
      Joseph Nadiv authored
      RFC 4235 Section 4.1.6 describes XML elements that should be
      sent to subscribed endpoints to identify the local and remote
      participants in the dialog.
      
      This patch adds this functionality to PJSIP by iterating through the
      ringing channels causing the NOTIFY, and inserts the channel info
      into the dialog so that information is properly passed to the endpoint
      in dialog-info+xml.
      
      ASTERISK-24601
      Patch submitted: Joshua Elson
      Modified by: Joseph Nadiv and Sean Bright
      Tested by: Joseph Nadiv
      
      Change-Id: I20c5cf5b45f34d7179df6573c5abf863eb72964b
      83c2a16b
    • Naveen Albert's avatar
      app_voicemail: Configurable voicemail beep · bfc25e5d
      Naveen Albert authored
      Hitherto, VoiceMail() played a non-customizable beep tone to indicate
      the caller could leave a message. In some cases, the beep may not
      be desired, or a different tone may be desired.
      
      To increase flexibility, a new option allows customization of the tone.
      If the t option is specified, the default beep will be overridden.
      Supplying an argument will cause it to use the specified file for the tone,
      and omitting it will cause it to skip the beep altogether. If the option
      is not used, the default behavior persists.
      
      ASTERISK-29349
      
      Change-Id: I1c439c0011497e28a28067fc1cf1e654c8843280
      bfc25e5d
    • Naveen Albert's avatar
      AMI: Add AMI event to expose hook flash events · 0ad3504c
      Naveen Albert authored
      Although Asterisk can receive and propogate flash events, it currently
      provides no mechanism for doing anything with them itself.
      
      This AMI event allows flash events to be processed by Asterisk.
      Additionally, AST_CONTROL_FLASH is included in a switch statement
      in channel.c to avoid throwing a warning when we shouldn't.
      
      ASTERISK-29380
      
      Change-Id: Ie17ffe65086e0282c88542e38eed6a461ec79e81
      0ad3504c
  8. May 17, 2021
  9. May 13, 2021
  10. May 11, 2021
    • Ben Ford's avatar
      STIR/SHAKEN: Switch to base64 URL encoding. · a84d3403
      Ben Ford authored
      STIR/SHAKEN encodes using base64 URL format. Currently, we just use
      base64. New functions have been added that convert to and from base64
      encoding.
      
      The origid field should also be an UUID. This means there's no reason to
      have it as an option in stir_shaken.conf, as we can simply generate one
      when creating the Identity header.
      
      https://wiki.asterisk.org/wiki/display/AST/OpenSIPit+2021
      
      Change-Id: Icf094a2a54e87db91d6b12244c9f5ba4fc2e0b8c
      a84d3403
    • Ben Ford's avatar
      STIR/SHAKEN: OPENSSL_free serial hex from openssl. · e0cbdfe0
      Ben Ford authored
      We're getting the serial number of the certificate from openssl and
      freeing it with ast_free(), but it needs to be freed with OPENSSL_free()
      instead. Now we duplicate the string and free the one from openssl with
      OPENSSL_free(), which means we can still use ast_free() on the returned
      string.
      
      https://wiki.asterisk.org/wiki/display/AST/OpenSIPit+2021
      
      Change-Id: Ia6e1a4028c1933a0e1d204b769ebb9f5a11f00ab
      e0cbdfe0
    • Ben Ford's avatar
      STIR/SHAKEN: Fix certificate type and storage. · 5e6508b5
      Ben Ford authored
      During OpenSIPit, we found out that the public certificates must be of
      type X.509. When reading in public keys, we use the corresponding X.509
      functions now.
      
      We also discovered that we needed a better naming scheme for the
      certificates since certificates with the same name would cause issues
      (overwriting certs, etc.). Now when we download a public certificate, we
      get the serial number from it and use that as the name of the cached
      certificate.
      
      The configuration option public_key_url in stir_shaken.conf has also
      been renamed to public_cert_url, which better describes what the option
      is for.
      
      https://wiki.asterisk.org/wiki/display/AST/OpenSIPit+2021
      
      Change-Id: Ia00b20835f5f976e3603797f2f2fb19672d8114d
      5e6508b5
  11. May 04, 2021
    • George Joseph's avatar
      Updates for the MessageSend Dialplan App · 40bdfff7
      George Joseph authored
      Enhancements:
      
       * The MessageSend dialplan application now takes an optional
         third argument that can set the message's "To" field on
         outgoing messages.  It's an alternative to using the
         MESSAGE(to) dialplan function.
      
         NOTE: No channel driver currently implements this field.  A
         follow-on commit for res_pjsip_messaging will implement it for
         the chan_pjsip channel driver.
      
       * To prevent confusion with the first argument, currently named
         "to", it's been renamed to "destination". Its function,
         creating the request URI, hasn't changed.
      
       * The documentation for MessageSend was updated to be
         more clear about the parameters and how they interact
         the MESSAGE() dialplan function.
      
       * With the rename of MessageSend's first parameter, and the fact
         that message.c references <info> elements in chan_sip.c,
         res_pjsip_messaging.c and res_xmpp, they each needed
         documentation updates to use MessageDestinationInfo instead of
         MessageToInfo.
      
       * appdocsxml.dtd was updated to include a missing element
         declaration for "dataType".  This was showing up as an error
         in Eclipse's dtd editor.
      
       * Despite the changes in this commit, there should be
         no impact to current users of MessageSend.
      
      Change-Id: I6fb5b569657a02866a66ea352fd53d30d8ac965a
      40bdfff7
  12. Apr 30, 2021
    • Sean Bright's avatar
      translate.c: Avoid refleak when checking for a translation path · 78f51862
      Sean Bright authored
      Change-Id: Idbd61ff77545f4a78b06a5064b55112e774b70e6
      78f51862
    • Joshua C. Colp's avatar
      chan_local: Skip filtering audio formats on removed streams. · 8faed04b
      Joshua C. Colp authored
      When a stream topology is provided to chan_local when dialing
      it filters the audio formats down. This operation did not skip
      streams which were removed (that have no formats) resulting in
      calling being aborted.
      
      This change causes such streams to be skipped.
      
      ASTERISK-29407
      
      Change-Id: I1de8b98727cb2d10f4bc287da0b5fdcb381addd6
      8faed04b
    • Sean Bright's avatar
      res_rtp_asterisk: More robust timestamp checking · 95414fc9
      Sean Bright authored
      We assume that a timestamp value of 0 represents an 'uninitialized'
      timestamp, but 0 is a valid value. Add a simple wrapper to be able to
      differentiate between whether the value is set or not.
      
      This also removes the fix for ASTERISK~28812 which should not be
      needed if we are checking the last timestamp appropriately.
      
      ASTERISK-29030 #close
      
      Change-Id: Ie70d657d580d9a1f2877e25a6ef161c5ad761cf7
      95414fc9
  13. Apr 29, 2021
  14. Apr 28, 2021
  15. Apr 25, 2021
  16. Apr 21, 2021
  17. Apr 05, 2021
    • George Joseph's avatar
      bridge_channel_write_frame: Check for NULL channel · 88aec107
      George Joseph authored
      There is a possibility, when bridge_channel_write_frame() is
      called, that the bridge_channel->chan will be NULL.  The first
      thing bridge_channel_write_frame() does though is call
      ast_channel_is_multistream() which had no check for a NULL
      channel and therefore caused a segfault. Since it's still
      possible for bridge_channel_write_frame() to write the frame to
      the other channels in the bridge, we don't want to bail before we
      call ast_channel_is_multistream() but we can just skip the
      multi-channel stuff.  So...
      
      bridge_channel_write_frame() only calls ast_channel_is_multistream()
      if bridge_channel->chan is not NULL.
      
      As a safety measure, ast_channel_is_multistream() now returns
      false if the supplied channel is NULL.
      
      ASTERISK-29379
      Reported-by: Vyrva Igor
      Reported-by: Ross Beer
      
      Change-Id: Idfe62dbea8c69813ecfd58e113a6620dc42352ce
      88aec107
  18. Apr 02, 2021
    • Sean Bright's avatar
      loader.c: Speed up deprecation metadata lookup · 404533c1
      Sean Bright authored
      Only use an XPath query once per module, then just navigate the DOM for
      everything else.
      
      Change-Id: Ia0336a7185f9180ccba4b6f631a00f9a22a36e92
      404533c1
    • George Joseph's avatar
      res_prometheus: Clone containers before iterating · 19eef2a6
      George Joseph authored
      The channels, bridges and endpoints scrape functions were
      grabbing their respective global containers, getting the
      count of entries, allocating metric arrays based on
      that count, then iterating over the container.  If the
      global container had new objects added after the count
      was taken and the metric arrays were allocated, we'd run
      out of metric entries and attempt to write past the end
      of the arrays.
      
      Now each of the scape functions clone their respective
      global containers and all operations are done on the
      clone.  Since the clone is stable between getting the
      count and iterating over it, we can't run past the end
      of the metrics array.
      
      ASTERISK-29130
      Reported-By: Francisco Correia
      Reported-By: BJ Weschke
      Reported-By: Sébastien Duthil
      
      Change-Id: If0c8e40853bc0e9429f2ba9c7f5f358d90c311af
      19eef2a6
  19. Apr 01, 2021
    • Joshua C. Colp's avatar
      loader: Output warnings for deprecated modules. · a9a98644
      Joshua C. Colp authored
      Using the information from the MODULEINFO XML we can
      now output useful information at the end of module
      loading for deprecated modules. This includes the
      version it was deprecated in, the version it will be
      removed in, and the replacement if available.
      
      ASTERISK-29339
      
      Change-Id: I2080dab97d2186be94c421b41dabf6d79a11611a
      a9a98644
    • Kevin Harwell's avatar
      res_rtp_asterisk: Fix standard deviation calculation · 17c86dcf
      Kevin Harwell authored
      For some input to the standard deviation algorithm extremely large,
      and wrong numbers were being calculated.
      
      This patch uses a new formula for correctly calculating both the
      running mean and standard deviation for the given inputs.
      
      ASTERISK-29364 #close
      
      Change-Id: Ibc6e18be41c28bed3fde06d612607acc3fbd621f
      17c86dcf
  20. Mar 31, 2021
    • Kevin Harwell's avatar
      res_rtp_asterisk: Don't count 0 as a minimum lost packets · 0ad1ff8a
      Kevin Harwell authored
      The calculated minimum lost packets represents the lowest number of
      lost packets missed during an RTCP report interval. Zero of course
      is the lowest, but the idea is that this value contain the lowest
      number of lost packets once some have been missed.
      
      This patch checks to make sure the number of lost packets over an
      interval is not zero before checking and setting the minimum value.
      
      Also, this patch updates the rtp lost packet test to check for
      packet loss over several reports vs one.
      
      Change-Id: I07d6e21cec61e289c2326138d6bcbcb3c3d5e008
      0ad1ff8a
    • Kevin Harwell's avatar
      res_rtp_asterisk: Statically declare rtp_drop_packets_data object · 1414b9cc
      Kevin Harwell authored
      This patch makes the drop_packets_data object static.
      
      Change-Id: If4f9b21fa0c47d41a35b6b05941d978efb4da87b
      1414b9cc
    • Joshua C. Colp's avatar
      res_rtp_asterisk: Only raise flash control frame on end. · b0d828f1
      Joshua C. Colp authored
      Flash in RTP is conveyed the same as DTMF, just with a
      specific digit. In Asterisk however we do flash as a
      single control frame.
      
      This change makes it so that only on end do we provide
      the flash control frame to the core. Previously we would
      provide a flash control frame on both begin and end,
      causing flash to work improperly.
      
      ASTERISK-29373
      
      Change-Id: I1accd9c6e859811336e670e698bd8bd124f33226
      b0d828f1
    • Kevin Harwell's avatar
      res_rtp_asterisk: Add a DEVMODE RTP drop packets CLI command · b912b318
      Kevin Harwell authored
      This patch makes it so when Asterisk is compiled in DEVMODE a CLI
      command is available that allows someone to drop incoming RTP
      packets. The command allows for dropping of packets once, or on a
      timed interval (e.g. drop 10 packets every 5 seconds). A user can
      also specify to drop packets by IP address.
      
      Change-Id: I25fa7ae9bad6ed68e273bbcccf0ee51cae6e7024
      b912b318
Loading