Skip to content
Snippets Groups Projects
  1. Sep 25, 2015
  2. Sep 24, 2015
    • Mark Michelson's avatar
      logger: Prevent duplicate dynamic channels from being added. · 3eefa07a
      Mark Michelson authored
      There was a problem observed where the "logger add channel" CLI command
      would allow for a channel with the same name to be added multiple times.
      This would result in each message being written out to the same file
      multiple times.
      
      The problem was due to the difference in how logger channel filenames
      are stored versus the format they are allowed to be presented when they
      are added. For instance, if adding the logger channel "foo" through the
      CLI, the result would be a logger channel with the file name
      /var/log/asterisk/foo being stored. So when trying to add another "foo"
      channel, "foo" would not match "/var/log/asterisk/foo" so we'd happily
      add the duplicate channel.
      
      The fix presented here is to introduce two new methods in the logger
      code:
       * make_filename(): given a logger channel name, this creates the
         filename for that logger channel.
       * find_logchannel(): given a logger channel name, this calls
         make_filename() and then traverses the list of logchannels in order
         to find a match.
      
      This change has made use of make_filename() and find_logchannel()
      throughout to more consistently behave.
      
      ASTERISK-25305 #close
      Reported by Mark Michelson
      
      Change-Id: I892d52954d6007d8bc453c3cbdd9235dec9c4a36
      3eefa07a
    • Mark Michelson's avatar
      Do not swallow frames on channels leaving bridges. · f42084be
      Mark Michelson authored
      When leaving a bridge, indications on a channel could be swallowed by
      the internal indication logic because it appears that the channel is on
      its way to be hung up anyway. One such situation where this is
      detrimental is when channels on hold are redirected out of a bridge. The
      AST_CONTROL_UNHOLD indication from the bridging code is swallowed,
      leaving the channel in question to still appear to be on hold.
      
      The fix here is to modify the logic inside ast_indicate_data() to not
      drop the indication if the channel is simply leaving a bridge. This way,
      channels on hold redirected out of a bridge revert to their expected "in
      use" state after the redirection.
      
      ASTERISK-25418 #close
      Reported by Mark Michelson
      
      Change-Id: If6115204dfa0551c050974ee138fabd15f978949
      f42084be
  3. Sep 23, 2015
  4. Sep 22, 2015
    • Richard Mudgett's avatar
      app_page.c: Fix crash when forwarding with a predial handler. · 06f4f80a
      Richard Mudgett authored
      Page uses the async method of dialing with the dial API.  When a call gets
      forwarded there is no calling channel available.  If the predial handler
      was set then the calling channel could not be put into auto-service
      for the forwarded call because it doesn't exist.  A crash is the result.
      
      * Moved the callee predial parameter string processing to before the
      string is passed to the dial API rather than having the dial API do it.
      There are a few benefits do doing this.  The first is the predial
      parameter string processing doesn't need to be done for each channel
      called by the dial API.  The second is in async mode and the forwarded
      channel is to have the predial handler executed on it then the
      non-existent calling channel does not need to be present to process the
      predial parameter string.
      
      * Don't start auto-service on a non-existent calling channel to execute
      the predial handler when the dial API is in async mode and forwarding a
      call.
      
      ASTERISK-25384 #close
      Reported by: Chet Stevens
      
      Change-Id: If53892b286d29f6cf955e2545b03dcffa2610981
      06f4f80a
    • Matt Jordan's avatar
    • Matt Jordan's avatar
      ARI: Add the ability to subscribe to all events · b99a7052
      Matt Jordan authored
      This patch adds the ability to subscribe to all events. There are two possible
      ways to accomplish this:
      (1) On initial WebSocket connection. This patch adds a new query parameter,
          'subscribeAll'. If present and True, Asterisk will subscribe the
          applications to all ARI events.
      (2) Via the applications resource. When subscribing in this manner, an ARI
          client should merely specify a blank resource name, i.e., 'channels:'
          instead of 'channels:12354'. This will subscribe the application to all
          resources of the 'channels' type.
      
      ASTERISK-24870 #close
      
      Change-Id: I4a943b4db24442cf28bc64b24bfd541249790ad6
      b99a7052
    • Matt Jordan's avatar
    • Joshua Colp's avatar
  5. Sep 21, 2015
  6. Sep 19, 2015
  7. Sep 18, 2015
  8. Sep 17, 2015
    • Richard Mudgett's avatar
      CHAOS: res_pjsip_diversion avoid crash if allocation fails · e1927915
      Richard Mudgett authored
      Validate ast_malloc buffer returned before using it in
      set_redirecting_value().
      
      ASTERISK-25323
      
      Change-Id: I15d2ed7cb0546818264c0bf251aa40adeae83253
      e1927915
    • Kevin Harwell's avatar
      app_queue: AgentComplete event has wrong reason · 729a4325
      Kevin Harwell authored
      When a queued caller transfers an agent to another extension sometimes the
      raised AgentComplete event has a reason of "caller" and sometimes "transfer".
      Since a transfer has taken place this should always be transfer. This occurs
      because sometimes the stasis hangup event arrives before the transfer event
      thus writing a different reason out.
      
      With this patch, when a hangup event is received during a transfer it will
      check to see if the channel that is hanging up is part of a transfer. If so
      it will return and let the subsequently received transfer event handler take
      care of the cleanup.
      
      ASTERISK-25399 #close
      
      Change-Id: Ic63c49bd9a5ed463ea7a032fd2ea3d63bc81a50d
      729a4325
    • Scott Griepentrog's avatar
      PJSIP: avoid crash when getting rtp peer · 87f04d5a
      Scott Griepentrog authored
      Although unlikely, if the tech private is returned as
      a NULL, chan_pjsip_get_rtp_peer() would crash.
      
      ASTERISK-25323
      
      Change-Id: Ie231369bfa7da926fb2b9fdaac228261a3152e6a
      87f04d5a
    • Kevin Harwell's avatar
      app_queue: Crash when transferring · 63ede412
      Kevin Harwell authored
      During some transfer scenarios involving queues Asterisk would sometimes
      crash when trying to obtain a channel snapshot (could happen on caller or
      member channels). This occurred because the underlying channel had already
      disappeared when trying to obtain the latest snapshot.
      
      This patch adds a reference to both the member and caller channels that
      extends to the lifetime of the queue'd call, thus making sure the channels
      will always exist when retrieving the latest snapshots.
      
      ASTERISK-25185 #close
      Reported by: Etienne Lessard
      
      Change-Id: Ic397fa68fb4ff35fbc378e745da9246a7b552128
      63ede412
    • Mark Michelson's avatar
      res_pjsip_pubsub: Eliminate race during initial NOTIFY. · e4739672
      Mark Michelson authored
      There is a slim chance of a race condition occurring where two threads
      can both attempt to manipulate the same area.
      
      Thread A can be handling an incoming initial SUBSCRIBE request. Thread A
      lets the specific subscription handler know that the subscription has
      been established.
      
      At this point, Thread B may detect a state change on the subscribed
      resource and queue up a notification task on Thread C, the subscription
      serializer thread.
      
      Now Thread A attempts to generate the initial NOTIFY request to send to
      the subscriber at the same time that Thread C attempts to generate a
      state change NOTIFY request to send to the subscriber.
      
      The result is that Threads A and C can step on the same memory area,
      resulting in a crash. The crash has been observed as happening when
      attempting to allocate more space to hold the body for the NOTIFY.
      
      The solution presented here is to queue the subscription establishment
      and initial NOTIFY generation onto the subscription serializer thread
      (Thread C in the above scenario). This way, there is no way that a state
      change notification can occur before the initial NOTIFY is sent, and if
      there is a quick succession of NOTIFYs, we can guarantee that the two
      NOTIFY requests will be sent in succession.
      
      Change-Id: I5a89a77b5f2717928c54d6efb9955e5f6f5cf815
      e4739672
  9. Sep 15, 2015
    • Mark Michelson's avatar
      scheduler: Use queue for allocating sched IDs. · 0a74c803
      Mark Michelson authored
      It has been observed that on long-running busy systems, a scheduler
      context can eventually hit INT_MAX for its assigned IDs and end up
      overflowing into a very low negative number. When this occurs, this can
      result in odd behaviors, because a negative return is interpreted by
      callers as being a failure. However, the item actually was successfully
      scheduled. The result may be that a freed item remains in the scheduler,
      resulting in a crash at some point in the future.
      
      The scheduler can overflow because every time that an item is added to
      the scheduler, a counter is bumped and that counter's current value is
      assigned as the new item's ID.
      
      This patch introduces a new method for assigning scheduler IDs. Instead
      of assigning from a counter, a queue of available IDs is maintained.
      When assigning a new ID, an ID is pulled from the queue. When a
      scheduler item is released, its ID is pushed back onto the queue. This
      way, IDs may be reused when they become available, and the growth of ID
      numbers is directly related to concurrent activity within a scheduler
      context rather than the uptime of the system.
      
      Change-Id: I532708eef8f669d823457d7fefdad9a6078b99b2
      0a74c803
  10. Sep 11, 2015
Loading