Skip to content
Snippets Groups Projects
  1. May 09, 2022
    • Naveen Albert's avatar
      chan_dahdi: Fix broken operator mode clearing. · a24979a2
      Naveen Albert authored
      Currently, the operator services mode in DAHDI is broken and unusable.
      The actual operator recall functionality works properly; however,
      when the operator hangs up (which is the only way that such a call
      is allowed to end), both lines are permanently taken out of service
      until "dahdi restart" is run. This prevents this feature from being
      used.
      
      Operator mode is one of the few factors that can cause the general
      analog event handling in sig_analog not to be used. Several years
      back, much of the analog handling was moved from chan_dahdi to
      sig_analog. However, this was not done fully or consistently at
      the time, and when operator mode is active, sig_analog does not
      get used. Generally this is correct, but in the case of hangup
      it should be using sig_analog regardless of the operator mode;
      otherwise, the lines do not properly clear and they become unusable.
      
      This bug is fixed so the operator can now hang up and properly
      release the call. It is treated just like any other hangup. The
      operator mode functionality continues to work as it did before.
      
      ASTERISK-29993 #close
      
      Change-Id: Ib2e3ddb40d9c71e8801e0b4bb0a12e2b52f51d24
      a24979a2
    • 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
    • George Joseph's avatar
      GCC12: Fixes for 18+. state_id_by_topic comparing wrong value · 49108810
      George Joseph authored
      GCC 12 caught an issue in state_id_by_topic where we were
      checking a pointer for NULL instead of the contents of
      the pointer for '\0'.
      
      ASTERISK-30044
      
      Change-Id: Ia0b04d4fff45c92acb7f07132a33622fa341148e
      49108810
  2. May 05, 2022
    • Maximilian Fridrich's avatar
      core_unreal: Flip stream direction of second channel. · 8fdc6008
      Maximilian Fridrich authored
      When a new unreal (local) channel is created, a second (;2) channel is
      created as a counterpart which clones the topology of the first
      channel. This creates issues when an outgoing stream is sendonly or
      recvonly as the stream state of the inbound channel will be the same
      as the stream state of the outbound channel.
      
      Now the stream state is flipped for the streams of the 2nd channel in
      ast_unreal_new_channels if the outgoing stream topology is recvonly or
      sendonly.
      
      ASTERISK-29655
      Reported by: Michael Auracher
      
      ASTERISK-29638
      Reported by: Michael Auracher
      
      Change-Id: I0cea29635bb20b7bf7fd0fb95498cd44dab98fbf
      8fdc6008
  3. May 02, 2022
    • Naveen Albert's avatar
      chan_dahdi: Document dial resource options. · 892c0656
      Naveen Albert authored
      Documents the Dial syntax for DAHDI, namely the channel group,
      distinctive ring, answer confirmation, and digital call options
      that are specified in the resource itself.
      
      ASTERISK-24827 #close
      
      Change-Id: Ib95e78497fb00dc5cbfde1c93a69f034bfd08c30
      892c0656
    • Naveen Albert's avatar
      chan_dahdi: Don't allow MWI FSK if channel not idle. · 0a8b3d34
      Naveen Albert authored
      For lines that have mailboxes configured on them, with
      FSK MWI, DAHDI will periodically try to dispatch FSK
      to update MWI. However, this is never supposed to be
      done when a channel is not idle.
      
      There is currently an edge case where MWI FSK can
      extraneously get spooled for the channel if a caller
      hook flashes and hangs up, which triggers a recall ring.
      After one ring, the on hook time threshold in this if
      condition has been satisfied and an MWI update is spooled.
      This means that when the phone is picked up again, the
      answerer gets an FSK spill before being reconnected to
      the party on hold.
      
      To prevent this, we now explicitly check to ensure that
      subchannel 0 has no owner. There is no owner when DAHDI
      channels are idle, but if the channel is "in use" in some
      way (such as in the aforementioned scenario), then there
      is an owner, and we shouldn't process MWI at this time.
      
      ASTERISK-28518 #close
      
      Change-Id: Ia3904434fd81688d71742f7e84358b7e1c38e92a
      0a8b3d34
    • Michael Cargile's avatar
      apps/confbridge: Added hear_own_join_sound option to control who hears sound_join · a2679b0e
      Michael Cargile authored
      Added the hear_own_join_sound option to the confbridge user profile to
      control who hears the sound_join audio file. When set to 'yes' the user
      entering the conference and the participants already in the conference
      will hear the sound_join audio file. When set to 'no' the user entering
      the conference will not hear the sound_join audio file, but the
      participants already in the conference will hear the sound_join audio
      file.
      
      ASTERISK-29931
      Added by Michael Cargile
      
      Change-Id: I856bd66dc0dfa057323860a6418c1371d249abd2
      a2679b0e
    • Naveen Albert's avatar
      chan_dahdi: Don't append cadences on dahdi restart. · 19c84195
      Naveen Albert authored
      Currently, if any custom ring cadences are specified, they are
      appended to the array of cadences from wherever we left off
      last time. This works properly the first time, but on subsequent
      dahdi restarts, it means that the existing cadences are left
      alone and (most likely) the same cadences are then re-added
      afterwards. In short order, the cadence array gets maxed out
      and the user begins seeing warnings that the array is full
      and no more cadences may be added.
      
      This buggy behavior persists until Asterisk is completely
      restarted; however, if and when dahdi restart is run again,
      then the same problem is reintroduced.
      
      This fixes this behavior so that cadence parsing is more
      idempotent, that is so running dahdi restart multiple times
      starts adding cadences from the beginning, rather than from
      wherever the last cadence was added.
      
      As before, it is still not possible to revert to the default
      cadences by simply removing all cadences in this manner, nor
      is it possible to delete existing cadences. However, this
      does make it possible to update existing cadences, which
      was not possible before, and also ensures that the cadences
      remain unchanged if the config remains unchanged.
      
      ASTERISK-29990 #close
      
      Change-Id: Ie32ea3e8a243b766756b1afce684d4a31ee7421d
      19c84195
    • Naveen Albert's avatar
      chan_iax2: Prevent crash if dialing RSA-only call without outkey. · fbe960ca
      Naveen Albert authored
      Currently, if attempting to place a call to a peer that only allows
      RSA authentication, if we fail to provide an outkey when placing
      the call, Asterisk will crash.
      
      This exposes the broader issue that IAX2 is prone to causing a crash
      if encryption or decryption is attempted but we never initialized
      the encryption and decryption keys. In other words, if the logic
      to use encryption in chan_iax2 is not perfectly aligned with the
      decision to build keys in the first place, then a crash is not
      only possible but probable. This was demonstrated by ASTERISK_29264,
      for instance.
      
      This permanently prevents such events from causing a crash by explicitly
      checking that keys are initialized properly before setting the flags
      to use encryption for the call. Instead of crashing, the call will
      now abort.
      
      ASTERISK-30007 #close
      
      Change-Id: If925c3d86099ceac7f621804f2532baac5050c9a
      fbe960ca
  4. Apr 28, 2022
    • Naveen Albert's avatar
      menuselect: Don't erroneously recompile modules. · fe6f7dcb
      Naveen Albert authored
      A bug in menuselect can cause modules that are disabled
      by default to be recompiled every time a recompilation
      occurs. This occurs for module categories that are NOT
      positive output, as for these categories, the modules
      contained in the makeopts file indicate modules which
      should NOT be selected. The existing procedure of iterating
      through these modules to mark modules as present is thus
      insufficient. This has led to modules with a default_enabled
      tag of "no" to get deleted and recompiled every time, even
      when they haven't changed.
      
      To fix this, we now modify the mark as present behavior
      for module categories that are not positive output. For
      these, we start by iterating through the module tree
      and marking all modules as present, then go back and
      mark anything contained in the makeopts file as not
      present. This ensures that makeopt selections are actually
      used properly, regardless of whether a module category
      uses positive output or not.
      
      ASTERISK-29728 #close
      
      Change-Id: Idf2974c4ed8d0ba3738a92f08a6082b234277b95
      fe6f7dcb
  5. Apr 27, 2022
    • Naveen Albert's avatar
      app_meetme: Don't erroneously set global variables. · b90650d8
      Naveen Albert authored
      The admin_exec function in app_meetme is used by the SLA
      applications for internal bridging. However, in these cases,
      chan is NULL. Currently, this function will set some status
      variables that are intended for a channel, but since channel
      is NULL, this is erroneously creating meaningless global
      variables, which shouldn't be happening. This sets these
      variables only if chan is not NULL.
      
      ASTERISK-30002 #close
      
      Change-Id: I817df6c26f5bda131678e56791b0b61ba64fc6f7
      b90650d8
    • Naveen Albert's avatar
      asterisk.c: Warn of incompatibilities with remote console. · 4585a9c3
      Naveen Albert authored
      Some command line options to Asterisk only apply when Asterisk
      is started and cannot be used with remote console mode. If a
      user tries to use any of these, they are currently simply
      silently ignored.
      
      This prints out a warning if incompatible options are used,
      informing users that an option used cannot be used with remote
      console mode. Additionally, some clarifications are added to
      the help text and man page.
      
      ASTERISK-22246
      ASTERISK-26582
      
      Change-Id: I980a5380ef2c19e8ea348596396d5382893c4337
      4585a9c3
    • Naveen Albert's avatar
      func_db: Add function to return cardinality at prefix · 306ce09d
      Naveen Albert authored
      Adds the DB_KEYCOUNT function, which can be used to retrieve
      the number of keys at a given prefix in AstDB.
      
      ASTERISK-29968 #close
      
      Change-Id: Ib2393b77b7e962dbaae6192f8576bc3f6ba92d09
      306ce09d
    • Naveen Albert's avatar
      chan_dahdi: Fix insufficient array size for round robin. · fe50f049
      Naveen Albert authored
      According to chan_dahdi.conf, up to 64 groups (numbered
      0 through 63) can be used when dialing DAHDI channels.
      
      However, currently dialing round robin with a group number
      greater than 31 fails because the array for the round robin
      structure is only size 32, instead of 64 as it should be.
      
      This fixes that so the round robin array size is consistent
      with the actual groups capacity.
      
      ASTERISK-29994
      
      Change-Id: I4caa08d7025f78ac75a0539f71aaf3eb3e85b3b7
      fe50f049
    • Mark Petersen's avatar
      chan_sip.c Session timers get removed on UPDATE · a3abc868
      Mark Petersen authored
      If Asterisk receives a SIP REFER with Session-Timers UAC
      maintain Session-Timers when sending UPDATE"
      
      ASTERISK-29843
      
      Change-Id: I8e9a21c13bf757fa34d778f49ba3cf859b29ae5c
      a3abc868
    • Naveen Albert's avatar
      func_evalexten: Extension evaluation function. · 6ddb0ec9
      Naveen Albert authored
      This adds the EVAL_EXTEN function, which may be used to retrieve
      the variable-substituted data at any extension.
      
      ASTERISK-29486
      
      Change-Id: Iad81019689674c9f4ac77d235f5d7234adbb1432
      6ddb0ec9
    • Naveen Albert's avatar
      file.c: Prevent formats from seeking negative offsets. · ce7846e6
      Naveen Albert authored
      Currently, if a user uses an application like ControlPlayback
      to try to rewind a file past the beginning, this can throw
      warnings when the file format (e.g. PCM) tries to seek to
      a negative offset.
      
      Instead of letting file formats try (and fail) to seek a
      negative offset, we instead now catch this in the rewind
      function to ensure that we never seek an offset less than 0.
      This prevents legitimate user actions from triggering warnings
      from any particular file formats.
      
      ASTERISK-29943 #close
      
      Change-Id: Ia53f2623f57898f4b8e5c894b968b01e95426967
      ce7846e6
  6. Apr 26, 2022
    • Naveen Albert's avatar
      chan_pjsip: Add ability to send flash events. · 193b7a81
      Naveen Albert authored
      PJSIP currently is capable of receiving flash events
      and converting them to FLASH control frames, but it
      currently lacks support for doing the reverse: taking
      a FLASH control frame and converting it into a flash
      event in the SIP domain.
      
      This adds the ability for PJSIP to process flash control
      frames by converting them into the appropriate SIP INFO
      message, which can then be sent to the peer. This allows,
      for example, flash events to be sent between Asterisk
      systems using PJSIP.
      
      ASTERISK-29941 #close
      
      Change-Id: I1590221a4d238597f79672fa5825dd4a920c94dd
      193b7a81
    • Naveen Albert's avatar
      cli: Add command to evaluate dialplan functions. · 92d408f2
      Naveen Albert authored
      Adds the dialplan eval function commands to evaluate a dialplan
      function from the CLI. The return value and function result are
      printed out and can be used for testing or debugging.
      
      ASTERISK-29820 #close
      
      Change-Id: I833e97ea54c49336aca145330a2adeebfad05209
      92d408f2
    • Naveen Albert's avatar
      documentation: Adds versioning information. · 0c70d497
      Naveen Albert authored
      Adds version information for applications, functions,
      and manager events/actions.
      
      This is not completely exhaustive by any means but
      covers most new things added that have release
      versioning information in the issue tracker.
      
      ASTERISK-29940 #close
      
      Change-Id: I506401e93c799715dbbe97c0a8ba18af2bf5e131
      0c70d497
    • Naveen Albert's avatar
      samples: Remove obsolete sample configs. · bce722e6
      Naveen Albert authored
      Removes a couple sample config files for modules
      which have since been removed from Asterisk.
      
      ASTERISK-30008 #close
      
      Change-Id: I6be89cafc6c575d98a5315e4912b61a833aacf52
      bce722e6
    • 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
    • Mark Petersen's avatar
      chan_sip: SIP route header is missing on UPDATE · eab489b2
      Mark Petersen authored
      if Asterisk need to send an UPDATE before answer
      on a channel that uses Record-Route:
      it will not include a Route header
      
      ASTERISK-29955
      
      Change-Id: Id1920ecbfea7739a038b14dc94487ecfe7b57eef
      eab489b2
    • Joshua C. Colp's avatar
      manager: Terminate session on write error. · f6062b17
      Joshua C. Colp authored
      On a write error to an AMI session a flag was set to
      indicate that the write error had occurred, with the
      expected result being that the session be terminated.
      This was not actually happening and instead writing
      would continue to be attempted.
      
      This change adds a check for the write error and causes
      the session to actually terminate.
      
      ASTERISK-29948
      
      Change-Id: Icaf5d413d4c0d5dc78292a17287fecc8720a31a5
      f6062b17
    • Yury Kirsanov's avatar
      bridge_simple.c: Unhold channels on join simple bridge. · e9355e66
      Yury Kirsanov authored
      Patch provided inline by Yury Kirsanov on the linked issue and
      approved by Josh Colp.
      
      ASTERISK-29253 #close
      
      Change-Id: I5b9ccc67ebf06e875ed061d9e7fc21f47b0a4e1f
      e9355e66
    • 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
    • Maximilian Fridrich's avatar
      app_dial: Flip stream direction of outgoing channel. · 53a3af63
      Maximilian Fridrich authored
      When executing dial, the topology of the incoming channel is cloned and
      used for the outgoing channel. This creates issues when an incoming
      stream is sendonly or recvonly as the stream state of the outgoing
      channel will be the same as the stream state of the incoming channel.
      
      Now the stream state is flipped for the outgoing stream in
      dial_exec_full if the incoming stream topology is recvonly or sendonly.
      
      ASTERISK-29655
      Reported by: Michael Auracher
      
      ASTERISK-29638
      Reported by: Michael Auracher
      
      Change-Id: I294dc834ac9a5f048b101b691669959e9df630e1
      53a3af63
    • Ben Ford's avatar
      res_pjsip_stir_shaken.c: Fix enabled when not configured. · f593b1e9
      Ben Ford authored
      There was an issue with the conditional where STIR/SHAKEN would be
      enabled even when not configured. It has been changed to ensure that if
      a profile does not exist and stir_shaken is not set in pjsip.conf, then
      the conditional will return from the function without performing
      STIR/SHAKEN operations.
      
      ASTERISK-30024
      
      Change-Id: I41286a3d35b033ccbfbe4129427a62cb793a86e6
      f593b1e9
    • Joshua C. Colp's avatar
      res_pjsip: Always set async_operations to 1. · fdc1c750
      Joshua C. Colp authored
      The async_operations setting on a transport configures how
      many simultaneous incoming packets the transport can handle
      when multiple threads are polling and waiting on the transport.
      As we only use a single thread this was needlessly creating
      incoming packets when set to a non-default value, wasting memory.
      
      ASTERISK-30006
      
      Change-Id: I1915973ef352862dc2852a6ba4cfce2ed536e68f
      fdc1c750
  7. Apr 25, 2022
  8. 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
    • Ben Ford's avatar
      AST-2022-001 - res_stir_shaken/curl: Limit file size and check start. · 8f3dd86b
      Ben Ford authored
      Put checks in place to limit how much we will actually download, as well
      as a check for the data we receive at the start to ensure it begins with
      what we would expect a certificate to begin with.
      
      ASTERISK-29872
      
      Change-Id: Ifd3c6b8bd52b8b6192a04166ccce4fc8a8000b46
      8f3dd86b
    • Joshua C. Colp's avatar
      func_odbc: Add SQL_ESC_BACKSLASHES dialplan function. · 4aedaaad
      Joshua C. Colp authored
      Some databases depending on their configuration using backslashes
      for escaping. When combined with the use of ' this can result in
      a broken func_odbc query.
      
      This change adds a SQL_ESC_BACKSLASHES dialplan function which can
      be used to escape the backslashes.
      
      This is done as a dialplan function instead of being always done
      as some databases do not require this, and always doing it would
      result in incorrect data being put into the database.
      
      ASTERISK-29838
      
      Change-Id: I152bf34899b96ddb09cca3e767254d8d78f0c83d
      4aedaaad
  9. Apr 08, 2022
    • Naveen Albert's avatar
      app_mf, app_sf: Return -1 if channel hangs up. · b87c5f51
      Naveen Albert authored
      The ReceiveMF and ReceiveSF applications currently always
      return 0, even if a channel has hung up. The call will still
      end but generally applications are expected to return -1 if
      the channel has hung up.
      
      We now return -1 if a hangup occured to bring this behavior
      in line with this norm. This has no functional impact, but
      merely increases conformity with how these modules interact
      with the PBX core.
      
      ASTERISK-29951 #close
      
      Change-Id: I234d755050ab8ed58f197c6925b968ba26b14033
      b87c5f51
    • Naveen Albert's avatar
      app_queue: Add music on hold option to Queue. · ede4e209
      Naveen Albert authored
      Adds the m option to the Queue application, which allows a
      music on hold class to be specified at runtime which will
      override the class configured in queues.conf.
      
      This option functions like the m option to Dial.
      
      ASTERISK-29876 #close
      
      Change-Id: Ie25a48569cf8755c305c9438b1ed292c3adcf8d7
      ede4e209
    • Naveen Albert's avatar
      app_meetme: Emit warning if conference not found. · da44b848
      Naveen Albert authored
      Currently, if a user tries to access a non-dynamic
      MeetMe conference and the conference is not found,
      the call simply silent hangs up. There is no indication
      to the user that anything went wrong at all.
      
      This changes the relevant debug message to a warning
      so that the user is notified of this invalidity.
      
      ASTERISK-29954 #close
      
      Change-Id: Iebcfae3755d00f2150d676ee211c57bc59530048
      da44b848
  10. Mar 30, 2022
    • Naveen Albert's avatar
      build: Remove obsolete leftover build references. · 94df6077
      Naveen Albert authored
      Removes some leftover build and config references to
      modules that have since been removed from Asterisk.
      
      ASTERISK-29935 #close
      
      Change-Id: Iaefc73a23f4b2de3c6c14d928050135b6d0ef6af
      94df6077
    • Kevin Harwell's avatar
      res_pjsip_header_funcs: wrong pool used tdata headers · 0e31df6c
      Kevin Harwell authored
      When adding headers to an outgoing request the headers were cloned using
      the dialog's pool when they should have been cloned using tdata's pool.
      Under certain circumstances it was possible for the dialog object, and
      its pool to be freed while tdata is still active and available. Thus the
      cloned header "disappeared", and when tdata tried to later access it a
      crash would occur.
      
      This patch makes it so all added headers are cloned appropriately using
      tdata's pool.
      
      ASTERISK-29411 #close
      ASTERISK-29535 #close
      
      Change-Id: I9852025b5ee93ce1c038209150ee9dba1e0767c5
      0e31df6c
Loading