예제 #1
0
  @Override
  public void startGateway()
      throws TimeoutException, GatewayException, IOException, InterruptedException {

    if (!session.getSessionState().isBound()) {
      if (enquireLink > 0) {
        session.setEnquireLinkTimer(enquireLink);
      }

      session.connectAndBind(
          host,
          port,
          new BindParameter(
              bindType,
              bindAttributes.getSystemId(),
              bindAttributes.getPassword(),
              bindAttributes.getSystemType(),
              bindTypeOfNumber,
              bindNumberingPlanIndicator,
              null));

    } else {
      Logger.getInstance().logWarn("SMPP session already bound.", null, getGatewayId());
      //	throw new GatewayException("Session already bound");
    }
  }
예제 #2
0
  @Override
  public void stopGateway()
      throws TimeoutException, GatewayException, IOException, InterruptedException {
    if (session.getSessionState().isBound()) {
      session.removeSessionStateListener(stateListener);
      session.unbindAndClose();

      // super.stopGateway();
    } else {
      Logger.getInstance().logWarn("SMPP session not bound.", null, getGatewayId());
      // throw new GatewayException("Session not bound");
    }
    super.stopGateway();
  }