docs: public OriginateResult[] dial(final NewChannelListener listener, final EndPoint localHandset,
              final AgiChannelActivityAction action, final CallerID callerID, Integer timeout, final boolean hideCallerId,
              Map<String, String> channelVarsToSet) throws PBXException, InterruptedException
      {
          final PBX pbx = PBXFactory.getActivePBX();
  
          try (final OriginateToExtension originate = new OriginateToExtension(listener))
          {
              this.startListener();
              originator = originate;
  
              // First bring the operator's handset up and connect it to the
              // 'njr-dial' extension where they can
              // wait whilst we complete the second leg
              final OriginateResult trcResult = originate.originate(localHandset, pbx.getExtensionAgi(), true,
                      ((AsteriskPBX) pbx).getManagementContext(), callerID, timeout, hideCallerId, channelVarsToSet);
  
              this.result[0] = trcResult;
              if (trcResult.isSuccess() == true)
              {
                  if (trcResult.getChannel() != null)
                  {
                      trcResult.getChannel().setCurrentActivityAction(action);
                      if (trcResult.getChannel().waitForChannelToReachAgi(30, TimeUnit.SECONDS))
                      {
                          logger.info("Call reached AGI");
                      }
                      else
                      {
                          logger.error("Call never reached agi");
                      }
                  }
                  else
                  {
                      logger.error("Call never reached agi");
                  }
              }
              else
              {
                  logger.warn("Originate failed: " + trcResult.getAbortReason());
              }
              logger.info("Hangup status is " + hangupDetected);
  
              return this.result;
          }
          finally
          {
              this.close();
          }
      }