Skip to content
Snippets Groups Projects
  1. Nov 29, 2022
    • Maximilian Fridrich's avatar
      core & res_pjsip: Improve topology change handling. · 60b81eab
      Maximilian Fridrich authored
      This PR contains two relatively separate changes in channel.c and
      res_pjsip_session.c which ensure that topology changes are not ignored
      in cases where they should be handled.
      
      For channel.c:
      
      The function ast_channel_request_stream_topology_change only triggers a
      stream topology request change indication, if the channel's topology
      does not equal the requested topology. However, a channel could be in a
      state where it is currently "negotiating" a new topology but hasn't
      updated it yet, so the topology request change would be lost. Channels
      need to be able to handle such situations internally and stream
      topology requests should therefore always be passed on.
      
      In the case of chan_pjsip for example, it queues a session refresh
      (re-INVITE) if it is currently in the middle of a transaction or has
      pending requests (among other reasons).
      
      Now, ast_channel_request_stream_topology_change always indicates a
      stream topology request change even if the requested topology equals the
      channel's topology.
      
      For res_pjsip_session.c:
      
      The function resolve_refresh_media_states does not process stream state
      changes if the delayed active state differs from the current active
      state. I.e. if the currently active stream state has changed between the
      time the sip session refresh request was queued and the time it is being
      processed, the session refresh is ignored. However, res_pjsip_session
      contains logic that ensures that session refreshes are queued and
      re-queued correctly if a session refresh is currently not possible. So
      this check is not necessary and led to some session refreshes being
      lost.
      
      Now, a session refresh is done even if the delayed active state differs
      from the current active state and it is checked whether the delayed
      pending state differs from the current active - because that means a
      refresh is necessary.
      
      Further, the unit test of resolve_refresh_media_states was adapted to
      reflect the new behavior. I.e. the changes to delayed pending are
      prioritized over the changes to current active because we want to
      preserve the original intention of the pending state.
      
      ASTERISK-30184
      
      Change-Id: Icd0703295271089057717006730b555b9a1d4e5a
      60b81eab
  2. Nov 16, 2022
    • Joshua C. Colp's avatar
      res_agi: Respect "transmit_silence" option for "RECORD FILE". · 61922d29
      Joshua C. Colp authored
      The "RECORD FILE" command in res_agi has its own
      implementation for actually doing the recording. This
      has resulted in it not actually obeying the option
      "transmit_silence" when recording.
      
      This change causes it to now send silence if the
      option is enabled.
      
      ASTERISK-30314
      
      Change-Id: Ib3a85601ff35d1b904f836691bad8a4b7e957174
      61922d29
  3. Oct 31, 2022
    • Mike Bradeen's avatar
      res_pjsip: prevent crash on websocket disconnect · 50e2921a
      Mike Bradeen authored
      When a websocket (or potentially any stateful connection) is quickly
      created then destroyed, it is possible that the qualify thread will
      destroy the transaction before the initialzing thread is finished
      with it.
      
      Depending on the timing, this can cause an assertion within pjsip.
      
      To prevent this, ast_send_stateful_response will now create the group
      lock and add a reference to it before creating the transaction.
      
      While this should resolve the crash, there is still the potential that
      the contact will not be cleaned up properly, see:ASTERISK~29286. As a
      result, the contact has to 'time out' before it will be removed.
      
      ASTERISK-28689
      
      Change-Id: Id050fded2247a04d8f0fc5b8a2cf3e5482cb8cee
      50e2921a
  4. Oct 28, 2022
    • Igor Goncharovsky's avatar
      res_pjsip_outbound_registration: Allow to use multiple proxies for registration · 096529d3
      Igor Goncharovsky authored
      Current registration code use pjsip_parse_uri to verify outbound_proxy
      that is different from the reading this option for the endpoint. This
      made value with multiple proxies invalid for registration pjsip settings.
      Removing URI validation helps to use registration through multiple proxies.
      
      ASTERISK-30217 #close
      
      Change-Id: I064558e66f04b9f3260c46181812a01349761357
      096529d3
  5. Oct 27, 2022
    • Naveen Albert's avatar
      tests: Fix compilation errors on 32-bit. · ca8900b0
      Naveen Albert authored
      Fix compilation errors caused by using size_t
      instead of uintmax_t and non-portable format
      specifiers.
      
      ASTERISK-30273 #close
      
      Change-Id: I363e6057ef84d54b88af80d23ad6147eef9216ee
      ca8900b0
    • Henning Westerholt's avatar
      res_pjsip: return all codecs on a re-INVITE without SDP · 12445040
      Henning Westerholt authored
      Currently chan_pjsip on receiving a re-INVITE without SDP will only
      return the codecs that are previously negotiated and not offering
      all enabled codecs.
      
      This causes interoperability issues with different equipment (e.g.
      from Cisco) for some of our customers and probably also in other
      scenarios involving 3PCC infrastructure.
      
      According to RFC 3261, section 14.2 we SHOULD return all codecs
      on a re-INVITE without SDP
      
      The PR proposes a new parameter to configure this behaviour:
      all_codecs_on_empty_reinvite. It includes the code, documentation,
      alembic migrations, CHANGES file and example configuration additions.
      
      ASTERISK-30193 #close
      
      Change-Id: I69763708d5039d512f391e296ee8a4d43a1e2148
      12445040
    • Naveen Albert's avatar
      res_pjsip_notify: Add option support for AMI. · 40b52322
      Naveen Albert authored
      The PJSIP notify CLI commands allow for using
      "options" configured in pjsip_notify.conf.
      
      This allows these same options to be used in
      AMI actions as well.
      
      Additionally, as part of this improvement,
      some repetitive common code is refactored.
      
      ASTERISK-30263 #close
      
      Change-Id: Ie4496b322b63b61eaf9672183a959ab99a04b6b5
      40b52322
    • Naveen Albert's avatar
      res_pjsip_logger: Add method-based logging option. · c32b39d1
      Naveen Albert authored
      
      Expands the pjsip logger to support the ability to filter
      by SIP message method. This can make certain types of SIP debugging
      easier by only logging messages of particular method(s).
      
      ASTERISK-30146 #close
      
      Co-authored-by: default avatarSean Bright <sean@seanbright.com>
      Change-Id: I9c8cbb6fc8686ef21190eb42e08bc9a9b147707f
      c32b39d1
  6. Oct 26, 2022
    • Naveen Albert's avatar
      res_pjsip_pubsub: Prevent removing subscriptions. · 9258d821
      Naveen Albert authored
      pjproject does not provide any mechanism of removing
      event packages, which means that once a subscription
      handler is registered, it is effectively permanent.
      
      pjproject will assert if the same event package is
      ever registered again, so currently unloading and
      loading any Asterisk modules that use subscriptions
      will cause a crash that is beyond our control.
      
      For that reason, we now prevent users from being
      able to unload these modules, to prevent them
      from ever being loaded twice.
      
      ASTERISK-30264 #close
      
      Change-Id: I7fdcb1a5e44d38b7ba10c44259fe98f0ae9bc12c
      9258d821
  7. Oct 14, 2022
  8. Oct 11, 2022
    • Mike Bradeen's avatar
      audiohook: add directional awareness · 907d7e7d
      Mike Bradeen authored
      Add enum to allow setting optional direction. If set to only one
      direction, only feed matching-direction frames to the associated
      slin factory.
      
      This prevents mangling the transcoder on non-mixed frames when the
      READ and WRITE frames would have otherwise required it.  Also
      removes the need to mute or discard the un-wanted frames as they
      are no longer added in the first place.
      
      res_stasis_snoop is changed to use this addition to set direction
      on audiohook based on spy direction.
      
      If no direction is set, the ast_audiohook_init will init this enum
      to BOTH which maintains existing functionality.
      
      ASTERISK-30252
      
      Change-Id: If8716bad334562a5d812be4eeb2a92e4f3be28eb
      907d7e7d
  9. Oct 10, 2022
  10. Sep 29, 2022
    • Maximilian Fridrich's avatar
      res_pjsip: Add mediasec capabilities. · 0d2e1401
      Maximilian Fridrich authored
      This patch adds support for mediasec SIP headers and SDP attributes.
      These are defined in RFC 3329, 3GPP TS 24.229 and
      draft-dawes-sipcore-mediasec-parameter. The new features are
      implemented so that a backbone for RFC 3329 is present to streamline
      future work on RFC 3329.
      
      With this patch, Asterisk can communicate with Deutsche Telekom trunks
      which require these fields.
      
      ASTERISK-30032
      
      Change-Id: Ia7f5b5ba42db18074fdd5428c4e1838728586be2
      0d2e1401
  11. Sep 27, 2022
    • Holger Hans Peter Freyther's avatar
      res_prometheus: Do not crash on invisible bridges · 62881c66
      Holger Hans Peter Freyther authored
      Avoid crashing by skipping invisible bridges and checking the
      snapshot for a null pointer. In effect this is how the bridges
      are enumerated in res/ari/resource_bridges.c already.
      
      ASTERISK-30239
      ASTERISK-30237
      
      Change-Id: I58ef9f44036feded5966b5fc70ae754f8182883d
      62881c66
  12. Sep 26, 2022
    • Naveen Albert's avatar
      res_pjsip_geolocation: Change some notices to debugs. · 8afb313a
      Naveen Albert authored
      If geolocation is not in use for an endpoint, the NOTICE
      log level is currently spammed with messages about this,
      even though nothing is wrong and these messages provide
      no real value. These log messages are therefore changed
      to debugs.
      
      ASTERISK-30241 #close
      
      Change-Id: I656b355d812f67cc0f0fdf09b00b0e1458598bb4
      8afb313a
  13. Sep 22, 2022
    • Maximilian Fridrich's avatar
      res_pjsip: Add 100rel option "peer_supported". · 5bbad0d2
      Maximilian Fridrich authored
      This patch adds a new option to the 100rel parameter for pjsip
      endpoints called "peer_supported". When an endpoint with this option
      receives an incoming request and the request indicated support for the
      100rel extension, then Asterisk will send 1xx responses reliably. If
      the request did not indicate 100rel support, Asterisk sends 1xx
      responses normally.
      
      ASTERISK-30158
      
      Change-Id: Id6d95ffa8f00dab118e0b386146e99f254f287ad
      5bbad0d2
  14. Sep 16, 2022
  15. Sep 15, 2022
  16. Sep 14, 2022
  17. Sep 13, 2022
    • George Joseph's avatar
      res_geolocation: Fix segfault when there's an empty element · 8cbea1c7
      George Joseph authored
      Fixed a segfault caused by var_list_from_loc_info() encountering
      an empty location info element.
      
      Fixed an issue in ast_strsep() where a value with only whitespace
      wasn't being preserved.
      
      Fixed an issue in ast_variable_list_from_quoted_string() where
      an empty value was considered a failure.
      
      ASTERISK-30215
      Reported by: Dan Cropp
      
      Change-Id: Ieca64e061a6d9298f0196c694b60d986ef82613a
      8cbea1c7
    • sungtae kim's avatar
      res_musiconhold: Add option to not play music on hold on unanswered channels · 80bc844f
      sungtae kim authored
      This change adds an option, answeredonly, that will prevent music on
      hold on channels that are not answered.
      
      ASTERISK-30135
      
      Change-Id: I1ab0defa43a29a26ae39f94c623596cf90fddc08
      80bc844f
    • Ben Ford's avatar
      res_pjsip: Add TEL URI support for basic calls. · 881a3f23
      Ben Ford authored
      This change allows TEL URI requests to come through for basic calls. The
      allowed requests are INVITE, ACK, BYE, and CANCEL. The From and To
      headers will now allow TEL URIs, as well as the request URI.
      
      Support is only for TEL URIs present in traffic from a remote party.
      Asterisk does not generate any TEL URIs on its own.
      
      ASTERISK-26894
      
      Change-Id: If5729e6cd583be7acf666373bf9f1b9d653ec29a
      881a3f23
  18. Sep 12, 2022
  19. Sep 10, 2022
    • George Joseph's avatar
      res_geolocation: Add two new options to GEOLOC_PROFILE · 05f42806
      George Joseph authored
      Added an 'a' option to the GEOLOC_PROFILE function to allow
      variable lists like location_info_refinement to be appended
      to instead of replacing the entire list.
      
      Added an 'r' option to the GEOLOC_PROFILE function to resolve all
      variables before a read operation and after a Set operation.
      
      Added a few missing parameters to the ones allowed for writing
      with GEOLOC_PROFILE.
      
      Fixed a bug where calling GEOLOC_PROFILE to read a parameter
      might actually update the profile object.
      
      Cleaned up XML documentation a bit.
      
      ASTERISK-30190
      
      Change-Id: I75f541db43345509a2e86225bfa4cf8e242e5b6c
      05f42806
    • George Joseph's avatar
      res_geolocation: Allow location parameters on the profile object · c799db6a
      George Joseph authored
      You can now specify the location object's format, location_info,
      method, location_source and confidence parameters directly on
      a profile object for simple scenarios where the location
      information isn't common with any other profiles.  This is
      mutually exclusive with setting location_reference on the
      profile.
      
      Updated appdocsxml.dtd to allow xi:include in a configObject
      element.  This makes it easier to link to complete configOptions
      in another object.  This is used to add the above fields to the
      profile object without having to maintain the option descriptions
      in two places.
      
      ASTERISK-30185
      
      Change-Id: Ifd5f05be0a76f0a6ad49fa28d17c394027677569
      c799db6a
    • George Joseph's avatar
      res_geolocation: Add profile parameter suppress_empty_ca_elements · 4ffc5561
      George Joseph authored
      Added profile parameter "suppress_empty_ca_elements" that
      will cause Civic Address elements that are empty to be
      suppressed from the outgoing PIDF-LO document.
      
      Fixed a possible SEGV if a sub-parameter value didn't have a
      value.
      
      ASTERISK-30177
      
      Change-Id: I924ccc5aa2f45110a3155b22e53dfaf3ef2092dd
      4ffc5561
    • George Joseph's avatar
      res_geolocation: Add built-in profiles · 2d5a6498
      George Joseph authored
      The trigger to perform outgoing geolocation processing is the
      presence of a geoloc_outgoing_call_profile on an endpoint. This
      is intentional so as to not leak location information to
      destinations that shouldn't receive it.   In a totally dynamic
      configuration scenario however, there may not be any profiles
      defined in geolocation.conf.  This makes it impossible to do
      outgoing processing without defining a "dummy" profile in the
      config file.
      
      This commit adds 4 built-in profiles:
        "<prefer_config>"
        "<discard_config>"
        "<prefer_incoming>"
        "<discard_incoming>"
      The profiles are empty except for having their precedence
      set and can be set on an endpoint to allow processing without
      entries in geolocation.conf.  "<discard_config>" is actually the
      best one to use in this situation.
      
      ASTERISK-30182
      
      Change-Id: I1819ccfa404ce59802a3a07ad1cabed60fb9480a
      2d5a6498
    • Joshua C. Colp's avatar
      res_pjsip_sdp_rtp: Skip formats without SDP details. · f3de933b
      Joshua C. Colp authored
      When producing an outgoing SDP we iterate through the configured
      formats and produce SDP information. It is possible for some
      configured formats to not have SDP information available. If this
      is the case we skip over them to allow the SDP to still be
      produced.
      
      ASTERISK-29185
      
      Change-Id: I3e37569aa4ca341260e6ca5904dc2f75e46a1749
      f3de933b
  20. Sep 09, 2022
    • Joshua C. Colp's avatar
      pjsip: Add TLS transport reload support for certificate and key. · a0713a9f
      Joshua C. Colp authored
      This change adds support using the pjsip_tls_transport_restart
      function for reloading the TLS certificate and key, if the filenames
      remain unchanged. This is useful for Let's Encrypt and other
      situations. Note that no restart of the transport will occur if
      the certificate and key remain unchanged.
      
      ASTERISK-30186
      
      Change-Id: I9bc95a6bf791830a9491ad9fa43c17d4010028d0
      a0713a9f
    • Naveen Albert's avatar
      res_tonedetect: Fix typos referring to wrong variables. · 754346a4
      Naveen Albert authored
      Fixes two typos that cause fax detection to not work.
      One refers to the wrong frame variable, and the other
      refers to the subclass.integer instead of the frametype
      as it should.
      
      ASTERISK-30192 #close
      
      Change-Id: I7b35fdb7bcf25a29a212eee37c20812c64ab3ef1
      754346a4
    • Alexei Gradinari's avatar
      res_pjsip_pubsub: Postpone destruction of old subscriptions on RLS update · 12c4c1bf
      Alexei Gradinari authored
      Set termination state to old subscriptions to prevent queueing and sending
      NOTIFY messages on exten/device state changes.
      
      Postpone destruction of old subscriptions until all already queued tasks
      that may be using old subscriptions have completed.
      
      ASTERISK-29906
      
      Change-Id: I96582aad3a26515ca73a8460ee6756f56f6ba23b
      12c4c1bf
  21. Aug 10, 2022
    • George Joseph's avatar
      res_geolocation: Address user issues, remove complexity, plug leaks · 8a8416e3
      George Joseph authored
      * Added processing for the 'confidence' element.
      * Added documentation to some APIs.
      * removed a lot of complex code related to the very-off-nominal
        case of needing to process multiple location info sources.
      * Create a new 'ast_geoloc_eprofile_to_pidf' API that just takes
        one eprofile instead of a datastore of multiples.
      * Plugged a huge leak in XML processing that arose from
        insufficient documentation by the libxml/libxslt authors.
      * Refactored stylesheets to be more efficient.
      * Renamed 'profile_action' to 'profile_precedence' to better
        reflect it's purpose.
      * Added the config option for 'allow_routing_use' which
        sets the value of the 'Geolocation-Routing' header.
      * Removed the GeolocProfileCreate and GeolocProfileDelete
        dialplan apps.
      * Changed the GEOLOC_PROFILE dialplan function as follows:
        * Removed the 'profile' argument.
        * Automatically create a profile if it doesn't exist.
        * Delete a profile if 'inheritable' is set to no.
      * Fixed various bugs and leaks
      * Updated Asterisk WiKi documentation.
      
      ASTERISK-30167
      
      Change-Id: If38c23f26228e96165be161c2f5e849cb8e16fa0
      8a8416e3
  22. Aug 05, 2022
  23. Aug 01, 2022
    • Naveen Albert's avatar
      general: Improve logging levels of some log messages. · c6544865
      Naveen Albert authored
      Adjusts some logging levels to be more or less important,
      that is more prominent when actual problems occur and less
      prominent for less noteworthy things.
      
      ASTERISK-30153 #close
      
      Change-Id: Ifc8f7df427aa018627db462125ae744986d3261b
      c6544865
Loading