Examples of CancelSm


Examples of com.cloudhopper.smpp.pdu.CancelSm

            } else if (commandId == SmppConstants.CMD_ID_SUBMIT_SM) {
                pdu = new SubmitSm();
            } else if (commandId == SmppConstants.CMD_ID_DATA_SM) {
                pdu = new DataSm();
            } else if (commandId == SmppConstants.CMD_ID_CANCEL_SM) {
                pdu = new CancelSm();
            } else if (commandId == SmppConstants.CMD_ID_QUERY_SM) {
                pdu = new QuerySm();
            } else if (commandId == SmppConstants.CMD_ID_BIND_TRANSCEIVER) {
                pdu = new BindTransceiver();
            } else if (commandId == SmppConstants.CMD_ID_BIND_TRANSMITTER) {
View Full Code Here

Examples of com.cloudhopper.smpp.pdu.CancelSm

      QuerySmResp queryResp = (QuerySmResp)future1.getResponse();

            System.out.println("Press any key to send cancel #1");
            System.in.read();

      CancelSm cancel0 = new CancelSm();
      cancel0.setMessageId(submitResp.getMessageId());
            cancel0.setSourceAddress(new Address((byte)0x03, (byte)0x00, "40404"));
            cancel0.setDestAddress(new Address((byte)0x01, (byte)0x01, "44555519205"));
      WindowFuture<Integer,PduRequest,PduResponse> future2 = session0.sendRequestPdu(cancel0, 10000, true);
      while (!future2.isDone()) {}
      CancelSmResp cancelResp = (CancelSmResp)future2.getResponse();
           
            logger.info("sendWindow.size: {}", session0.getSendWindow().getSize());
View Full Code Here

Examples of ie.omk.smpp.message.CancelSM

        case SMPPPacket.QUERY_MSG_DETAILS_RESP:
            response = new QueryMsgDetailsResp();
            break;

        case SMPPPacket.CANCEL_SM:
            response = new CancelSM();
            break;

        case SMPPPacket.CANCEL_SM_RESP:
            response = new CancelSMResp();
            break;
View Full Code Here

Examples of org.jsmpp.bean.CancelSm

        return resp;
    }

    public CancelSm cancelSm(byte[] data) throws PDUStringException {
        CancelSm req = new CancelSm();
        SequentialBytesReader reader = new SequentialBytesReader(data);
        assignHeader(req, reader);
        req.setServiceType(reader.readCString());
        StringValidator.validateString(req.getServiceType(),
                StringParameter.SERVICE_TYPE);

        req.setMessageId(reader.readCString());
        StringValidator.validateString(req.getMessageId(),
                StringParameter.MESSAGE_ID);

        req.setSourceAddrTon(reader.readByte());
        req.setSourceAddrNpi(reader.readByte());
        req.setSourceAddr(reader.readCString());
        StringValidator.validateString(req.getSourceAddr(),
                StringParameter.SOURCE_ADDR);

        req.setDestAddrTon(reader.readByte());
        req.setDestAddrNpi(reader.readByte());
        req.setDestinationAddress(reader.readCString());
        StringValidator.validateString(req.getDestinationAddress(),
                StringParameter.DESTINATION_ADDR);

        return req;
    }
View Full Code Here

Examples of org.jsmpp.bean.CancelSm

    }
   
    public void processCancelSm(Command pduHeader, byte[] pdu,
            ServerResponseHandler responseHandler) throws IOException {
        try {
            CancelSm cancelSm = pduDecomposer.cancelSm(pdu);
            responseHandler.processCancelSm(cancelSm);
            responseHandler.sendCancelSmResp(pduHeader.getSequenceNumber());
        } catch (PDUStringException e) {
            responseHandler.sendNegativeResponse(pduHeader.getCommandId(), e.getErrorCode(), pduHeader.getSequenceNumber());
        } catch (ProcessRequestException e) {
View Full Code Here

Examples of org.jsmpp.bean.CancelSm

        super(session, config);
    }

    @Override
    public void execute(Exchange exchange) throws SmppException {
        CancelSm cancelSm = createCancelSm(exchange);

        if (log.isDebugEnabled()) {
            log.debug("Canceling a short message for exchange id '{}' and message id '{}'",
                    exchange.getExchangeId(), cancelSm.getMessageId());
        }

        try {
            session.cancelShortMessage(
                    cancelSm.getServiceType(),
                    cancelSm.getMessageId(),
                    TypeOfNumber.valueOf(cancelSm.getSourceAddrTon()),
                    NumberingPlanIndicator.valueOf(cancelSm.getSourceAddrNpi()),
                    cancelSm.getSourceAddr(),
                    TypeOfNumber.valueOf(cancelSm.getDestAddrTon()),
                    NumberingPlanIndicator.valueOf(cancelSm.getDestAddrNpi()),
                    cancelSm.getDestinationAddress());
        } catch (Exception e) {
            throw new SmppException(e);
        }

        if (log.isDebugEnabled()) {
            log.debug("Cancel a short message for exchange id '{}' and message id '{}'",
                    exchange.getExchangeId(), cancelSm.getMessageId());
        }

        Message message = getResponseMessage(exchange);
        message.setHeader(SmppConstants.ID, cancelSm.getMessageId());
    }
View Full Code Here

Examples of org.jsmpp.bean.CancelSm

        message.setHeader(SmppConstants.ID, cancelSm.getMessageId());
    }

    protected CancelSm createCancelSm(Exchange exchange) {
        Message in = exchange.getIn();
        CancelSm cancelSm = new CancelSm();

        if (in.getHeaders().containsKey(SmppConstants.ID)) {
            cancelSm.setMessageId(in.getHeader(SmppConstants.ID, String.class));
        }

        if (in.getHeaders().containsKey(SmppConstants.SOURCE_ADDR)) {
            cancelSm.setSourceAddr(in.getHeader(SmppConstants.SOURCE_ADDR, String.class));
        } else {
            cancelSm.setSourceAddr(config.getSourceAddr());
        }

        if (in.getHeaders().containsKey(SmppConstants.SOURCE_ADDR_TON)) {
            cancelSm.setSourceAddrTon(in.getHeader(SmppConstants.SOURCE_ADDR_TON, Byte.class));
        } else {
            cancelSm.setSourceAddrTon(config.getSourceAddrTon());
        }

        if (in.getHeaders().containsKey(SmppConstants.SOURCE_ADDR_NPI)) {
            cancelSm.setSourceAddrNpi(in.getHeader(SmppConstants.SOURCE_ADDR_NPI, Byte.class));
        } else {
            cancelSm.setSourceAddrNpi(config.getSourceAddrNpi());
        }

        if (in.getHeaders().containsKey(SmppConstants.DEST_ADDR)) {
            cancelSm.setDestinationAddress(in.getHeader(SmppConstants.DEST_ADDR, String.class));
        } else {
            cancelSm.setDestinationAddress(config.getDestAddr());
        }

        if (in.getHeaders().containsKey(SmppConstants.DEST_ADDR_TON)) {
            cancelSm.setDestAddrTon(in.getHeader(SmppConstants.DEST_ADDR_TON, Byte.class));
        } else {
            cancelSm.setDestAddrTon(config.getDestAddrTon());
        }

        if (in.getHeaders().containsKey(SmppConstants.DEST_ADDR_NPI)) {
            cancelSm.setDestAddrNpi(in.getHeader(SmppConstants.DEST_ADDR_NPI, Byte.class));
        } else {
            cancelSm.setDestAddrNpi(config.getDestAddrNpi());
        }

        if (in.getHeaders().containsKey(SmppConstants.SERVICE_TYPE)) {
            cancelSm.setServiceType(in.getHeader(SmppConstants.SERVICE_TYPE, String.class));
        } else {
            cancelSm.setServiceType(config.getServiceType());
        }

        return cancelSm;
    }
View Full Code Here

Examples of org.jsmpp.bean.CancelSm

        super(session, config);
    }

    @Override
    public void execute(Exchange exchange) throws SmppException {
        CancelSm cancelSm = createCancelSm(exchange);
       
        log.debug("Canceling a short message for exchange id '{}' and message id '{}'",
                exchange.getExchangeId(), cancelSm.getMessageId());

        try {
            session.cancelShortMessage(
                    cancelSm.getServiceType(),
                    cancelSm.getMessageId(),
                    TypeOfNumber.valueOf(cancelSm.getSourceAddrTon()),
                    NumberingPlanIndicator.valueOf(cancelSm.getSourceAddrNpi()),
                    cancelSm.getSourceAddr(),
                    TypeOfNumber.valueOf(cancelSm.getDestAddrTon()),
                    NumberingPlanIndicator.valueOf(cancelSm.getDestAddrNpi()),
                    cancelSm.getDestinationAddress());
        } catch (Exception e) {
            throw new SmppException(e);
        }

        log.debug("Cancel a short message for exchange id '{}' and message id '{}'",
                exchange.getExchangeId(), cancelSm.getMessageId());

        Message message = getResponseMessage(exchange);
        message.setHeader(SmppConstants.ID, cancelSm.getMessageId());
    }
View Full Code Here

Examples of org.jsmpp.bean.CancelSm

        message.setHeader(SmppConstants.ID, cancelSm.getMessageId());
    }

    protected CancelSm createCancelSm(Exchange exchange) {
        Message in = exchange.getIn();
        CancelSm cancelSm = new CancelSm();

        if (in.getHeaders().containsKey(SmppConstants.ID)) {
            cancelSm.setMessageId(in.getHeader(SmppConstants.ID, String.class));
        }

        if (in.getHeaders().containsKey(SmppConstants.SOURCE_ADDR)) {
            cancelSm.setSourceAddr(in.getHeader(SmppConstants.SOURCE_ADDR, String.class));
        } else {
            cancelSm.setSourceAddr(config.getSourceAddr());
        }

        if (in.getHeaders().containsKey(SmppConstants.SOURCE_ADDR_TON)) {
            cancelSm.setSourceAddrTon(in.getHeader(SmppConstants.SOURCE_ADDR_TON, Byte.class));
        } else {
            cancelSm.setSourceAddrTon(config.getSourceAddrTon());
        }

        if (in.getHeaders().containsKey(SmppConstants.SOURCE_ADDR_NPI)) {
            cancelSm.setSourceAddrNpi(in.getHeader(SmppConstants.SOURCE_ADDR_NPI, Byte.class));
        } else {
            cancelSm.setSourceAddrNpi(config.getSourceAddrNpi());
        }

        if (in.getHeaders().containsKey(SmppConstants.DEST_ADDR)) {
            cancelSm.setDestinationAddress(in.getHeader(SmppConstants.DEST_ADDR, String.class));
        } else {
            cancelSm.setDestinationAddress(config.getDestAddr());
        }

        if (in.getHeaders().containsKey(SmppConstants.DEST_ADDR_TON)) {
            cancelSm.setDestAddrTon(in.getHeader(SmppConstants.DEST_ADDR_TON, Byte.class));
        } else {
            cancelSm.setDestAddrTon(config.getDestAddrTon());
        }

        if (in.getHeaders().containsKey(SmppConstants.DEST_ADDR_NPI)) {
            cancelSm.setDestAddrNpi(in.getHeader(SmppConstants.DEST_ADDR_NPI, Byte.class));
        } else {
            cancelSm.setDestAddrNpi(config.getDestAddrNpi());
        }

        if (in.getHeaders().containsKey(SmppConstants.SERVICE_TYPE)) {
            cancelSm.setServiceType(in.getHeader(SmppConstants.SERVICE_TYPE, String.class));
        } else {
            cancelSm.setServiceType(config.getServiceType());
        }

        return cancelSm;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.