Skip to content
Snippets Groups Projects
  1. May 11, 2020
  2. May 08, 2020
    • Pirmin Walthert's avatar
      app.c: make sure that no non-async-signal-safe syscalls are used after · 6b2d9451
      Pirmin Walthert authored
      fork before exec
      
      Posix does only allow async-signal-safe syscalls after fork before exec.
      As asterisk ignores this, functions like TrySystem or System sometimes
      end up in a deadlocked child process. The patch prevents the use of
      non-async-signal-safe syscalls.
      
      ASTERISK-28776
      
      Change-Id: Idc76365c0592ee3f3b3bd72a4f48f7a098978e8e
      6b2d9451
  3. May 06, 2020
    • George Joseph's avatar
      streams: Fix one memory leak and one formats ref issue · 7fbfbe7d
      George Joseph authored
      ast_stream_topology_create_from_format_cap() was setting the
      stream->formats directly but not freeing the default formats.  This
      causes a memory leak.
      
      * ast_stream_topology_create_from_format_cap() now calls
        ast_stream_set_formats() which properly cleans up the existing
        stream formats.
      
      When cloning a stream, the source stream's format caps _pointer_ is
      copied to the new stream and it's reference count bumped.  If
      either stream is set to "removed", this will cause _both_ streams
      to have their format caps cleared.
      
      * ast_stream_clone() now creates a new format caps object and copies
        the formats from the source stream instead of just copying the
        pointer.
      
      ASTERISK-28870
      
      Change-Id: If697d81c3658eb7baeea6dab413b13423938fb53
      7fbfbe7d
    • Nathan Bruning's avatar
      app_queue: track masquerades in app_queue to avoid leaked stasis subscriptions · f217fcdc
      Nathan Bruning authored
      Add a new "masquarade" channel event, and use it in app_queue to track unique id's.
      
      Testcase is submitted as https://gerrit.asterisk.org/c/testsuite/+/14210
      
      ASTERISK-28829 #close
      ASTERISK-25844 #close
      
      Change-Id: Ifc5f9f9fd70903f3c6e49738d3bc632b085d2df6
      f217fcdc
  4. May 05, 2020
  5. Apr 29, 2020
    • Alexander Traud's avatar
      core_local: Local calls are always secure. · 29070b61
      Alexander Traud authored
      In a Dialplan, the channel drivers 'chan_sip' and 'chan_iax2' support
      the channel items 'secure_bridge_media' and 'secure_bridge_signaling'.
      That way, a channel can be forced to use encryption even if not
      specified in its configuration.
      
      However, when the Local Proxy kicks in, for example, in case of a
      forwarding (SIP status 302), Local Proxy stated it does not know those
      items. Consequently, such a call could not be proxied how clever your
      Dialplan was. Because local calls within Asterisk are always secure,
      Local Proxy accepts such a request now.
      
      ASTERISK-22920
      
      Change-Id: I4c143bb70f686790953cc04c5a4b810bbb03636c
      29070b61
  6. Apr 28, 2020
    • Guido Falsi's avatar
      core/dns: Add system include required on FreeBSD · 97494d89
      Guido Falsi authored
      While testing the latest RC on FreeBSD I noticed this new file fails to build. On FreeBSD inlcuding resolv.h requires sockaddr_in to be defined, and it's defined in netinet/in.h. So I added this include.
      
      ASTERISK-28853 #close
      
      Change-Id: I6997daf3956e6eb70ab6cb358628d162fad80079
      97494d89
  7. Apr 23, 2020
    • Joshua C. Colp's avatar
      stream: Enforce formats immutability and ensure formats exist. · 1c5e6858
      Joshua C. Colp authored
      Some places in Asterisk did not treat the formats on a stream
      as immutable when they are.
      
      The ast_stream_get_formats function is now const to enforce this
      and parts of Asterisk have been updated to take this into account.
      Some violations of this were also fixed along the way.
      
      An additional minor tweak is that streams are now allocated with
      an empty format capabilities structure removing the need in various
      places to check that one is present on the stream.
      
      ASTERISK-28846
      
      Change-Id: I32f29715330db4ff48edd6f1f359090458a9bfbe
      1c5e6858
  8. Apr 20, 2020
    • Joshua C. Colp's avatar
      confbridge: Add support for disabling text messaging. · 6cfc6ff5
      Joshua C. Colp authored
      When in a conference bridge it may be necessary to have
      text messages disabled for specific participants or for
      all. This change adds a configuration option, "text_messaging",
      which can be used to enable or disable this on the
      user profile. By default existing behavior is preserved
      as it defaults to "yes".
      
      ASTERISK-28841
      
      Change-Id: I30b5d9ae6f4803881d1ed9300590d405e392bc13
      6cfc6ff5
  9. Apr 15, 2020
    • Pirmin Walthert's avatar
      res_rtp_asterisk: Free payload when error on insertion to data buffer · ca032d1e
      Pirmin Walthert authored
      When the ast_data_buffer_put rejects to add a packet, for example because
      the buffer already contains a packet with the same sequence number, the
      payload will never be freed, resulting in a memory leak.
      
      The data buffer will now return an error if this situation occurs
      allowing the caller to free the payload. The res_rtp_asterisk module
      has also been updated to do this.
      
      ASTERISK-28826
      
      Change-Id: Ie6c49495d1c921d5f997651c7d0f79646f095cf1
      ca032d1e
  10. Apr 14, 2020
  11. Apr 06, 2020
    • Jaco Kroon's avatar
      main/backtrace: binutils-2.34 fix. · c5f3836b
      Jaco Kroon authored
      My tester missed this one previously, have confirmed a positive build
      this time round.
      
      Change-Id: Id06853375954a200f03f9a1b9c97fe0b10d31fbf
      c5f3836b
    • George Joseph's avatar
      codec_negotiation: Implement outgoing_call_offer_pref · 2ee45595
      George Joseph authored
      Based on this new endpoint setting, a joint list of preferred codecs
      between those received from the Asterisk core (remote), and those
      specified in the endpoint's "allow" parameter (local) is created and
      is used to create the outgoing SDP offer.
      
      * Add outgoing_call_offer_pref to pjsip_configuration (endpoint)
      
      * Add "call_direction" to res_pjsip_session.
      
      * Update pjsip_session_caps.c to make the functions more generic
        so they could be used for both incoming and outgoing.
      
      * Update ast_sip_session_create_outgoing to create the
        pending_media_state->topology with the results of
        ast_sip_session_create_joint_call_stream().
      
      * The endpoint "preferred_codec_only" option now automatically sets
        AST_SIP_CALL_CODEC_PREF_FIRST in incoming_call_offer_pref.
      
      * A helper function ast_stream_get_format_count() was added to
        streams to return the current count of formats.
      
      ASTERISK-28777
      
      Change-Id: Id4ec0b4a906c2ae5885bf947f101c59059935437
      2ee45595
  12. Mar 31, 2020
    • Kevin Harwell's avatar
      channel: write to a stream on multi-frame writes · 3c345ec5
      Kevin Harwell authored
      If a frame handling routine returns a list of frames (vs. a single frame)
      those frames are never passed to a tech's write_stream handler even if one is
      available. For instance, if a codec translation occurred and that codec
      returned multiple frames then those particular frames were always only sent
      to the tech's "write" handler. If that tech (pjsip for example) was stream
      capable then those frames were essentially ignored. Thus resulting in bad
      audio.
      
      This patch makes it so the "write_stream" handler is appropriately called
      for all cases, and for all frames if available.
      
      ASTERISK-28795 #close
      
      Change-Id: I868faea0b73a07ed5a32c2b05bb9cf4b586f739d
      3c345ec5
    • sungtae kim's avatar
      dial.c: Removed dial string 80 character limitation · dbddb672
      sungtae kim authored
      The dial application had 80 characters of destination length
      limitation. But this limitation causes unexpected dial string
      cut if the dial string is long.
      
      Removed unnecessary limited buffer to support longer dial
      destination.
      
      ASTERISK-27946
      
      Change-Id: I72c8f0319a4b47e8180817a66a7e9bde063cb330
      dbddb672
    • Jaco Kroon's avatar
      acl: implement a centralized ACL output mechanism for HAs and ACLs. · d32e559e
      Jaco Kroon authored
      named_acl.c (which is really a named_ha) now uses ast_ha_output.
      
      I've also updated main/manager.c to output the actual ACL on "manager
      show user <username>" if one is set.  If this works then we can add
      similar to other modules as required.
      
      Change-Id: I0ec9876a90dddd379c80ec078d48e3ee6991eb0f
      d32e559e
  13. Mar 17, 2020
    • Jaco Kroon's avatar
      Update main/backtrace.c to deal with changes in binutils 2.34. · 2ad64e97
      Jaco Kroon authored
      binutils 2.34 merged this commit:
      
      https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;\
      	h=fd3619828e94a24a92cddec42cbc0ab33352eeb4
      
      Which effectively does things like:
      
      -#define bfd_section_size(bfd, ptr) ((ptr)->size)
      -#define bfd_get_section_size(ptr) ((ptr)->size)
      
      +#define bfd_section_size(sec) ((sec)->size)
      
      So in order to remain backwards compatible we need to detect this API
      change, and adjust accordingly.  The simplest is to notice that the
      bfd_get_section_size and bfd_get_section_vma MACROs are no longer
      defined, and define then onto the new API.  The alternative is to litter
      the code with a number of #ifdef #else #endif splatters right through
      the code.
      
      Change-Id: I3efe0f8e8f3e338d16fcbc2b26a505367b6e172f
      2ad64e97
  14. Mar 13, 2020
    • Sean Bright's avatar
      dns_txt: Add TXT record parsing support · d68f940f
      Sean Bright authored
      Change-Id: Ie0eca23b8e6f4c7d9846b6013d79099314d90ef5
      d68f940f
    • Joshua C. Colp's avatar
      audiohook: Don't allow audiohooks to attach to hung up channels. · 98d10d0a
      Joshua C. Colp authored
      Given a scenario where MixMonitor was initiated over AMI it
      was possible for the channel and MixMonitor thread to remain
      alive past hang up of the channel. This scenario required
      the AMI initiated MixMonitor to retrieve the channel, a
      hangup to occur on the channel in another thread, and then
      for MixMonitor to actually start. If this occurred the
      MixMonitor thread would remain alive indefinitely and
      the channel reference would remain.
      
      This change ensures that audiohooks are never able to
      be attached to channels that have been hung up. An
      additional fix has also been done in app_mixmonitor to
      properly release the channel reference if this occurs.
      
      ASTERISK-28780
      
      Change-Id: I8044c06daa06f0f16607788c596f55623be26f58
      98d10d0a
  15. Mar 06, 2020
    • Sean Bright's avatar
      enum.c: Add support for regular expression flag in NAPTR record · 517224ce
      Sean Bright authored
      A regular expression in a NAPTR response record can have a trailing
      'i' flag to indicate that the expression should be evaluated in a
      case-insensitive way. We were not checking for that flag which caused
      the record parsing to fail on otherwise valid input.
      
      Although this change will initially go into Asterisk 13, 16, and 17,
      it is my intention to replace the majority of this code in 16 and up -
      including this fix - by changing enum.c to consume the new DNS API
      which duplicates most of this logic already. Asterisk 13 doesn't have
      the DNS API, so this fix will be as good as it gets.
      
      ASTERISK-26711 #close
      Reported by: Vitold
      
      Change-Id: I33943a5b3e7539c6dca3a5079982ee15a08186f0
      517224ce
  16. Mar 04, 2020
    • Sean Bright's avatar
      enum.c: Make ast_get_txt() actually do something. · ab63f0cd
      Sean Bright authored
      The ast_get_txt() API function (and by extension, the TXTCIDNAME
      dialplan function) were broken in
      65b83815 such that we would never
      actually make a DNS TXT query as described.
      
      This patch restores the documented behavior.
      
      ASTERISK-19460 #close
      Reported by: George Joseph
      
      Change-Id: I1b19aea711488cb1ecd63843cddce05010e39376
      ab63f0cd
  17. Mar 02, 2020
    • Kevin Harwell's avatar
      message & stasis/messaging: make text message variables work in ARI · a715cf5a
      Kevin Harwell authored
      When a text message was received any associated variable was not written to
      the ARI TextMessageReceived event. This occurred because Asterisk only wrote
      out "send" variables. However, even those "send" variables would fail ARI
      validation due to a TextMessageVariable formatting bug.
      
      Since it seems the TextMessageReceived event has never been able to include
      actual variables it was decided to remove the TextMessageVariable object type
      from ARI, and simply return a JSON object of key/value pairs for variables.
      This aligns more with how the ARI sendMessage handles variables, and other
      places in ARI.
      
      ASTERISK-28755 #close
      
      Change-Id: Ia6051c01a53b30cf7edef84c27df4ed4479b8b6f
      a715cf5a
  18. Feb 24, 2020
  19. Feb 20, 2020
    • Joshua C. Colp's avatar
      pjsip: Update ACLs on named ACL changes. · d6712790
      Joshua C. Colp authored
      This change extends the Sorcery API to allow a wizard to be
      told to explicitly reload objects or a specific object type
      even if the wizard believes that nothing has changed.
      
      This has been leveraged by res_pjsip and res_pjsip_acl to
      reload endpoints and PJSIP ACLs when a named ACL changes.
      
      ASTERISK-28697
      
      Change-Id: Ib8fee9bd9dd490db635132c479127a4114c1ca0b
      d6712790
  20. Feb 19, 2020
  21. Feb 18, 2020
    • Joshua C. Colp's avatar
      bridging: Add better support for adding/removing streams. · 5a5be92b
      Joshua C. Colp authored
      This change adds support to bridge_softmix to allow the addition
      and removal of additional video source streams. When such a change
      occurs each participant is renegotiated as needed to reflect the
      update. If another video source is added then each participant
      gets another source. If a video source is removed then it is
      removed from each participant. This functionality allows you to
      have both your webcam and screenshare providing video if you
      desire, or even more streams. Mapping has been changed to use
      the topology index on the source channel as a unique identifier
      for outgoing participant streams, this will never change and
      provides an easy way to establish the mapping.
      
      The bridge_simple and bridge_native_rtp modules have also been
      updated to renegotiate when the stream topology of a party changes
      allowing the same behavior to occur as added to bridge_softmix.
      If a screen share is added then the opposite party is renegotiated.
      If that screen share is removed then the opposite party is
      renegotiated again.
      
      Some additional fixes are also included in here. Stream state is
      now conveyed in SDP so sendonly/recvonly/inactive streams can
      be requested. Removed streams now also remove previous state
      from themselves so consumers don't get confused.
      
      ASTERISK-28733
      
      Change-Id: I93f41fb41b85646bef71408111c17ccea30cb0c5
      5a5be92b
  22. Feb 17, 2020
    • Sean Bright's avatar
      app_mixmonitor: Set MIXMONITOR_FILENAME to correct value when wav49 is used · ddfb60ac
      Sean Bright authored
      When opening a file for writing, Asterisk silently converts filenames
      ending with 'wav49' to 'WAV.' We aren't taking that in to account when
      setting the MIXMONITOR_FILENAME variable in MixMonitor.
      
      * If the user wants to write to a wav49 file, make sure that it is
        reflected properly in MIXMONITOR_FILENAME.
      
      * Add a note to the documentation describing this behavior.
      
      * Add a note in main/file.c indicating that app_mixmonitor needs to be
        changed if the logic in build_filename was changed.
      
      ASTERISK-24798 #close
      Reported by: xrobau
      
      Change-Id: I384691ce624eb55c80a125b9ca206d2d691c574c
      ddfb60ac
  23. Feb 15, 2020
  24. Feb 03, 2020
    • George Joseph's avatar
      message.c: Add option to suppress the Message channel AMI and ARI events · b76ab5e5
      George Joseph authored
      In order to reduce the amount of AMI and ARI events generated,
      the global "Message/ast_msg_queue" channel can be set to suppress
      it's normal channel housekeeping events such as "Newexten",
      "VarSet", etc. This can greatly reduce load on the manager
      and ARI applications when the Digium Phone Module for Asterisk
      is in use.  To enable, set "hide_messaging_ami_events" in
      asterisk.conf to "yes"  In Asterisk versions <18, the default
      is "no" preserving existing behavior.  Beginning with
      Asterisk 18, the option will default to "yes".
      
      NOTE:  This change does not affect UserEvents or the ARI
      TextMessageReceived events.
      
      * Added the "hide_messaging_ami_events" option to asterisk.conf.
      
      * Changed message.c to set the AST_CHAN_TP_INTERNAL property on
        the "Message/ast_msg_queue" channel if the option is set in
        asterisk.conf.  This suppresses the reporting of the events.
      
      Change-Id: Ia2e3516d43f4e0df994fc6598565d6bba2d7018b
      b76ab5e5
  25. Jan 22, 2020
    • George Joseph's avatar
      cdr.c: Set event time on party b when leaving a parking bridge · 6818c3d1
      George Joseph authored
      When Alice calls Bob and Bob does a blind transfer to Charlie,
      Bob's bridge leave event generates a finalize on both the party_a
      and party_b CDRs but while the party_a CDR has the correct end time
      set from the event time, party_b's leg did not. This caused that
      CDR's end time to be equal to the answered time and resulted in a
      billsec of 0.
      
      * We now pass the bridge leave message event time to
      cdr_object_party_b_left_bridge_cb() and set it on that CDR before
      calling cdr_object_finalize() on it.
      
      NOTE:  This issue affected transfers using chan_sip most of the
      time but also occasionally affected chan_pjsip probably due to
      message timing.
      
      ASTERISK-28677
      Reported by: Maciej Michno
      
      Change-Id: I790720f1e7326f9b8ce8293028743b0ef0fb2cca
      6818c3d1
    • Sean Bright's avatar
      http: Add ability to disable /httpstatus URI · 0dce6f74
      Sean Bright authored
      Add a new configuration option 'enable_status' which allows the
      /httpstatus URI handler to be administratively disabled.
      
      We also no longer unconditionally register the /static and /httpstatus
      URI handlers, but instead do it based upon configuration.
      
      Behavior change: If enable_static was turned off, the URI handler was
      still installed but returned a 403 when it was accessed. Because we
      now register/unregister the URI handlers as appropriate, if the
      /static URI is disabled we will return a 404 instead.
      
      Additionally:
      
      * Change 'enablestatic' to 'enable_static' but keep the former for
        backwards compatibility.
      * Improve some internal variable names
      
      ASTERISK-28710 #close
      
      Change-Id: I647510f796473793b1d3ce1beb32659813be69e1
      0dce6f74
  26. Jan 20, 2020
  27. Jan 16, 2020
  28. Jan 08, 2020
    • Sean Bright's avatar
      res_pjsip_endpoint_identifier_ip.c: Add port matching support · 312abaa1
      Sean Bright authored
      Adds source port matching support when IP matching is used:
      
        [example]
        type = identify
        match = 1.2.3.4:5060/32, 1.2.3.4:6000/32, asterisk.org:4444
      
      If the IP matches but the source port does not, we reject and search for
      alternatives. SRV lookups are still performed if enabled (srv_lookups = yes),
      unless the configured FQDN includes a port number in which case just a host
      lookup is performed.
      
      ASTERISK-28639 #close
      Reported by: Mitch Claborn
      
      Change-Id: I256d5bd5d478b95f526e2f80ace31b690eebba92
      312abaa1
  29. Jan 06, 2020
    • George Joseph's avatar
      stasis.c: Use correct topic name in stasis_topic_pool_delete_topic · 1c9ddad4
      George Joseph authored
      When a topic is created for an object, its name is only
      <object>:<uniqueid>
      For example:
      bridge:cb68b3a8-fce7-4738-8a17-d7847562f020
      
      When a topic is added to a pool, its name has the pool's topic
      name prepended.  For example:
      bridge:all/bridge:cb68b3a8-fce7-4738-8a17-d7847562f020
      
      The topic_pool_entry's name however, is only what was passed
      in to stasis_topic_pool_get_topic which is
      bridge:cb68b3a8-fce7-4738-8a17-d7847562f020
      That's actually correct because the entry is qualified by the
      pool that's in.
      
      When you're ready to delete the entry from the pool, you retrieve
      the tropic name from the object but since it now has the pool's
      topic name prepended, it won't be found in the pool container.
      
      Fix:
      
      * Modified stasis_topic_pool_delete_topic() to skip past the
      pool topic's name, if it was prepended to the topic name,
      before searching the container for a pool entry.
      
      ASTERISK-28633
      Reported by: Joeran Vinzens
      
      Change-Id: I4396aa69dd83e4ab84c5b91b39293cfdbcf483e6
      1c9ddad4
    • Richard Mudgett's avatar
      features.c: Make Bridge application tolerate unspecified channel. · 0376f2bb
      Richard Mudgett authored
      The Bridge application was inconsistent if the channel to bridge with is
      not specified.  If no parameters are given then a warning is issued and
      the current channel is hung up.  If options are given but no channel is
      specified then a warning is issued and the current channel is not hung up.
      
      * Made the Bridge application give a verbose message instead of a warning
      if the channel to bridge with is not specified and made not hang up the
      current channel.  As a result dialplan no longer needs to check if a
      channel name is passed before calling Bridge and simply needs to check the
      BRIDGERESULT channel variable instead.  This is something you likely want
      your dialplan to do anyway.
      
      * Fixed up L() option warning message.  It is up to the caller to
      determine if the channel is hung up because of the warning.  Dial() hangs
      up the current channel while Bridge() does not.
      
      Change-Id: I44349a8dc3912397f28852777de04f19e7bb9c73
      0376f2bb
  30. Jan 02, 2020
    • Sean Bright's avatar
      websocket: Consider pending SSL data when waiting for socket input · 87110c1b
      Sean Bright authored
      When TLS is in use, checking the readiness of the underlying FD is insufficient
      for determining if there is data available to be read. So before polling the
      FD, check if there is any buffered data in the TLS layer and use that first.
      
      ASTERISK-28562 #close
      Reported by: Robert Sutton
      
      Change-Id: I95fcb3e2004700d5cf8e5ee04943f0115b15e10d
      87110c1b
  31. Dec 27, 2019
Loading