Skip to content
Snippets Groups Projects
  1. Mar 07, 2014
  2. Jan 28, 2014
  3. Dec 18, 2013
  4. Dec 17, 2013
  5. Dec 05, 2013
  6. Dec 03, 2013
  7. Sep 24, 2013
    • Matthew Jordan's avatar
      Fix a performance problem CDRs · e7d49d28
      Matthew Jordan authored
      There is a large performance price currently in the CDR engine. We currently
      perform two ao2_callback calls on a container that has an entry for every
      channel in the system. This is done to create matching pairs between channels
      in a bridge.
      
      As such, the portion of the CDR logic that this patch deals with is how we
      make pairings when a channel enters a mixing bridge. In general, when a
      channel enters such a bridge, we need to do two things:
       (1) Figure out if anyone in the bridge can be this channel's Party B.
       (2) Make pairings with every other channel in the bridge that is not already
           our Party B.
      
      This is a two step process. In the first step, we look through everyone in the
      bridge and see if they can be our Party B (single_state_process_bridge_enter).
      If they can - yay! We mark our CDR as having gotten a Party B. If not, we keep
      searching. If we don't find one, we wait until someone joins who can be our
      Party B.
      
      Step 2 is where we changed the logic
      (handle_bridge_pairings and bridge_candidate_process). Previously, we would
      first find candidates - those channels in the bridge with us - from the
      active_cdrs_by_channel container. Because a channel could be a candidate if it
      was Party B to an item in the container, the code implemented multiple
      ao2_container callbacks to get all the candidates. We also had to store them
      in another container with some other meta information. This was rather complex
      and costly, particularly if you have 300 Local channels (600 channels!) going
      at once.
      
      Luckily, none of it is needed: when a channel enters a bridge (which is when
      we're figuring all this stuff out), the bridge snapshot tells us the unique
      IDs of everyone already in the bridge. All we need to do is:
       For all channels in the bridge:
         If the channel is us or our Party B that we got in step 1, skip it
         Compare us and the candidate to figure out who is Party A (based on some
             specific rules)
         If we are Party A:
            Make a new CDR for us, append it to our chain, and set the candidate as
                Party B
         If they are Party A:
            If they don't have a Party B:
              Make a new CDR for them, append us to their chain, and us as Party B
            Otherwise:
              Copy us over as Party B on their existing CDR.
      
      This patch does that.
      
      Because we now use channel unique IDs to find the candidates during bridging,
      active_cdrs_by_channel now looks up things using uniqueid instead of channel
      name. This makes the more complex code simpler; it does, however, have the
      drawback that dialplan applications and functions will be slightly slower as
      they have to iterate through the container looking for the CDR by name.
      That's a small price to pay however as the bridging code will be called a lot
      more often.
      
      This patch also does two other minor changes:
       (1) It reduces the container size of the channels in a bridge snapshot to 1.
           In order to be predictable for multi-party bridges, the order of the
           channels in the container must be stable; that is, it must always devolve
           to a linked list.
       (2) CDRs and the multi-party test was updated to show the relationship between
           two dialed channels. You still want to know if they talked - previously,
           dialed channels were always ignored, which is wrong when they have
           managed to get a Party B.
      
      (closes issue ASTERISK-22488)
      Reported by: Richard Mudgett
      
      Review: https://reviewboard.asterisk.org/r/2861/
      ........
      
      Merged revisions 399666 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399667 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      e7d49d28
  8. 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
  9. Sep 08, 2013
  10. Aug 16, 2013
  11. Aug 02, 2013
  12. Jul 25, 2013
  13. Jul 17, 2013
  14. Jun 28, 2013
    • Matthew Jordan's avatar
      Handle an originated channel being sent into a non-empty bridge · ca61a055
      Matthew Jordan authored
      Originated channels are a bit odd - they are technically a dialed channel (thus
      the party B or peer) but, since there is no caller, they are treated as the
      party A. When entering into a bridge that already contains participants, the CDR
      engine - if the CDR record is in the Dial state - attempts to match the person
      entering the bridge with an existing participant. The idea is that if you dialed
      someone and the person you dialed is already in the bridge, you don't need a new
      CDR record, the existing CDR record describes the relationship.
      
      Unfortunately, for an originated channel, there is no Party B. If no one was in
      the bridge this didn't cause any issues; however, if participants were in the
      bridge the CDR engine would attempt to match a non-existant Party B on the
      channel's CDR record and explode.
      
      This patch fixes that, and a unit test has been added to cover this case.
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      ca61a055
  15. Jun 17, 2013
    • Matthew Jordan's avatar
      Update Asterisk's CDRs for the new bridging framework · 6258bbe7
      Matthew Jordan authored
      This patch is the initial push to update Asterisk's CDR engine for the new
      bridging framework. This patch guts the existing CDR engine and builds the new
      on top of messages coming across Stasis. As changes in channel state and bridge
      state are detected, CDRs are built and dispatched accordingly. This
      fundamentally changes CDRs in a few ways.
      (1) CDRs are now *very* reflective of the actual state of channels and bridges.
          This means CDRs track well with what an actual channel is doing - which
          is useful in transfer scenarios (which were previously difficult to pin
          down). It does, however, mean that CDRs cannot be 'fooled'. Previous
          behavior in Asterisk allowed for CDR applications, channels, and other
          properties to be spoofed in parts of the code - this no longer works.
      (2) CDRs have defined behavior in multi-party scenarios. This behavior will not
          be what everyone wants, but it is a defined behavior and as such, it is
          predictable.
      (3) The CDR manipulation functions and applications have been overhauled. Major
          changes have been made to ResetCDR and ForkCDR in particular. Many of the
          options for these two applications no longer made any sense with the new
          framework and the (slightly) more immutable nature of CDRs.
      
      There are a plethora of other changes. For a full description of CDR behavior,
      see the CDR specification on the Asterisk wiki.
      
      (closes issue ASTERISK-21196)
      
      Review: https://reviewboard.asterisk.org/r/2486/
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      6258bbe7
Loading