Package org.smpp.pdu

Examples of org.smpp.pdu.SubmitSM


    submit(processor, submitRequest, messageId, DELIVERED, 0);
  }

  private void deliver(DeliveryInfoEntry entry) {
    debug.enter(this, "deliver");
    SubmitSM submit = entry.submit;
    DeliverSM deliver = new DeliverSM();
    deliver.setSourceAddr(submit.getDestAddr());
    deliver.setDestAddr(submit.getDestAddr());
    String msg = "";
    msg += "id:" + entry.messageId + " ";
    msg += "sub:" + entry.sub + " ";
    msg += "dlvrd:" + entry.dlvrd + " ";
    msg += "submit date:" + formatDate(entry.submitted) + " ";
    msg += "done date:" + formatDate(System.currentTimeMillis()) + " ";
    msg += "stat:" + entry.stat + " ";
    msg += "err:" + entry.err + " ";
    String shortMessage = submit.getShortMessage();
    int msgLen = shortMessage.length();
    msg += "text:" + shortMessage.substring(0, (msgLen > 20 ? 20 : msgLen));
    try {
      deliver.setShortMessage(msg);
      deliver.setServiceType(submit.getServiceType());
    } catch (WrongLengthOfStringException e) {
    }
    try {
      entry.processor.serverRequest(deliver);
    } catch (Exception e) {
View Full Code Here


     */
    private void sendSingle(SMSMessage message) throws MessageException{
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Sending message using sendSingle");
        }
        final SubmitSM request;
        try {
            String theMessage = message.getMessage();
            request = new SubmitSM();
            // set values
            request.setServiceType(SMSCSvcType);
            request.setSourceAddr(SMSCSvcAddr);
            request.setReplaceIfPresentFlag((byte) 0x00);
            request.setShortMessage(theMessage);
            request.setEsmClass((byte) 0x00);
            request.setProtocolId((byte) 0x00);
            request.setPriorityFlag((byte) 0x00);
            request.setRegisteredDelivery((byte) 0x00);
            request.setDataCoding((byte) 0x00);
            request.setSmDefaultMsgId((byte) 0x00);
            // send the request
            request.assignSequenceNumber(false);
        } catch (Exception e) {
            final String messageKey = "message-submit-failure";
            LOGGER.warn(messageKey);
            throw new MessageException(localizer.format(messageKey), e);
        }

        int numberOfDestinations = message.getDestinationCount();
        final List failedRecipients = new LinkedList();
        // if we have multiple message destinations we need to send it
        // multiple times as single messages
        for (int i = 0; i < numberOfDestinations; i++) {
            try {
                request.setDestAddr(new Address(message.getDestination(i)));
                if(LOGGER.isDebugEnabled()) {
                    LOGGER.debug("Submit request " + request.debugString());
                }

                // Get a session from the pool and attempt to send the message.
                boolean submitted = false;
                SubmitSMResp response = null;
View Full Code Here

TOP

Related Classes of org.smpp.pdu.SubmitSM

Copyright © 2018 www.massapicom. 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.