Package net.gescobar.smppserver.packet

Examples of net.gescobar.smppserver.packet.SubmitSm


      List<SmppPacket> packets = pp.getPackets(1, DEFAULT_TIMEOUT);
      Assert.assertNotNull(packets);
      Assert.assertEquals(packets.size(), 1);

      SubmitSm submitSM = (SubmitSm) packets.get(0);
      Assert.assertNotNull(submitSM);
      Assert.assertEquals(submitSM.getDestAddress().getAddress(), "3002175604");
      Assert.assertEquals(submitSM.getSourceAddress().getAddress(), "3542");
      Assert.assertEquals(submitSM.getDataCoding(), 3);

      Assert.assertEquals(submitSM.getShortMessage(), "This is the test with ñ");
    } finally {
      connector.doStop();
    }
  }
View Full Code Here


      SmppPacket packet = packets.get(0);
      Assert.assertNotNull(packet);
      Assert.assertEquals( packet.getCommandId(), SmppPacket.SUBMIT_SM );

      SubmitSm submitSm = (SubmitSm) packet;
      Assert.assertEquals( submitSm.getShortMessage(), "This is a long message to test how the smpp is working with long message splitting them by the 160 character and sending two messages. Finish the first message ");

      Tlv totalTlv = submitSm.getOptionalParameter(SmppConstants.TAG_SAR_TOTAL_SEGMENTS);
      Assert.assertNotNull(totalTlv);
      Assert.assertEquals(ByteArrayUtil.toByte(totalTlv.getValue()), 2);

      Tlv segmentTlv = submitSm.getOptionalParameter(SmppConstants.TAG_SAR_SEGMENT_SEQNUM);
      Assert.assertNotNull(segmentTlv);
      Assert.assertEquals(ByteArrayUtil.toByte(segmentTlv.getValue()), 1);

      Tlv msgRefTlv = submitSm.getOptionalParameter(SmppConstants.TAG_SAR_MSG_REF_NUM);
      Assert.assertNotNull(msgRefTlv);

      packet = packets.get(1);
      Assert.assertNotNull(packet);
      Assert.assertEquals( packet.getCommandId(), SmppPacket.SUBMIT_SM );

      submitSm = (SubmitSm) packet;
      Assert.assertEquals( submitSm.getShortMessage(), "This is the second message." );

      totalTlv = submitSm.getOptionalParameter(SmppConstants.TAG_SAR_TOTAL_SEGMENTS);
      Assert.assertNotNull(totalTlv);
      Assert.assertEquals(ByteArrayUtil.toByte(totalTlv.getValue()), 2);

      segmentTlv = submitSm.getOptionalParameter(SmppConstants.TAG_SAR_SEGMENT_SEQNUM);
      Assert.assertNotNull(segmentTlv);
      Assert.assertEquals(ByteArrayUtil.toByte(segmentTlv.getValue()), 2);

      msgRefTlv = submitSm.getOptionalParameter(SmppConstants.TAG_SAR_MSG_REF_NUM);
      Assert.assertNotNull(msgRefTlv);
    } finally {
      connector.doStop();
    }
  }
View Full Code Here

        responseSender.send( Response.OK );
        return;
      else if (packet.getCommandId() == SmppPacket.SUBMIT_SM) {

        SubmitSm submitSm = (SubmitSm) packet;

        Message message = new Message();
        message.setProperty("to", submitSm.getDestAddress().getAddress());
        message.setProperty("from", submitSm.getSourceAddress().getAddress());
        message.setProperty("text", submitSm.getShortMessage());
        message.setProperty("receiptDestination", context.getId());

        messageProducer.produce(message);

        try {
View Full Code Here

TOP

Related Classes of net.gescobar.smppserver.packet.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.