Skip to content
Snippets Groups Projects
  1. Oct 27, 2022
    • 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
  2. 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
  3. Oct 10, 2022
    • Naveen Albert's avatar
      cdr: Allow bridging and dial state changes to be ignored. · b331caca
      Naveen Albert authored
      Allows bridging, parking, and dial messages to be globally
      ignored for all CDRs such that only a single CDR record
      is generated per channel.
      
      This is useful when CDRs should endure for the lifetime of
      an entire channel and bridging and dial updates in the
      dialplan should not result in multiple CDR records being
      created for the call. With the ignore bridging option,
      bridging changes have no impact on the channel's CDRs.
      With the ignore dial state option, multiple Dials and their
      outcomes have no impact on the channel's CDRs. The
      last disposition on the channel is preserved in the CDR,
      so the actual disposition of the call remains available.
      
      These two options can reduce the amount of "CDR hacks" that
      have hitherto been necessary to ensure that CDR was not
      "spoiled" by these messages if that was undesired, such as
      putting a dummy optimization-disabled local channel between
      the caller and the actual call and putting the CDR on the channel
      in the middle to ensure that CDR would persist for the entire
      call and properly record start, answer, and end times.
      Enabling these options is desirable when calls correspond
      to the entire lifetime of channels and the CDR should
      reflect that.
      
      Current default behavior remains unchanged.
      
      ASTERISK-30091 #close
      
      Change-Id: I393981af42732ec5ac3ff9266444abb453b7c832
      b331caca
  4. 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
  5. Sep 26, 2022
  6. 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
  7. 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
    • 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
  8. Sep 12, 2022
  9. Sep 11, 2022
    • Naveen Albert's avatar
      pbx_variables: Use const char if possible. · 2de016b1
      Naveen Albert authored
      Use const char for char arguments to
      pbx_substitute_variables_helper_full_location
      that can do so (context and exten).
      
      ASTERISK-30209 #close
      
      Change-Id: I001357177e9c3dca2b2b4eebc5650c1095b3da6f
      2de016b1
  10. 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
    • Naveen Albert's avatar
      cli: Prevent assertions on startup from bad ao2 refs. · c7612521
      Naveen Albert authored
      If "core show channels" is run before startup has completed, it
      is possible for bad ao2 refs to occur because the system is not
      yet fully initialized. This will lead to an assertion failing.
      
      To prevent this, initialization of CLI builtins is moved to be
      later along in the main load sequence. Core CLI commands are
      loaded at the same time, but channel-related commands are loaded
      later on.
      
      ASTERISK-29846 #close
      
      Change-Id: If6b3cde802876bd738c1b4cf2683bea6ddc615b6
      c7612521
  11. 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
    • Sean Bright's avatar
      channel.h: Remove redundant declaration. · 155c7962
      Sean Bright authored
      The DECLARE_STRINGFIELD_SETTERS_FOR() declares ast_channel_name_set()
      for us, so no need to declare it separately.
      
      Change-Id: I4813a884ada475ddc62bca480bceb4a53b3ec59a
      155c7962
  12. Sep 08, 2022
    • Naveen Albert's avatar
      features: Add transfer initiation options. · 3fa66c92
      Naveen Albert authored
      Adds additional control options over the transfer
      feature functionality to give users more control
      in how the transfer feature sounds and works.
      
      First, the "transfer" sound that plays when a transfer is
      initiated can now be customized by the user in
      features.conf, just as with the other transfer sounds.
      
      Secondly, the user can now specify the transfer extension
      in advance by using the TRANSFER_EXTEN variable. If
      a valid extension is contained in this variable, the call
      will automatically be transferred to this destination.
      Otherwise, it will fall back to collecting the extension
      from the user as is always done now.
      
      ASTERISK-29899 #close
      
      Change-Id: Ibff309caa459a2b958706f2ed0ca393b1ef502e3
      3fa66c92
  13. Aug 17, 2022
    • Naveen Albert's avatar
      general: Very minor coding guideline fixes. · e2e049e4
      Naveen Albert authored
      Fixes a few coding guideline violations:
      * Use of C99 comments
      * Opening brace on same line as function prototype
      
      ASTERISK-30163 #close
      
      Change-Id: I07771c4c89facd41ce8d323859f022ddbddf6ca7
      e2e049e4
  14. 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
  15. Jul 14, 2022
    • Naveen Albert's avatar
      chan_dahdi: Fix buggy and missing Caller ID parameters · f2f397c1
      Naveen Albert authored
      There are several things wrong with analog Caller ID
      handling that are fixed by this commit:
      
      callerid.c's Caller ID generation function contains the
      logic to use the presentation to properly send the proper
      Caller ID. However, currently, DAHDI does not pass any
      presentation information to the Caller ID module, which
      means that presentation is completely ignored on all calls.
      This means that lines could be getting Caller ID information
      they aren't supposed to.
      
      Part of the reason this has been obscured is because the
      simple switch logic for handling the built in *67 and *82
      is completely wrong. Rather than modifying the presentation
      for the call accordingly (which is what it's supposed to do),
      it simply blanks out the Caller ID or fills it in. This is
      wrong, so wrong that it makes a mockery of the specification.
      Additionally, it would leave to the "UNAVAILABLE" disposition
      being used for Caller ID generation as opposed to the "PRIVATE"
      disposition that it should have been using. This is now fixed
      to only update the presentation and not modify the number and
      name, so that the simple switch *67/*82 work correctly.
      
      Next, sig_analog currently only copies over the name and number,
      nothing else, when it is filling in a duplicated caller id
      structure. Thus, we also now copy over the presentation
      information so that is available for the Caller ID spill.
      Additionally, this meant that "valid" was implicitly 0,
      and as such presentation would always fail to "Unavailable".
      The validity is therefore also copied over so it can be used
      by ast_party_id_presentation.
      
      As part of this fix, new API is added so that all the relevant
      Caller ID information can be passed in to the Caller ID generation
      functions. Parameters that are also completely missing from the
      Caller ID spill have also been added, to enhance the compatibility,
      correctness, and completeness of the Asterisk Caller ID implementation.
      
      ASTERISK-29991 #close
      
      Change-Id: Icc44a5e09979916f4c18a440f96e10dc1c76ae15
      f2f397c1
  16. Jul 12, 2022
    • George Joseph's avatar
      Geolocation: chan_pjsip Capability Preview · 1fa568e7
      George Joseph authored
      This commit adds res_pjsip_geolocation which gives chan_pjsip
      the ability to use the core geolocation capabilities.
      
      This commit message is intentionally short because this isn't
      a simple capability.  See the documentation at
      https://wiki.asterisk.org/wiki/display/AST/Geolocation
      for more information.
      
      THE CAPABILITIES IMPLEMENTED HERE MAY CHANGE BASED ON
      USER FEEDBACK!
      
      ASTERISK-30128
      
      Change-Id: Ie2e2bcd87243c2cfabc43eb823d4427c7086f4d9
      1fa568e7
    • George Joseph's avatar
      Geolocation: Core Capability Preview · 639d72e9
      George Joseph authored
      This commit adds res_geolocation which creates the core capabilities
      to manipulate Geolocation information on SIP INVITEs.
      
      An upcoming commit will add res_pjsip_geolocation which will
      allow the capabilities to be used with the pjsip channel driver.
      
      This commit message is intentionally short because this isn't
      a simple capability.  See the documentation at
      https://wiki.asterisk.org/wiki/display/AST/Geolocation
      for more information.
      
      THE CAPABILITIES IMPLEMENTED HERE MAY CHANGE BASED ON
      USER FEEDBACK!
      
      ASTERISK-30127
      
      Change-Id: Ibfde963121b1ecf57fd98ee7060c4f0808416303
      639d72e9
    • Naveen Albert's avatar
      general: Fix various typos. · bcc18ca9
      Naveen Albert authored
      ASTERISK-30089 #close
      
      Change-Id: I1f5db911fd05a3a211c522c13e990fa1d0e62275
      bcc18ca9
  17. Jul 07, 2022
    • George Joseph's avatar
      Geolocation: Base Asterisk Prereqs · 5fe98877
      George Joseph authored
      * Added ast_variable_list_from_quoted_string()
        Parse a quoted string into an ast_variable list.
      
      * Added ast_str_substitute_variables_full2()
        Perform variable/function/expression substitution on an ast_str.
      
      * Added ast_strsep_quoted()
        Like ast_strsep except you can specify a specific quote character.
        Also added unit test.
      
      * Added ast_xml_find_child_element()
        Find a direct child element by name.
      
      * Added ast_xml_doc_dump_memory()
        Dump the specified document to a buffer
      
      * ast_datastore_free() now checks for a NULL datastore
        before attempting to destroy it.
      
      Change-Id: I5dcefed2f5f93a109e8b489e18d80d42e45244ec
      5fe98877
  18. Jul 01, 2022
    • Naveen Albert's avatar
      db: Notify user if deleted DB entry didn't exist. · 350ffcb0
      Naveen Albert authored
      Currently, if using the CLI to delete a DB entry,
      "Database entry removed" is always returned,
      regardless of whether or not the entry actually
      existed in the first place. This meant that users
      were never told if entries did not exist.
      
      The same issue occurs if trying to delete a DB key
      using AMI.
      
      To address this, new API is added that is more stringent
      in deleting values from AstDB, which will not return
      success if the value did not exist in the first place,
      and will print out specific error details if available.
      
      ASTERISK-30001 #close
      
      Change-Id: Ic84e3eddcd66c7a6ed7fea91cdfd402568378b18
      350ffcb0
  19. Jun 30, 2022
    • Kevin Harwell's avatar
      res_pjsip: allow TLS verification of wildcard cert-bearing servers · a3b2daf1
      Kevin Harwell authored
      Rightly the use of wildcards in certificates is disallowed in accordance
      with RFC5922. However, RFC2818 does make some allowances with regards to
      their use when using subject alt names with DNS name types.
      
      As such this patch creates a new setting for TLS transports called
      'allow_wildcard_certs', which when it and 'verify_server' are both enabled
      allows DNS name types, as well as the common name that start with '*.'
      to match as a wildcard.
      
      For instance: *.example.com
      will match for: foo.example.com
      
      Partial matching is not allowed, e.g. f*.example.com, foo.*.com, etc...
      And the starting wildcard only matches for a single level.
      
      For instance: *.example.com
      will NOT match for: foo.bar.example.com
      
      The new setting is disabled by default.
      
      ASTERISK-30072 #close
      
      Change-Id: If0be3fdab2e09c2a66bb54824fca406ebaac3da4
      a3b2daf1
    • Naveen Albert's avatar
      pbx: Add helper function to execute applications. · 4a11ae7e
      Naveen Albert authored
      Finding an application and executing it if found is
      a common task throughout Asterisk. This adds a helper
      function around pbx_exec to do this, to eliminate
      redundant code and make it easier for modules to
      substitute variables and execute applications by name.
      
      ASTERISK-30061 #close
      
      Change-Id: Ifee4d2825df7545fb515d763d393065675140c84
      4a11ae7e
  20. Jun 06, 2022
    • Naveen Albert's avatar
      loader: Prevent deadlock using tab completion. · 3e862945
      Naveen Albert authored
      If tab completion using ast_module_helper is attempted
      during startup, deadlock will ensue because the CLI
      will attempt to lock the module list while it is already
      locked by the loader. This causes deadlock because when
      the loader tries to acquire the CLI lock, they are blocked
      on each other.
      
      Waiting for startup to complete is not feasible because
      the CLI lock is acquired while waiting, so deadlock will
      ensure regardless of whether or not a lock on the module
      list is attempted.
      
      To prevent deadlock, we immediately abort if tab completion
      is attempted on the module list before Asterisk is fully
      booted.
      
      ASTERISK-30039 #close
      
      Change-Id: Idd468906c512bb196631e366a8f597a0e2e9271d
      3e862945
  21. May 22, 2022
    • Moritz Fain's avatar
      ari: expose channel driver's unique id to ARI channel resource · 4bf2473a
      Moritz Fain authored
      This change exposes the channel driver's unique id (i.e. the Call-ID
      for chan_sip/chan_pjsip based channels) to ARI channel resources
      as `protocol_id`.
      
      ASTERISK-30027
      Reported by: Moritz Fain
      Tested by: Moritz Fain
      
      Change-Id: I7cc6e7a9d29efe74bc27811d788dac20fe559b87
      4bf2473a
  22. May 09, 2022
    • George Joseph's avatar
      GCC12: Fixes for 16+ · 4aa54168
      George Joseph authored
      Most issues were in stringfields and had to do with comparing
      a pointer to an constant/interned string with NULL.  Since the
      string was a constant, a pointer to it could never be NULL so
      the comparison was always "true".  gcc now complains about that.
      
      There were also a few issues where determining if there was
      enough space for a memcpy or s(n)printf which were fixed
      by defining some of the involved variables as "volatile".
      
      There were also a few other miscellaneous fixes.
      
      ASTERISK-30044
      
      Change-Id: Ia081ca1bcfb329df6487c4660aaf1944309eb570
      4aa54168
  23. Apr 27, 2022
  24. Apr 26, 2022
    • Mark Petersen's avatar
      chan_pjsip: add allow_sending_180_after_183 option · 1cdaeb81
      Mark Petersen authored
      added new global config option "allow_sending_180_after_183"
      that if enabled will preserve 180 after a 183
      
      ASTERISK-29842
      
      Change-Id: I8a53f8c35595b6d16d8e86e241b5f110d92f3d18
      1cdaeb81
    • Kevin Harwell's avatar
      res_aeap & res_speech_aeap: Add Asterisk External Application Protocol · 272bac70
      Kevin Harwell authored
      Add framework to connect to, and read and write protocol based
      messages from and to an external application using an Asterisk
      External Application Protocol (AEAP). This has been divided into
      several abstractions:
      
       1. transport - base communication layer (currently websocket only)
       2. message - AEAP description and data (currently JSON only)
       3. transaction - links/binds requests and responses
       4. aeap - transport, message, and transaction handler/manager
      
      This patch also adds an AEAP implementation for speech to text.
      Existing speech API callbacks for speech to text have been completed
      making it possible for Asterisk to connect to a configured external
      translator service and provide audio for STT. Results can also be
      received from the external translator, and made available as speech
      results in Asterisk.
      
      Unit tests have also been created that test the AEAP framework, and
      also the speech to text implementation.
      
      ASTERISK-29726 #close
      
      Change-Id: Iaa4b259f84aa63501e5fd2a6fb107f900b4d4ed2
      272bac70
  25. Apr 25, 2022
  26. Apr 14, 2022
    • Ben Ford's avatar
      AST-2022-002 - res_stir_shaken/curl: Add ACL checks for Identity header. · 0724b767
      Ben Ford authored
      Adds a new configuration option, stir_shaken_profile, in pjsip.conf that
      can be specified on a per endpoint basis. This option will reference a
      stir_shaken_profile that can be configured in stir_shaken.conf. The type
      of this option must be 'profile'. The stir_shaken option can be
      specified on this object with the same values as before (attest, verify,
      on), but it cannot be off since having the profile itself implies wanting
      STIR/SHAKEN support. You can also specify an ACL from acl.conf (along
      with permit and deny lines in the object itself) that will be used to
      limit what interfaces Asterisk will attempt to retrieve information from
      when reading the Identity header.
      
      ASTERISK-29476
      
      Change-Id: I87fa61f78a9ea0cd42530691a30da3c781842406
      0724b767
  27. Mar 24, 2022
Loading