String messageId = session.submitShortMessage("CMT", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "55662", TypeOfNumber.ALPHANUMERIC, NumberingPlanIndicator.UNKNOWN, "your_phone_number", new ESMClass(64), (byte)0, (byte)1, timeFormatter.format(new Date()), null, new RegisteredDelivery(SMSCDeliveryReceipt.DEFAULT), (byte)0, new GeneralDataCoding(245), (byte)0, HexUtil.convertHexStringToBytes("0605040B8423F025060803AE81EAAF82B48401056A0045C 60D036578616D706C652E636F6D0007010377656C636F6D6520746F207761702073697465000101") );
public ESMClass(MessageMode messageMode, MessageType messageType, GSMSpecificFeature specificFeature) { this(0); setMessageMode(messageMode); setMessageType(messageType); setSpecificFeature(specificFeature); }
/** * Check the GSM Specific Feature is contained in ESM class value. * * @param esmClass is the ESM class. * @return <tt>true</tt> if the GSM specific feature is contained in ESM class. */ public boolean containedIn(ESMClass esmClass) { return containedIn(esmClass.value()); }
public ESMClass(MessageMode messageMode, MessageType messageType, GSMSpecificFeature specificFeature) { this(0); setMessageMode(messageMode); setMessageType(messageType); setSpecificFeature(specificFeature); }
/** * Check the GSM Specific Feature is contained in ESM class value. * * @param esmClass is the ESM class. * @return <tt>true</tt> if the GSM specific feature is contained in ESM class. */ public boolean containedIn(ESMClass esmClass) { return containedIn(esmClass.value()); }
public void run() { try { String messageId = session.submitShortMessage("CMT", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "1616", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "628176504657", new ESMClass(), (byte)0, (byte)1, TIME_FORMATTER .format(new Date()), null, registeredDelivery, (byte)0, DataCodings.ZERO, (byte)0, "jSMPP simplify SMPP on Java platform".getBytes()); LOGGER.info("Message submitted, message_id is {}", messageId); } catch (PDUException e) { LOGGER.error("Invalid PDU parameter", e); counter.incrementAndGet(); } catch (ResponseTimeoutException e) { LOGGER.error("Response timeout", e); counter.incrementAndGet(); } catch (InvalidResponseException e) { // Invalid response LOGGER.error("Receive invalid response", e); counter.incrementAndGet(); } catch (NegativeResponseException e) { // Receiving negative response (non-zero command_status) LOGGER.error("Receive negative response", e); counter.incrementAndGet(); } catch (IOException e) { LOGGER.error("I/O error occured", e); counter.incrementAndGet(); } } });
public ESMClass(MessageMode messageMode, MessageType messageType, GSMSpecificFeature specificFeature) { this(0); setMessageMode(messageMode); setMessageType(messageType); setSpecificFeature(specificFeature); }
/** * Check the GSM Specific Feature is contained in ESM class value. * * @param esmClass is the ESM class. * @return <tt>true</tt> if the GSM specific feature is contained in ESM class. */ public boolean containedIn(ESMClass esmClass) { return containedIn(esmClass.value()); }
smppSession.submitShortMessage(null, TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN, sourceAddr, TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN, destinationAddr, new ESMClass(), (byte)0, (byte)0, null, null, new RegisteredDelivery(0), (byte)0,
public ESMClass(MessageMode messageMode, MessageType messageType, GSMSpecificFeature specificFeature) { this(0); setMessageMode(messageMode); setMessageType(messageType); setSpecificFeature(specificFeature); }
/** * Check the GSM Specific Feature is contained in ESM class value. * * @param esmClass is the ESM class. * @return <tt>true</tt> if the GSM specific feature is contained in ESM class. */ public boolean containedIn(ESMClass esmClass) { return containedIn(esmClass.value()); }
public static String submitMessage(SMPPSession session, String message, OptionalParameter sarMsgRefNum, OptionalParameter sarSegmentSeqnum, OptionalParameter sarTotalSegments) { String messageId = null; try { messageId = session.submitShortMessage("CMT", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "1616", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "628176504657", new ESMClass(), (byte)0, (byte)1, TIME_FORMATTER .format(new Date()), null, new RegisteredDelivery(SMSCDeliveryReceipt.DEFAULT), (byte)0, DataCodings.ZERO, (byte)0, message.getBytes(), sarMsgRefNum, sarSegmentSeqnum, sarTotalSegments);; } catch (PDUException e) { // Invalid PDU parameter LOGGER.error("Invalid PDU parameter", e); } catch (ResponseTimeoutException e) { // Response timeout LOGGER.error("Response timeout", e); } catch (InvalidResponseException e) { // Invalid response LOGGER.error("Receive invalid response", e); } catch (NegativeResponseException e) { // Receiving negative response (non-zero command_status) LOGGER.error("Receive negative response", e); } catch (IOException e) { LOGGER.error("I/O error occured", e); } return messageId; } }
public boolean containedIn(ESMClass esmClass) { return containedIn(esmClass.value()); }
messageId = session.submitShortMessage("CMT", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "yet-ysoft", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "967739873913", new ESMClass(), (byte) 0, (byte) 1, timeFormatter.format(new Date()), null, new RegisteredDelivery(SMSCDeliveryReceipt.DEFAULT), (byte) 0, new GeneralDataCoding(false, false, MessageClass.CLASS1, Alphabet.ALPHA_DEFAULT), (byte) 0, "jSMPP simplify SMPP on Java platform".getBytes()); System.out.println("Message submitted, message_id is " + messageId); } catch (PDUException e) {
public boolean containedIn(ESMClass esmClass) { return containedIn(esmClass.value()); }
NumberingPlanIndicator.UNKNOWN, receiverMobileNo[i], new ESMClass(), (byte) 0, (byte) 1,
public boolean containedIn(ESMClass esmClass) { return containedIn(esmClass.value()); }
public void run() { try { Thread.sleep(1000); } catch (InterruptedException e1) { LOGGER.error("Interupted", e1); } SessionState state = session.getSessionState(); if (!state.isReceivable()) { LOGGER.debug("Not sending delivery receipt for message id {} since session state is {}", messageId, state); return; } String stringValue = Integer.valueOf(messageId.getValue(), 16).toString(); try { DeliveryReceipt delRec = new DeliveryReceipt(stringValue, totalSubmitted, totalDelivered, new Date(), new Date(), DeliveryReceiptState.DELIVRD, "000", new String(shortMessage)); session.deliverShortMessage( "mc", sourceAddrTon, sourceAddrNpi, sourceAddress, destAddrTon, destAddrNpi, destAddress, new ESMClass(MessageMode.DEFAULT, MessageType.SMSC_DEL_RECEIPT, GSMSpecificFeature.DEFAULT), (byte)0, (byte)0, new RegisteredDelivery(0), DataCodings.ZERO, delRec.toString().getBytes()); LOGGER.debug("Sending delivery receipt for message id {}: {}", messageId, stringValue); } catch (Exception e) { LOGGER.error("Failed sending delivery_receipt for message id " + messageId + ":" + stringValue, e); } } }
public boolean containedIn(ESMClass esmClass) { return containedIn(esmClass.value()); }
public static void main(String[] args) throws Exception { SMPPSession session = null; // 1. initialize // 2. Initiate bind // 3. Set message receiver listener if needed // this is how to write "house" in arabic String house = "\u0628" + "\u064e" + "\u064a" + "\u0652" + "\u067a" + "\u064f"; TimeFormatter timeFormatter = new RelativeTimeFormatter(); // 4. Specify the data coding using UCS2 DataCoding dataCoding = new GeneralDataCoding(Alphabet.ALPHA_UCS2, MessageClass.CLASS1, false); // 5. UTF-16BE is equals to UCS2 byte[] data = house.getBytes("UTF-16BE"); // 6. Submit the short message String messageId = session.submitShortMessage("CMT", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "1616", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "628176504657", new ESMClass(), (byte)0, (byte)1, timeFormatter.format(new Date()), null, new RegisteredDelivery(SMSCDeliveryReceipt.DEFAULT), (byte)0, dataCoding, (byte)0, data); } }