docs: private boolean splitTwo() throws PBXException
      {
          final AsteriskSettings profile = PBXFactory.getActiveProfile();
          AsteriskPBX pbx = (AsteriskPBX) PBXFactory.getActivePBX();
  
          if (channel1 == channel2)
          {
              throw new PBXException("channel1 is the same as channel2. if I let this happen, asterisk will core dump :)");
          }
  
          List<Channel> channels = new LinkedList<>();
          channels.add(channel1);
          channels.add(channel2);
          if (!pbx.waitForChannelsToQuiescent(channels, 3000))
          {
              logger.error(callSite, callSite);
              throw new PBXException(
                      "Channel: " + channel1 + " or " + channel2 + " cannot be split as they are still in transition.");
          }
  
          /*
           * redirects the specified channels to the specified endpoints. Returns
           * true or false reflecting success.
           */
  
          AgiChannelActivityHold agi1 = new AgiChannelActivityHold();
          AgiChannelActivityHold agi2 = new AgiChannelActivityHold();
  
          pbx.setVariable(channel1, "proxyId", "" + ((ChannelProxy) channel1).getIdentity());
          pbx.setVariable(channel2, "proxyId", "" + ((ChannelProxy) channel2).getIdentity());
  
          // AgiChannelAcitivyBridge has a latch which other activities may be
          // sleeping on, so it's important
          // to change the other channels activity first to avoid it waking and
          // taking an undesired action
          // when the AgiChannelActivityBridge channel has it's acitvity
          // cancelled.
          if (channel2.getCurrentActivityAction() instanceof AgiChannelActivityBridge)
          {
              channel1.setCurrentActivityAction(agi1);
              channel2.setCurrentActivityAction(agi2);
          }
          else
          {
              channel2.setCurrentActivityAction(agi2);
              channel1.setCurrentActivityAction(agi1);
          }
  
          final String agiExten = profile.getAgiExtension();
          final String agiContext = profile.getManagementContext();
          logger.debug("splitTwo channel lhs:" + channel1 + " to " + agiExten + " in context " + agiContext + " from "
                  + this._callToSplit);
  
          final EndPoint extensionAgi = pbx.getExtensionAgi();
          final RedirectAction redirect = new RedirectAction(channel1, agiContext, extensionAgi, 1);
          redirect.setExtraChannel(channel2);
          redirect.setExtraContext(agiContext);
          redirect.setExtraExten(extensionAgi);
          redirect.setExtraPriority(1);
          // logger.error(redirect);
  
          boolean ret = false;
          {
              try
              {
  
                  renameEventReceived.set(new CountDownLatch(1));
                  // final ManagerResponse response =
                  pbx.sendAction(redirect, 1000);
                  if (pbx.expectRenameEvents())
                  {
  
                      // wait for channels to unbridge
                      if (!renameEventReceived.get().await(2000, TimeUnit.MILLISECONDS))
                      {
                          logger.error("There was no rename event");
                      }
                      else
                      {
                          logger.warn("Channels are renaming, now waiting for Quiescent");
                      }
                  }
  
                  channels.clear();
  
                  channels.add(channel1);
                  channels.add(channel2);
                  if (!pbx.waitForChannelsToQuiescent(channels, 3000))
                  {
                      logger.error(callSite, callSite);
                      throw new PBXException("Channel: " + channel1 + " or " + channel2
                              + " cannot be split as they are still in transition.");
                  }
  
                  double ctr = 0;
                  while ((!agi1.hasCallReachedAgi() || !agi2.hasCallReachedAgi()) && ctr < 10)
                  {
                      Thread.sleep(100);
                      ctr += 100.0 / 1000.0;
                      if (!agi1.hasCallReachedAgi())
                      {
                          logger.info("Waiting on (agi1) " + channel1);
                      }
                      if (!agi2.hasCallReachedAgi())
                      {
                          logger.info("Waiting on (agi2) " + channel2);
                      }
                  }
                  ret = agi1.hasCallReachedAgi() && agi2.hasCallReachedAgi();
  
              }
              catch (final Exception e)
              {
                  logger.error(e, e);
              }
          }
          return ret;
      }