Skip to content
Snippets Groups Projects
  1. Mar 31, 2020
    • 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
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. Feb 24, 2020
  8. 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
  9. Feb 19, 2020
  10. 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
  11. 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
  12. Feb 15, 2020
  13. 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
  14. 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
  15. Jan 20, 2020
  16. Jan 16, 2020
  17. 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
  18. 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
  19. 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
  20. Dec 27, 2019
  21. Dec 19, 2019
    • Sean Bright's avatar
      config.c: Skip UTF-8 BOMs if present when reading config files · 40b5cf8f
      Sean Bright authored
      ASTERISK-28667 #close
      
      Change-Id: I4767ed365c98f3e1587b7653321048a31d8a53b2
      40b5cf8f
    • Kevin Reeves's avatar
      main/file.c: Limit media cache usage to remote files. · c626ccec
      Kevin Reeves authored
      
      When testing for the existance of a file, the media cache is searched even if
      the file has no chance of being in it.  This can cause performance issues
      as the media cache size increases.
      
      As a result, calls to applications like Read and Playback using local files
      must scan through the media cache before playing.  Under load and with a
      large cache, this can delay the playback of those files.
      
      This patch updates the function that checks for the existance of a file to
      only consult the media cache database if the requested file is a remote path.
      It introduces a new is_remote_path() function in main/file.c.
      
      ASTERISK-28625  #close
      Reported-by: default avatar <kevin@phoneburner.com>
      
      Change-Id: If91137493732d9034dafa381c081c69274a7dcc9
      c626ccec
  22. Dec 16, 2019
    • Joshua C. Colp's avatar
      confbridge: Add support for specifying maximum sample rate. · 89b7144f
      Joshua C. Colp authored
      ConfBridge has the ability to move between different sample
      rates for mixing the conference bridge. Up until now there has
      only been the ability to set the conference bridge to mix at
      a specific sample rate, or to let it move between sample rates
      as necessary. This change adds the ability to configure a
      conference bridge with a maximum sample rate so it can move
      between sample rates but only up to the configured maximum.
      
      ASTERISK-28658
      
      Change-Id: Idff80896ccfb8a58a816e4ce9ac4ebde785963ee
      89b7144f
  23. Dec 12, 2019
  24. Dec 02, 2019
    • George Joseph's avatar
      channel.c: Resolve issue with receiving SIP INFO packets for DTMF · fd823225
      George Joseph authored
      The problem is essentially the same as in ASTERISK~28245. Besides
      the direct media scenario we have an additional scenario where a
      special client is involved. This device mutes audio by default in
      transmit direction (no rtp frames) and activates audio only by a
      foot switch. In this situation dtmf input (pin for conferences,
      transfer features codes , etc) using SIP INFO mode is not
      understood properly especially when SIP INFO messages are sent
      quickly.
      
      This patch ensures that SIP INFO frames are properly queued and
      processed in the above scenario. The patch also corrects situations
      where successive dtmf events are received quicker than the
      signalled event duration (plus minimum gap/pause) allows, i.e. DTMF
      events have to be buffered in the ast channel read queue and
      emulation has to be processed asynchronously at slower speed.
      
      Reported by: Thomas Arimont
      patches:
        trigger_dtmf_emulation.patch submitted by Thomas Arimont (license 5525)
      
      Change-Id: I309bf61dd065c9978c8e48f5b9a936ab47de64c2
      fd823225
  25. Nov 22, 2019
    • Sean Bright's avatar
      media_cache.c: Various CLI improvements · 91c3b5b0
      Sean Bright authored
      * Use ast_cli_completion_add() to improve performance when large number of
        cached items are present.
      
      * Only complete one URI for commands that only accept a single URI.
      
      * Change command documentation to wrap at 80 characters to improve
        readability.
      
      Change-Id: Iedb0a2c3541e49561bc231dca2dcc0ebd8612902
      91c3b5b0
  26. Nov 21, 2019
    • George Joseph's avatar
      manager.c: Prevent the Originate action from running the Originate app · 7e3a6e15
      George Joseph authored
      If an AMI user without the "system" authorization calls the
      Originate AMI command with the Originate application,
      the second Originate could run the "System" command.
      
      Action: Originate
      Channel: Local/1111
      Application: Originate
      Data: Local/2222,app,System,touch /tmp/owned
      
      If the "system" authorization isn't set, we now block the
      Originate app as well as the System, Exec, etc. apps.
      
      ASTERISK-28580
      Reported by: Eliel Sardañons
      
      Change-Id: Ic4c9dedc34c426f03c8c14fce334a71386d8a5fa
      7e3a6e15
  27. Nov 18, 2019
    • Alexei Gradinari's avatar
      serializer: set high/low alert levels on whole pool · f2d5ed54
      Alexei Gradinari authored
      The current code sets alert levels starting from index 1.
      Need to set on whole pool starting from index 0.
      
      Change-Id: I5decbb43160954fb9a512f04302637fc666b6f5d
      f2d5ed54
    • Kevin Harwell's avatar
      various files - fix some alerts raised by lgtm code analysis · bdd785d3
      Kevin Harwell authored
      This patch fixes several issues reported by the lgtm code analysis tool:
      
      https://lgtm.com/projects/g/asterisk/asterisk
      
      Not all reported issues were addressed in this patch. This patch mostly fixes
      confirmed reported errors, potential problematic code points, and a few other
      "low hanging" warnings or recommendations found in core supported modules.
      These include, but are not limited to the following:
      
      * innapropriate stack allocation in loops
      * buffer overflows
      * variable declaration "hiding" another variable declaration
      * comparisons results that are always the same
      * ambiguously signed bit-field members
      * missing header guards
      
      Change-Id: Id4a881686605d26c94ab5409bc70fcc21efacc25
      bdd785d3
  28. Nov 08, 2019
    • Corey Farrell's avatar
      core: Improve MALLOC_DEBUG for frames. · 8a1f30af
      Corey Farrell authored
      * Pass caller information to frame allocation functions.
      * Disable caching as it interfers with MALLOC_DEBUG reporting.
      * Stop using ast_calloc_cache.
      
      Change-Id: Id343cd80a3db941d2daefde2a060750fea8cd260
      Unverified
      8a1f30af
  29. Oct 09, 2019
    • Kevin Harwell's avatar
      pbx: deadlock when outgoing dialed channel hangs up too quickly · bf6f2738
      Kevin Harwell authored
      Here's the basic scenario that occurred when executing an AMI fast originate
      while at the same time something else locks the channels container, and also
      wants a lock on the dialed channel:
      
      1. pbx_outgoing_attempt obtains a lock on a dialed channel
      2. concurrently another thread obtains a lock on the channels container, and
         subsequently requests a lock on the dialed channel. It waits on #1. For
         instance, "core show channel <dialed channel"
      3. the outgoing call does not fail, but ends before the pbx_outgoing_attempt
         function exits
      4. pbx_outgoing_attempt function exits, the outgoing structure destructs, and
         attempts to hang up the dialed channel
      5. hang up tries to obtain the channels container lock, but can't due to #2.
      6. Asterisk is deadlocked.
      
      The solution was to allow the pbx_outgoing_exec function to "steal" ownership
      of the dialed channel, and handle hanging it up. The channel now is either hung
      up prior to it being potentially locked by the initiating thread, or if locked
      the hang up takes place in a different thread, thus alleviating the deadlock.
      
      ASTERISK-28561
      patches:
        iliketrains.diff submitted by Joshua Colp (license 5000)
      
      Change-Id: I51b42b92dde8f2215b69bb509e28667ee3a3853a
      bf6f2738
  30. Oct 07, 2019
    • Kevin Harwell's avatar
      serializer: move/add asterisk serializer pool functionality · c0efe19c
      Kevin Harwell authored
      Serializer pools have previously existed in Asterisk. However, for the most
      part the code has been duplicated across modules. This patch abstracts the
      code into an 'ast_serializer_pool' object. As well the code is now centralized
      in serializer.c/h.
      
      In addition serializer pools can now optionally be monitored by a shutdown
      group. This will prevent the pool from being destroyed until all serializers
      have completed.
      
      Change-Id: Ib1e906144b90ffd4d5ed9826f0b719ca9c6d2971
      c0efe19c
  31. Oct 01, 2019
    • Joshua Colp's avatar
      stasis: Pass bumped topic_all reference to proxy_dtor. · 729b286d
      Joshua Colp authored
      This avoids use of the global variable and ensures topic_all remains
      active until all topics are freed.
      
      ASTERISK-28553
      patches:
        ASTERISK-28553.patch by coreyfarrell (license 5909)
      
      Change-Id: I9a8cd8977f3c3a6aa00783f8336d2cfb9c2820f1
      729b286d
  32. Sep 26, 2019
    • Sean Bright's avatar
      pbx: Prevent Realtime switch crash on invalid priority · 702019fc
      Sean Bright authored
      pbx_extension_helper takes two 'context' arguments. One (con) is a
      pointer directly to a 'struct ast_context' and the other (context) is
      the name of the context. In all cases, one of these arguments is NULL
      and the other is non-NULL.
      
      Functions that are ultimately called by pbx_extension_helper expect that
      'context' will be non-NULL, so we set it unconditionally on entry into
      this function.
      
      ASTERISK-28534 #close
      
      Change-Id: Ifbbc5e71440afd80efd441f7a9d72e8b10b6f47d
      702019fc
  33. Sep 25, 2019
Loading