Skip to content
Snippets Groups Projects
  1. Mar 10, 2021
  2. Mar 08, 2021
    • Sean Bright's avatar
      res_musiconhold.c: Plug ref leak caused by ao2_replace() misuse. · df37b818
      Sean Bright authored
      ao2_replace() bumps the reference count of the object that is doing the
      replacing, which is not what we want. We just want to drop the old ref
      on the old object and update the pointer to point to the new object.
      
      Pointed out by George Joseph in #asterisk-dev
      
      Change-Id: Ie8167ed3d4b52b9d1ea2d785f885e8c27206743d
      df37b818
    • Torrey Searle's avatar
      res/res_rtp_asterisk: generate new SSRC on native bridge end · 8c247e2a
      Torrey Searle authored
      For RTCP to work, we update the ssrc to be the one corresponding to
      the native bridge while active.  However when the bridge ends we
      should generate a new SSRC as the sequence numbers will not continue
      from the native bridge left off.
      
      ASTERISK-29300 #close
      
      Change-Id: I23334b6934d2bf6490bda4bbf6414d96b8d17d10
      8c247e2a
  3. Mar 05, 2021
    • Joshua C. Colp's avatar
      sorcery: Add support for more intelligent reloading. · 304f8ddf
      Joshua C. Colp authored
      Some sorcery objects actually contain dynamic content
      that can change despite the underlying configuration
      itself not changing. A good example of this is the
      res_pjsip_endpoint_identifier_ip module which allows
      specifying hostnames. While the configuration may not
      change between reloads the DNS information of the
      hostnames can.
      
      This change adds the ability for a sorcery object to be
      marked as having dynamic contents which is then taken
      into account when reloading by the sorcery file based
      config module. If there is an object with dynamic content
      then a reload will be forced while if there are none
      then the existing behavior of not reloading occurs.
      
      ASTERISK-29321
      
      Change-Id: I9342dc55be46cc00204533c266a68d972760a0b1
      304f8ddf
    • George Joseph's avatar
      res_pjsip_refer: Move the progress dlg release to a serializer · 607603cf
      George Joseph authored
      Although the dlg session count was incremented in a pjsip servant
      thread, there's no guarantee that the last thread to unref this
      progress object was one.  Before we decrement, we need to make
      sure that this is either a servant thread or that we push the
      decrement to a serializer that is one.
      
      Because pjsip_dlg_dec_session requires the dialog lock, we don't
      want to wait on the task to complete if we had to push it to a
      serializer.
      
      Change-Id: I8ff2d5d94be3ff04298394070434e22a7d3cbc41
      607603cf
    • Joshua C. Colp's avatar
      res_pjsip_registrar: Include source IP and port in log messages. · 6f67f24a
      Joshua C. Colp authored
      When registering it can be useful to see the source IP address and
      port in cases where multiple devices are using the same endpoint
      or when anonymous is in use.
      
      ASTERISK-29325
      
      Change-Id: Ie178a6f55f53f8473035854c411bc3d056e0a2e0
      6f67f24a
  4. Mar 04, 2021
    • Joshua C. Colp's avatar
      asterisk: Update copyright. · f8d17587
      Joshua C. Colp authored
      ASTERISK-29326
      
      Change-Id: Ia95dbfb66e2d11ac4d1228444283bb2e4d77396a
      f8d17587
    • Ben Ford's avatar
      AST-2021-006 - res_pjsip_t38.c: Check for session_media on reinvite. · fd560ad9
      Ben Ford authored
      When Asterisk sends a reinvite negotiating T38 faxing, it's possible a
      crash can occur if the response contains a m=image and zero port. The
      reinvite callback code now checks session_media to see if it is null or
      not before trying to access the udptl variable on it.
      
      ASTERISK-29305
      
      Change-Id: I1dfc51c5fa586e38579ede4bc228edee213ccaa9
      fd560ad9
  5. Mar 03, 2021
    • Alexander Traud's avatar
      res_format_attr_h263: Generate valid SDP fmtp for H.263+. · a34e7de6
      Alexander Traud authored
      Fixed:
      * RFC 4629 does not allow the value "0" for MPI, K, and N.
      * Allow value "0" for PAR.
      * BPP is printed only when specified because "0" has a meaning.
      
      New:
      * Added CPCF and MaxBR.
      * Some implementations provide CIF without MPI: a=fmtp:xx CIF;F=1
        Although a violation of RFC 3555 section 3, we can support that.
      
      Changed:
      * Resorts the CIFs from large to small which partly fixes ASTERISK~29267.
      
      Change-Id: I95a650c715007b8dde11a77cb37d9c6c123a441e
      a34e7de6
    • Joshua C. Colp's avatar
      res_pjsip_nat: Don't rewrite Contact on REGISTER responses. · 2c1b6b7b
      Joshua C. Colp authored
      When sending a SIP response to an incoming REGISTER request
      we don't want to change the Contact header as it will
      contain the Contacts registered to the AOR and not our own
      Contact URI.
      
      ASTERISK-29235
      
      Change-Id: I35a0723545281dd01fcd5cae497baab58720478c
      2c1b6b7b
    • Joshua C. Colp's avatar
      channel: Fix memory leak in suppress API. · 3e5b9e39
      Joshua C. Colp authored
      A frame suppression API exists as part of channels
      which allows audio frames to or from a channel to
      be dropped. The MuteAudio AMI action uses this
      API to perform its job.
      
      This API uses a framehook to intercept flowing
      audio and drop it when appropriate. It is the
      responsibility of the framehook to free the
      frame it is given if it changes the frame. The
      suppression API failed to do this resulting in
      a leak of audio frames.
      
      This change adds the freeing of these frames.
      
      ASTERISK-29071
      
      Change-Id: Ie50acd454d672d36af914050c327d2e120d8ba7b
      3e5b9e39
    • Salah Ahmed's avatar
      res_rtp_asterisk: Check remote ICE reset and reset local ice attrb · 5d42dd2e
      Salah Ahmed authored
      This change will check is the remote ICE session got reset or not by
      checking the offered ufrag and password with session. If the remote ICE
      reset session then Asterisk reset its local ufrag and password to reject
      binding request with Old ufrag and Password.
      
      ASTERISK-29266
      
      Change-Id: I9c55e79a7af98a8fbb497d336b828ba41bc34eeb
      5d42dd2e
  6. Mar 02, 2021
    • Holger Hans Peter Freyther's avatar
      pjsip: Generate progress (once) when receiving a 180 with a SDP · 48ed4f67
      Holger Hans Peter Freyther authored
      ASTERISK-29105
      
      Change-Id: If1615fe7115fe544ef974b044d3cea5c48b94a38
      48ed4f67
    • Nico Kooijman's avatar
      main: With Dutch language year after 2020 is not spoken in say.c · 2ea75ed3
      Nico Kooijman authored
      Implemented the english way of saying the year in ast_say_date_with_format_nl.
      Currently the numbers are spoken correctly until 2020 and stopped working
      this year.
      
      ASTERISK-29297 #close
      Reported-by: Jacek Konieczny
      
      Change-Id: If5918eed5ab05df31df4dd23f08a909a60f6aba4
      2ea75ed3
    • Nick French's avatar
      res_pjsip: dont return early from registration if init auth fails · 8f6e0f93
      Nick French authored
      If set_outbound_initial_authentication_credentials() fails,
      handle_client_registration() bails early without creating or
      sending a register message.
      
      [set_outbound_initial_authentication_credentials() failures
      can occur during the process of retrieving an oauth access
      token.]
      
      The return from handle_client_registration is ignored, so
      returning an error doesn't do any good.
      
      This is a real problem when the registration request is a
      re-register, because then the registration will still be
      marked 'active' despite the re-register never being sent at all.
      
      So instead, log a warning but let the registration be created
      and sent (and probably fail) and follow the normal registration
      failed retry/abort logic.
      
      ASTERISK-29315 #close
      
      Change-Id: I2e03b1ea7fba1fa1a8279086aa4b17679e7fa7fa
      8f6e0f93
    • Alexei Gradinari's avatar
      res_fax: validate the remote/local Station ID for UTF-8 format · d2f623ba
      Alexei Gradinari authored
      If the remote Station ID contains invalid UTF-8 characters
      the asterisk fails to publish the Stasis and ReceiveFax status messages.
      
      json.c: Error building JSON from '{s: s, s: s}': Invalid UTF-8 string.
      0: /usr/sbin/asterisk(ast_json_vpack+0x98) [0x4f3f28]
      1: /usr/sbin/asterisk(ast_json_pack+0x8c) [0x4f3fcc]
      2: /usr/sbin/asterisk(ast_channel_publish_varset+0x2b) [0x57aa0b]
      3: /usr/sbin/asterisk(pbx_builtin_setvar_helper+0x121) [0x530641]
      4: /usr/lib64/asterisk/modules/res_fax.so(+0x44fe) [0x7f27f4bff4fe]
      ...
      stasis_channels.c: Error creating message
      
      json.c: Error building JSON from '{s: s, s: s, s: s, s: s, s: s, s: s, s: o}': Invalid UTF-8 string.
      0: /usr/sbin/asterisk(ast_json_vpack+0x98) [0x4f3f28]
      1: /usr/sbin/asterisk(ast_json_pack+0x8c) [0x4f3fcc]
      2: /usr/lib64/asterisk/modules/res_fax.so(+0x5acd) [0x7f27f4c00acd]
      ...
      res_fax.c: Error publishing ReceiveFax status message
      
      This patch replaces the invalid UTF-8 Station IDs with an empty string.
      
      ASTERISK-29312 #close
      
      Change-Id: Ieb00b6ecf67db3bfca787649caa8517f29d987db
      d2f623ba
  7. Feb 26, 2021
    • Sean Bright's avatar
      app_page.c: Don't fail to Page if beep sound file is missing · 932eae69
      Sean Bright authored
      ASTERISK-16799 #close
      
      Change-Id: I40367b0d6dbf66a39721bde060c8b2d734a61cf4
      932eae69
    • George Joseph's avatar
      res_pjsip_refer: Refactor progress locking and serialization · 4c9c5c98
      George Joseph authored
      Although refer_progress_notify() always runs in the progress
      serializer, the pjproject evsub module itself can cause the
      subscription to be destroyed which then triggers
      refer_progress_on_evsub_state() to clean it up.  In this case,
      it's possible that refer_progress_notify() could get the
      subscription pulled out from under it while it's trying to use
      it.
      
      At one point we tried to have refer_progress_on_evsub_state()
      push the cleanup to the serializer and wait for its return before
      returning to pjproject but since pjproject calls its state
      callbacks with the dialog locked, this required us to unlock the
      dialog while waiting for the serialized cleanup, then lock it
      again before returning to pjproject. There were also still some
      cases where other callers of refer_progress_notify() weren't
      using the serializer and crashes were resulting.
      
      Although all callers of refer_progress_notify() now use the
      progress serializer, we decided to simplify the locking so we
      didn't have to unlock and relock the dialog in
      refer_progress_on_evsub_state().
      
      Now, refer_progress_notify() holds the dialog lock for its
      duration and since pjproject also holds the dialog lock while
      calling refer_progress_on_evsub_state() (which does the cleanup),
      there should be no more chances for the subscription to be
      cleaned up while still being used to send NOTIFYs.
      
      To be extra safe, we also now increment the session count on
      the dialog when we create a progress object and decrement
      the count when the progress is destroyed.
      
      ASTERISK-29313
      
      Change-Id: I97a8bb01771a3c85345649b8124507f7622a8480
      4c9c5c98
    • Kevin Harwell's avatar
      res_rtp_asterisk: Add packet subtype during RTCP debug when relevant · e5e49d7e
      Kevin Harwell authored
      For some RTCP packet types the report count is actually the packet's subtype.
      This was not being reflected in the packet debug output.
      
      This patch makes it so for some RTCP packet types a "Packet Subtype" is
      now output in the debug replacing the "Reception reports" (i.e count).
      
      Change-Id: Id4f4b77bb37077a4c4f039abd6a069287bfefcb8
      e5e49d7e
  8. Feb 25, 2021
    • Joshua C. Colp's avatar
      res_pjsip_session: Always produce offer on re-INVITE without SDP. · a81d07ea
      Joshua C. Colp authored
      When PJSIP receives a re-INVITE without an SDP offer the INVITE
      session library will first call the on_create_offer callback and
      if unavailable then use the active negotiated SDP as the offer.
      
      In some cases this would result in a different SDP then was
      previously used without an incremented SDP version number. The two
      known cases are:
      
      1. Sending an initial INVITE with a set of codecs and having the
      remote side answer with a subset. The active negotiated SDP would
      have the pruned list but would not have an incremented SDP version
      number.
      
      2. Using re-INVITE for unhold. We would modify the active negotiated
      SDP but would not increment the SDP version.
      
      To solve these, and potential other unknown cases, the on_create_offer
      callback has now been implemented which produces a fresh offer with
      incremented SDP version number. This better fits within the model
      provided by the INVITE session library.
      
      ASTERISK-28452
      
      Change-Id: I2d81048d54edcb80fe38fdbb954a86f0a58281a1
      a81d07ea
    • Jaco Kroon's avatar
      res_odbc_transaction: correctly initialise forcecommit value from DSN. · 6d2614be
      Jaco Kroon authored
      
      Also improve the in-process documentation to clarify that the value is
      initialised from the DSN and not default false, but that the DSN's value
      is default false if unset.
      
      ASTERISK-29311 #close
      
      Change-Id: I46e2379f7b0656034442bce77cb37ccd4e61098d
      Signed-off-by: default avatarJaco Kroon <jaco@uls.co.za>
      6d2614be
    • Ben Ford's avatar
      res_pjsip_session.c: Check topology on re-invite. · e1126ffc
      Ben Ford authored
      Removes an unnecessary check for the conditional that compares the
      stream topologies to see if they are equal to suppress re-invites. This
      was a problem when a Digium phone received an INVITE that offered codecs
      different than what it supported, causing Asterisk to send the
      re-invite.
      
      ASTERISK-29303
      
      Change-Id: I04dc91befb2387904e28a9aaeaa3bcdbcaa7fa63
      e1126ffc
    • Boris P. Korzun's avatar
      res_config_pgsql: Limit realtime_pgsql() to return one (no more) record. · b046e960
      Boris P. Korzun authored
      Added a SELECT 'LIMIT' clause to realtime_pgsql() and refactored the function.
      
      ASTERISK-29293 #close
      
      Change-Id: If5a6d4b1072ea2e6e89059b21139d554a74b34f5
      b046e960
  9. Feb 23, 2021
    • Ivan Poddubnyi's avatar
      app_queue: Fix conversion of complex extension states into device states · 4d8fc97e
      Ivan Poddubnyi authored
      Queue members using dialplan hints as a state interface must handle
      INUSE+RINGING hint as RINGINUSE devstate, and INUSE + ONHOLD as INUSE.
      
      ASTERISK-28369
      
      Change-Id: I127e06943d4b4f1afc518f9e396de77449992b9f
      4d8fc97e
    • Jaco Kroon's avatar
      app.h: Restore C++ compatibility for macro AST_DECLARE_APP_ARGS · 725eca3b
      Jaco Kroon authored
      
      This partially reverts commit 3d1bf3c5,
      specifically for app.h.
      
      This works with both gcc 9.3.0 and 10.2.0 now, both for C and C++ (as
      tested with external modules).
      
      ASTERISK-29287
      
      Change-Id: I5b9f02a9b290675682a1d13f1788fdda597c9fca
      Signed-off-by: default avatarJaco Kroon <jaco@uls.co.za>
      725eca3b
    • Alexander Traud's avatar
      chan_sip: Filter pass-through audio/video formats away, again. · 5894535f
      Alexander Traud authored
      Instead of looking for pass-through formats in the list of transcodable
      formats (which is going to find nothing), go through the result which
      is going to be the jointcaps of the tech_pvt of the channel. Finally,
      only with that list, ast_format_cap_remove(.) is going to succeed.
      
      This restores the behaviour of Asterisk 1.8. However, it does not fix
      ASTERISK_29282 because that issue report is about chan_sip and PJSIP.
      Here, only chan_sip is fixed because PJSIP does not even call
      ast_rtp_instance_available_formats -> ast_translate_available_format.
      
      Change-Id: Icade2366ac2b82935b95a9981678c987da2e8c34
      5894535f
    • Jaco Kroon's avatar
      func_odbc: Introduce minargs config and expose ARGC in addition to ARGn. · b0f349a3
      Jaco Kroon authored
      
      minargs enables enforcing of minimum count of arguments to pass to
      func_odbc, so if you're unconditionally using ARG1 through ARG4 then
      this should be set to 4.  func_odbc will generate an error in this case,
      so for example
      
      [FOO]
      minargs = 4
      
      and ODBC_FOO(a,b,c) in dialplan will now error out instead of using a
      potentially leaked ARG4 from Gosub().
      
      ARGC is needed if you're using optional argument, to verify whether or
      not an argument has been passed, else it's possible to use a leaked ARGn
      from Gosub (app_stack).  So now you can safely do
      ${IF($[${ARGC}>3]?${ARGV}:default value)} kind of thing.
      
      Change-Id: I6ca0b137d90b03f6aa9c496991f6cbf1518f6c24
      Signed-off-by: default avatarJaco Kroon <jaco@uls.co.za>
      b0f349a3
    • Sebastien Duthil's avatar
      app_mixmonitor: Add AMI events MixMonitorStart, -Stop and -Mute. · 6e695c86
      Sebastien Duthil authored
      ASTERISK-29244
      
      Change-Id: I1862d58264c2c8b5d8983272cb29734b184d67c5
      6e695c86
  10. Feb 18, 2021
    • Kevin Harwell's avatar
      AST-2021-002: Remote crash possible when negotiating T.38 · 5e998d8b
      Kevin Harwell authored
      When an endpoint requests to re-negotiate for fax and the incoming
      re-invite is received prior to Asterisk sending out the 200 OK for
      the initial invite the re-invite gets delayed. When Asterisk does
      finally send the re-inivite the SDP includes streams for both audio
      and T.38.
      
      This happens because when the pending topology and active topologies
      differ (pending stream is not in the active) in the delayed scenario
      the pending stream is appended to the active topology. However, in
      the fax case the pending stream should replace the active.
      
      This patch makes it so when a delay occurs during fax negotiation,
      to or from, the audio stream is replaced by the T.38 stream, or vice
      versa instead of being appended.
      
      Further when Asterisk sent the re-invite with both audio and T.38,
      and the endpoint responded with a declined T.38 stream then Asterisk
      would crash when attempting to change the T.38 state.
      
      This patch also puts in a check that ensures the media state has a
      valid fax session (associated udptl object) before changing the
      T.38 state internally.
      
      ASTERISK-29203 #close
      
      Change-Id: I407f4fa58651255b6a9030d34fd6578cf65ccf09
      5e998d8b
    • Alexander Traud's avatar
      rtp: Enable srtp replay protection · 389b8b07
      Alexander Traud authored
      Add option "srtpreplayprotection" rtp.conf to enable srtp
      replay protection.
      
      ASTERISK-29260
      Reported by: Alexander Traud
      
      Change-Id: I5cd346e3c6b6812039d1901aa4b7be688173b458
      389b8b07
    • Ivan Poddubnyi's avatar
      res_pjsip_diversion: Fix adding more than one histinfo to Supported · 7d15655f
      Ivan Poddubnyi authored
      New responses sent within a PJSIP sessions are based on those that were
      sent before. Therefore, adding/modifying a header once causes it to be
      sent on all responses that follow.
      
      Sending 181 Call Is Being Forwarded many times first adds "histinfo"
      duplicated more and more, and eventually overflows past the array
      boundary.
      
      This commit adds a check preventing adding "histinfo" more than once,
      and skipping it if there is no more space in the header.
      
      Similar overflow situations can also occur in res_pjsip_path and
      res_pjsip_outbound_registration so those were also modified to
      check the bounds and suppress duplicate Supported values.
      
      ASTERISK-29227
      Reported by: Ivan Poddubny
      
      Change-Id: Id43704a1f1a0293e35cc7f844026f0b04f2ac322
      7d15655f
    • Sean Bright's avatar
      res_rtp_asterisk.c: Fix signed mismatch that leads to overflow · e7b13df3
      Sean Bright authored
      ASTERISK-29205 #close
      
      Change-Id: Ib7aa65644e8df76e2378d7613ee7cf751b9d0bea
      e7b13df3
    • Joshua C. Colp's avatar
      pjsip: Make modify_local_offer2 tolerate previous failed SDP. · 492945ac
      Joshua C. Colp authored
      If a remote side is broken and sends an SDP that can not be
      negotiated the call will be torn down but there is a window
      where a second 183 Session Progress or 200 OK that is forked
      can be received that also attempts to negotiate SDP. Since
      the code marked the SDP negotiation as being done and complete
      prior to this it assumes that there is an active local and remote
      SDP which it can modify, while in fact there is not as the SDP
      did not successfully negotiate. Since there is no local or remote
      SDP a crash occurs.
      
      This patch changes the pjmedia_sdp_neg_modify_local_offer2
      function to no longer assume that a previous SDP negotiation
      was successful.
      
      ASTERISK-29196
      
      Change-Id: I22de45916d3b05fdc2a67da92b3a38271ee5949e
      492945ac
  11. Feb 17, 2021
    • George Joseph's avatar
      res_pjsip_refer: Always serialize calls to refer_progress_notify · 15b40806
      George Joseph authored
      refer_progress_notify wasn't always being called from the progress
      serializer.  This could allow clearing notification->progress->sub
      in one thread while another was trying to use it.
      
      * Instances where refer_progress_notify was being called in-line,
        have been changed to use ast_sip_push_task().
      
      Change-Id: Idcf1934c4e873f2c82e2d106f8d9f040caf9fa1e
      15b40806
  12. Feb 16, 2021
    • Ben Ford's avatar
      core_unreal: Fix T.38 faxing when using local channels. · 00b229c6
      Ben Ford authored
      After some changes to streams and topologies, receiving fax through
      local channels stopped working. This change adds a stream topology with
      a stream of type IMAGE to the local channel pair and allows fax to be
      received.
      
      ASTERISK-29035 #close
      
      Change-Id: Id103cc5c9295295d8e68d5628e76220f8f17e9fb
      00b229c6
  13. Feb 12, 2021
    • Boris P. Korzun's avatar
      format_wav: Support of MIME-type for wav16 · a96eb6de
      Boris P. Korzun authored
      Provided a support of a MIME-type for wav16. Added new MIME-type
      for classic wav.
      
      ASTERISK-29275 #close
      
      Change-Id: I749bda287ba1ab20c1e0af5e4c0153817d47873b
      a96eb6de
    • Alexander Traud's avatar
      chan_sip: Allow [peer] without audio (text+video). · 1f77c33c
      Alexander Traud authored
      Two previous commits, 620d9f47 and 6d980de2, allow to set up a call
      without audio, again. That was introduced originally with commit f04d5fb8
      but changed and broke over time. The original commit missed one
      scenario: A [peer] section in sip.conf, which does not allow audio at
      all. In that case, chan_sip rejected the call, although even when the
      requester offered no audio. Now, chan_sip does not check whether there
      is no audio format but checks whether there is no format in general. In
      other words, if there is at least one format to offer, the call succeeds.
      
      However, to prevent calls with no-audio, chan_sip still rejects calls
      when both call parties (caller = requester of the call *and* callee =
      [peer] section in sip.conf) included audio. In such a case, it is
      expected that the call should have audio.
      
      ASTERISK-29280
      
      Change-Id: I0fb74faf51ef22a60c10b467df6a4d1c1943b73e
      1f77c33c
  14. Feb 09, 2021
    • George Joseph's avatar
      chan_iax2.c: Require secret and auth method if encryption is enabled · 91b07787
      George Joseph authored
      If there's no secret specified for an iax2 peer and there's no secret
      specified in the dial string, Asterisk will crash if the auth method
      requested by the peer is MD5 or plaintext.  You also couldn't specify
      a default auth method in the [general] section of iax.conf so if you
      don't have static peers defined and just use the dial string, Asterisk
      will still crash even if you have a secret specified in the dial string.
      
      * Added logic to iax2_call() and authenticate_reply() to print
        a warning and hanhup the call if encryption is requested and
        there's no secret or auth method.  This prevents the crash.
      
      * Added the ability to specify a default "auth" in the [general]
        section of iax.conf.
      
      ASTERISK-29624
      Reported by: N A
      
      Change-Id: I5928e16137581f7d383fcc7fa04ad96c919e6254
      91b07787
  15. Feb 04, 2021
Loading