Skip to content
Snippets Groups Projects
  1. Mar 03, 2016
    • Kevin Harwell's avatar
      bridge.c: Crash during attended transfer when missing a local channel half · 15c5743a
      Kevin Harwell authored
      It's possible for the transferer channel to get hung up early during the
      attended transfer process. For instance, a phone may send a "bye" immediately
      upon receiving a sip notify that contains a sip frag 100 (I'm looking at you
      Jitsi). When this occurs a race begins between the transferer being hung up
      and completion of the transfer code.
      
      If the channel hangs up too early during a transfer involving stasis bridging
      for instance, then when the created local channel goes to look up its swap
      channel (and associated datastore) it can't find it (since it is no longer in
      the bridge) thus it fails to enter the stasis application. Consequently, the
      created local channel(s) hang up as well. If the timing is just right then the
      bridging code attempts to add the message link with missing local channel(s).
      Hence the crash.
      
      Unfortunately, there is no great way to solve the problem of the unexpected
      "bye". While we can't guarantee we won't receive an early hangup, and in this
      case still fail to enter the stasis application, we can make it so asterisk
      does not crash.
      
      This patch does just that by locking the local channel structure, checking
      that the local channel's peer has not been lost, and then continuing. This
      keeps the local channel's peer from being ripped out from underneath it by
      the local/unreal hangup code while attempting to set the stasis message link.
      
      ASTERISK-25771
      
      Change-Id: Ie6d6061e34c7c95f07116fffac9a09e5d225c880
      15c5743a
  2. Apr 13, 2015
    • Matt Jordan's avatar
      git migration: Refactor the ASTERISK_FILE_VERSION macro · 4a582616
      Matt Jordan authored
      Git does not support the ability to replace a token with a version
      string during check-in. While it does have support for replacing a
      token on clone, this is somewhat sub-optimal: the token is replaced
      with the object hash, which is not particularly easy for human
      consumption. What's more, in practice, the source file version was often
      not terribly useful. Generally, when triaging bugs, the overall version
      of Asterisk is far more useful than an individual SVN version of a file. As a
      result, this patch removes Asterisk's support for showing source file
      versions.
      
      Specifically, it does the following:
      
      * Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and
        remove passing the version in with the macro. Other facilities
        than 'core show file version' make use of the file names, such as
        setting a debug level only on a specific file. As such, the act of
        registering source files with the Asterisk core still has use. The
        macro rename now reflects the new macro purpose.
      
      * main/asterisk:
        - Refactor the file_version structure to reflect that it no longer
          tracks a version field.
        - Remove the "core show file version" CLI command. Without the file
          version, it is no longer useful.
        - Remove the ast_file_version_find function. The file version is no
          longer tracked.
        - Rename ast_register_file_version/ast_unregister_file_version to
          ast_register_file/ast_unregister_file, respectively.
      
      * main/manager: Remove value from the Version key of the ModuleCheck
        Action. The actual key itself has not been removed, as doing so would
        absolutely constitute a backwards incompatible change. However, since
        the file version is no longer tracked, there is no need to attempt to
        include it in the Version key.
      
      * UPGRADE: Add notes for:
        - Modification to the ModuleCheck AMI Action
        - Removal of the "core show file version" CLI command
      
      Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
      4a582616
  3. Mar 26, 2015
  4. Mar 13, 2015
  5. Aug 06, 2014
  6. Jul 20, 2014
  7. Jun 13, 2014
    • Matthew Jordan's avatar
      stasis: Reduce creation of channel snapshots to improve performance · 9cc1a8e8
      Matthew Jordan authored
      During some performance testing of Asterisk with AGI, ARI, and lots of Local
      channels, we noticed that there's quite a hit in performance during channel
      creation and releasing to the dialplan (ARI continue). After investigating
      the performance spike that occurs during channel creation, we discovered
      that we create a lot of channel snapshots that are technically unnecessary.
      This includes creating snapshots during:
       * AGI execution
       * Returning objects for ARI commands
       * During some Local channel operations
       * During some dialling operations
       * During variable setting
       * During some bridging operations
      And more.
      
      This patch does the following:
       - It removes a number of fields from channel snapshots. These fields were
         rarely used, were expensive to have on the snapshot, and hurt performance.
         This included formats, translation paths, Log Call ID, callgroup, pickup
         group, and all channel variables. As a result, AMI Status,
         "core show channel", "core show channelvar", and "pjsip show channel" were
         modified to either hit the live channel or not show certain pieces of data.
         While this is unfortunate, the performance gain from this patch is worth
         the loss in behaviour.
       - It adds a mechanism to publish a cached snapshot + blob. A large number of
         publications were changed to use this, including:
         - During Dial begin
         - During Variable assignment (if no AMI variables are emitted - if AMI
           variables are set, we have to make snapshots when a variable is changed)
         - During channel pickup
         - When a channel is put on hold/unhold
         - When a DTMF digit is begun/ended
         - When creating a bridge snapshot
         - When an AOC event is raised
         - During Local channel optimization/Local bridging
         - When endpoint snapshots are generated
         - All AGI events
         - All ARI responses that return a channel
         - Events in the AgentPool, MeetMe, and some in Queue
       - Additionally, some extraneous channel snapshots were being made that were
         unnecessary. These were removed.
       - The result of ast_hashtab_hash_string is now cached in stasis_cache. This
         reduces a large number of calls to ast_hashtab_hash_string, which reduced
         the amount of time spent in this function in gprof by around 50%.
      
      #ASTERISK-23811 #close
      Reported by: Matt Jordan
      
      Review: https://reviewboard.asterisk.org/r/3568/
      ........
      
      Merged revisions 416211 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      9cc1a8e8
  8. Mar 07, 2014
    • Scott Griepentrog's avatar
      uniqueid: channel linkedid, ami, ari object creation with id's · 80ef9a21
      Scott Griepentrog authored
      Much needed was a way to assign id to objects on creation, and
      much change was necessary to accomplish it.  Channel uniqueids
      and linkedids are split into separate string and creation time
      components without breaking linkedid propgation.  This allowed
      the uniqueid to be specified by the user interface - and those
      values are now carried through to channel creation, adding the
      assignedids value to every function in the chain including the
      channel drivers. For local channels, the second channel can be
      specified or left to default to a ;2 suffix of first.  In ARI,
      bridge, playback, and snoop objects can also be created with a
      specified uniqueid.
      
      Along the way, the args order to allocating channels was fixed
      in chan_mgcp and chan_gtalk, and linkedid is no longer lost as
      masquerade occurs.
      
      (closes issue ASTERISK-23120)
      Review: https://reviewboard.asterisk.org/r/3191/
      ........
      
      Merged revisions 410157 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      80ef9a21
  9. Dec 18, 2013
    • Kevin Harwell's avatar
      channel locking: Add locking for channel snapshot creation · 28c0cb28
      Kevin Harwell authored
      Original commit message by mmichelson (asterisk 12 r403311):
      
      "This adds channel locks around calls to create channel snapshots as well
      as other functions which operate on a channel and then end up
      creating a channel snapshot. Functions that expect the channel to be
      locked prior to being called have had their documentation updated to
      indicate such."
      
      The above was initially committed and then reverted at r403398.  The problem
      was found to be in core_local.c in the publish_local_bridge_message function.
      The ast_unreal_lock_all function locks and adds a reference to the returned
      channels and while they were being unlocked they were not being unreffed when
      no longer needed.  Fixed by unreffing the channels.
      
      Also in bridge.c a lock was obtained on "other->chan", but then an attempt was
      made to unlock "other" and not the previously locked channel.  Fixed by
      unlocking "other->chan"
      
      (closes issue ASTERISK-22709)
      Reported by: John Bigelow
      ........
      
      Merged revisions 404237 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      28c0cb28
  10. Dec 05, 2013
  11. Dec 03, 2013
  12. Oct 03, 2013
  13. Sep 13, 2013
    • Richard Mudgett's avatar
      Restore Dial, Queue, and FollowMe 'I' option support. · 2a371cd8
      Richard Mudgett authored
      The Dial, Queue, and FollowMe applications need to inhibit the bridging
      initial connected line exchange in order to support the 'I' option.
      
      * Replaced the pass_reference flag on ast_bridge_join() with a flags
      parameter to pass other flags defined by enum ast_bridge_join_flags.
      
      * Replaced the independent flag on ast_bridge_impart() with a flags
      parameter to pass other flags defined by enum ast_bridge_impart_flags.
      
      * Since the Dial, Queue, and FollowMe applications are now the only
      callers of ast_bridge_call() and ast_bridge_call_with_flags(), changed the
      calling contract to require the initial COLP exchange to already have been
      done by the caller.
      
      * Made all callers of ast_bridge_impart() check the return value.  It is
      important.  As a precaution, I also made the compiler complain now if it
      is not checked.
      
      * Did some cleanup in parking_tests.c as a result of checking the
      ast_bridge_impart() return value.
      
      An independent, but associated change is:
      * Reduce stack usage in ast_indicate_data() and add a dropping redundant
      connected line verbose message.
      
      (closes issue ASTERISK-22072)
      Reported by: Joshua Colp
      
      Review: https://reviewboard.asterisk.org/r/2845/
      ........
      
      Merged revisions 399136 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      2a371cd8
  14. Sep 06, 2013
  15. Aug 22, 2013
    • Mark Michelson's avatar
      Massively clean up app_queue. · 00baddb9
      Mark Michelson authored
      This essentially makes app_queue usable again. From reviewboard:
      
      * Reporting of transfers and call completion is done by creating stasis 
        subscriptions and listening for specific events in order to determine
        when the call is finished (either via a transfer or hangup).
      * Dial end messages have been added where they were previously missing.
      * Queue stats are properly being updated again once calls have finished.
      * AgentComplete stasis messages and AMI events are now occurring again.
      * Mixmonitor starting has been factored into its own function and uses the
        Mixmonitor API now instead of using ast_pbx_run()
      
      In addition to the changes in app_queue, there are several supplementary changes as well:
      
      * Queue logging now differentiates between attended and blind transfers. A
        note about this is in the CHANGES file.
      * Local channel optimization events now report more information. This
        includes which of the two local channels involved is the destination of
        the optimization, the channel that is replacing the destination local channel,
        and an identifier so that begin and end events can be matched to each other.
        The end events are now sent whether the optimization was successful or not and
        includes an indicator of whether the optimization was successful.
      * Changes were made to features and bridging_basic so that additional flags may
        be set on a bridge. This is necessary because the queue requires that its
        bridge only allows move-swap local channel optimizations into the bridge.
      
      (closes issue ASTERISK-21517)
      Reported by Matt Jordan
      
      (closes issue ASTERISK-21943)
      Reported by Matt Jordan
      
      Review: https://reviewboard.asterisk.org/r/2694
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397451 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      00baddb9
  16. Aug 01, 2013
  17. Jul 25, 2013
    • Matthew Jordan's avatar
      A great big renaming patch · cafc1158
      Matthew Jordan authored
      This patch renames the bridging* files to bridge*. This may seem pedantic
      and silly, but it fits better in line with current Asterisk naming conventions:
      * channel is not "channeling"
      * monitor is not "monitoring"
      etc.
      
      A bridge is an object. It is a first class citizen in Asterisk. "Bridging" is
      the act of using a bridge on a set of channels - and the API that fulfills that
      role is more than just the action.
      
      (closes issue ASTERISK-22130)
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      cafc1158
  18. Jul 08, 2013
    • Matthew Jordan's avatar
      Create Local channel messages on the Stasis message bus and produce AMI events · 30d37985
      Matthew Jordan authored
      This patch does the following:
      
      * It adds a virtual table of callbacks to core_unreal. These callbacks can be
        supplied by concrete implementations of "unreal" channel drivers, which lets
        the unreal channel driver call specific functionality when it performs some
        action. Currently, this is done to notify implementations when an
        optimization operation has begun, and when an optimization operation has
        succeeded.
      
      * It adds Stasis-Core messages for Local channel bridging and Local channel
        optimization. Local channel optimization is now two events: a Begin and an
        End. Some consumers of Stasis-Core may want to know when an operation is
        beginning so that they can 'prepare' their information; others will be more
        concerned about when the operation has completed, so that they can 'fix up'
        information. Stasis-Core allows for both, as does AMI.
      
      Review: https://reviewboard.asterisk.org/r/2552
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393801 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      30d37985
  19. Jul 01, 2013
  20. Jun 05, 2013
  21. May 21, 2013
Loading