Examples of SMPPPacket


Examples of ie.omk.smpp.message.SMPPPacket

               }
            }
            next = (Object) packets.remove(0);
        }

        SMPPPacket pak = (SMPPPacket) next;
        if (pak instanceof SMPPResponse) {
            synchronized (this) {
                try {
                    if (requestSent < 1) {
                        this.wait((long) timeout);
                    }
               } catch (InterruptedException x) {
                    throw new IOException("No packets available.");
               }
            }

            // Simulate a timeout..
            if (requestSent < 1) {
                throw new SocketTimeoutException("Timed out waiting on packet");
            }
        }

        int l = pak.getLength();
        out.setBuf(buf, l);
        pak.writeTo(out);

        return out.getBuf();
    }
View Full Code Here

Examples of ie.omk.smpp.message.SMPPPacket

     *         representing SMPP command <code>id</code>.
     * @throws ie.omk.smpp.BadCommandIDException
     *             if the command ID is not recognized.
     */
    public static SMPPPacket newInstance(int id) throws BadCommandIDException {
        SMPPPacket response = null;

        switch (id) {
        case SMPPPacket.GENERIC_NACK:
            response = new GenericNack();
            break;
View Full Code Here

Examples of net.gescobar.smppserver.packet.SmppPacket

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

      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);
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.