1

I want to send wap-push message over smpp, using jsmpp library. I found some material, but it is not working. Can someone explain me, what is the technology for sending wap-push message?

totali
  • 260
  • 6
  • 22

2 Answers2

2

in the jsmpp, you need to set esmclass to 64 and datacoding to 245.

Jasonw
  • 5,054
  • 7
  • 43
  • 48
  • @Jasonw, I do it, but I don't know where can I write text & hyperlink? I know the right PDU format. In JSMPP how can I send this PDU? – totali Jun 01 '11 at 04:09
  • if you have the right PDU, then the text and url is *within* the pdu, and the method submitShortMessage should be able to send this pdu. – Jasonw Jun 01 '11 at 08:50
  • @Jasonw, sorry I don't clearly understand you. Example, [code] String pdu = "060504{ans so}"; session.submitShortMessage("CMT",TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN,"1111", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "+994111111111", new ESMClass(64), (byte) 0, (byte) 1, timeFormatter.format(new Date()), null, registeredDelivery, (byte) 0, new GeneralDataCoding(245), (byte) 0, pdu); [/code] Is it correct? – totali Jun 01 '11 at 12:00
  • No. a) your example pdu is incorrect. b) the hex string pdu need to be converted to byte[]. there is a HexUtil class and method convertHexStringToBytes. You can use this and convert the hex string to byte. – Jasonw Jun 02 '11 at 02:32
  • 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("0605040B8423F025060803AE81EAAF82B48401056A0045C60D036578616D706C652E636F6D0007010377656C636F6D6520746F207761702073697465000101")); – Jasonw Jun 02 '11 at 02:36
  • I have got a error like this: https://stackoverflow.com/questions/68473714/jsmpp-negative-response-00000001-message-length-is-invalid-found, any ideas? please – Fernando Pie Jul 22 '21 at 15:11
0

There is no valid constructor for GeneralDataCoding(245) so I added a piece of code to GenrealDataCodin.java to resolve it.

public GeneralDataCoding(int i) {
    this.directvalue = (byte)i;
    directValueFlag = true;

    this.alphabet = Alphabet.ALPHA_DEFAULT;
    this.messageClass = MessageClass.CLASS0;
    this.compressed = true;
}

public byte toByte() {
    if(directValueFlag == true){
        value = directvalue;
    }
    else{
        byte value = compressed ? DataCodingFactory00xx.MASK_COMPRESSED : 0;
        value |= alphabet.value();
        if (messageClass != null) {
            value |= DataCodingFactory00xx.MASK_CONTAIN_MESSAGE_CLASS;
            value |= messageClass.value();
        }
    }  
FIDIL
  • 117
  • 1
  • 4
  • 14
  • Is there another way to set datacoding to 245, it is because I think you have recompiled from source to add this contructor, so – Fernando Pie Jul 15 '21 at 02:39
  • public byte toByte() { if(directValueFlag == true){ value = directvalue; } else{ byte value = compressed ? DataCodingFactory00xx.MASK_COMPRESSED : 0; value |= alphabet.value(); if (messageClass != null) { value |= DataCodings.MASK_CONTAIN_MESSAGE_CLASS; value |= messageClass.value(); } return value; } Really works? – Fernando Pie Jul 19 '21 at 04:16