Package net.gescobar.smppserver.packet

Examples of net.gescobar.smppserver.packet.Address


      SmppSession session = server.getSessions().iterator().next();
      Assert.assertNotNull(session);

      // create and send the request
      DeliverSm deliverSM = new DeliverSm();
      deliverSM.setDestAddress(new Address((byte) 0, (byte) 0, to));
      deliverSM.setSourceAddress(new Address((byte) 0, (byte) 0, from));
      deliverSM.setShortMessage(text.getBytes());

      session.sendRequest(deliverSM);

      long timeout = 2000;
View Full Code Here


      SmppSession session = server.getSessions().iterator().next();
      Assert.assertNotNull(session);

      DeliverSm deliverSM = new DeliverSm();
      deliverSM.setEsmClass(SmppConstants.ESM_CLASS_MT_SMSC_DELIVERY_RECEIPT);
      deliverSM.setDestAddress(new Address((byte) 0, (byte) 0, from));
      deliverSM.setSourceAddress(new Address((byte) 0, (byte) 0, to));
      deliverSM.setShortMessage("id:12000 sub:1 dlvrd:1 submit date:1101010000 done date:1101010000 stat:DELIVRD err:0 text:This is a ... ".getBytes());

      session.sendRequest(deliverSM);

      long timeout = 2000;
View Full Code Here

      SmppSession session = server.getSessions().iterator().next();
      Assert.assertNotNull(session);

      DeliverSm deliverSM = new DeliverSm();
      deliverSM.setEsmClass(SmppConstants.ESM_CLASS_MT_SMSC_DELIVERY_RECEIPT);
      deliverSM.setDestAddress(new Address((byte) 0, (byte) 0, "3002175604"));
      deliverSM.setSourceAddress(new Address((byte) 0, (byte) 0, "3542"));
      deliverSM.setShortMessage("id:16fee0e525 sub:1 dlvrd:1 submit date:1101010000 done date:1101010000 stat:DELIVRD err:0 text:This is a ... ".getBytes());

      session.sendRequest(deliverSM);

      long timeout = 2000;
View Full Code Here

      SmppSession session = server.getSessions().iterator().next();
      Assert.assertNotNull(session);

      DeliverSm deliverSM = new DeliverSm();
      deliverSM.setEsmClass(SmppConstants.ESM_CLASS_MT_SMSC_DELIVERY_RECEIPT);
      deliverSM.setDestAddress(new Address((byte) 0, (byte) 0, "3002175604"));
      deliverSM.setSourceAddress(new Address((byte) 0, (byte) 0, "3542"));
      deliverSM.setShortMessage("id:98765432101 sub:1 dlvrd:1 submit date:1101010000 done date:1101010000 stat:DELIVRD err:0 text:This is a ... ".getBytes());

      session.sendRequest(deliverSM);

      long timeout = 2000;
View Full Code Here

      messageStore.saveOrUpdate(message);

      DeliverSm deliverSm = new DeliverSm();
      deliverSm.setEsmClass(SmppConstants.ESM_CLASS_MT_SMSC_DELIVERY_RECEIPT);
      deliverSm.setDestAddress(new Address((byte) 0, (byte) 0, "3002175604"));
      deliverSm.setSourceAddress(new Address((byte) 0, (byte) 0, "3542"));
      deliverSm.setShortMessage("id:12000 sub:1 dlvrd:1 submit date:1101010000 done date:1101010000 stat:DELIVRD err:0 text:This is a ... ".getBytes());

      // retrieve the session
      Assert.assertEquals(server.getSessions().size(), 1);
      SmppSession session = server.getSessions().iterator().next();
View Full Code Here

    DeliverSm deliverSm = new DeliverSm();

    boolean isDLR = message.getProperty("isDLR", Boolean.class) == null ? false : message.getProperty("isDLR", Boolean.class) == true;
    if (isDLR) {
      deliverSm.setEsmClass((byte) 0x04);
      deliverSm.setSourceAddress(new Address().withAddress(message.getProperty("from", String.class)));
      deliverSm.setDestAddress(new Address().withAddress(message.getProperty("to", String.class)));

      SimpleDateFormat sdf = new SimpleDateFormat("yyMMddhhmm");

      StringBuffer text = new StringBuffer();
      text.append( "id:" + message.getProperty("messageId", String.class) + " " );
      text.append( "sub:" + fixTo(message.getProperty("submitted", Integer.class), 3) + " " );
      text.append( "dlvrd:" + fixTo(message.getProperty("delivered", Integer.class), 3) + " " );
      String strSubmitDate = message.getProperty("submitDate", Date.class) == null ? "" : sdf.format(message.getProperty("submitDate", Date.class));
      text.append( "submit date:" + strSubmitDate + " " );
      String strDoneDate = message.getProperty("doneDate", Date.class) == null ? "" : sdf.format(message.getProperty("doneDate", Date.class));
      text.append( "done date:" + strDoneDate + " " );
      text.append( "stat:" + message.getProperty("finalStatus", String.class) + " " );
      text.append( "err:0 ");
      text.append( "text:                    " );

      deliverSm.setShortMessage(CharsetUtil.encode(text.toString(), CharsetUtil.CHARSET_GSM));
    } else {
      deliverSm.setSourceAddress(new Address().withAddress(message.getProperty("from", String.class)));
      deliverSm.setDestAddress(new Address().withAddress(message.getProperty("to", String.class)));
      deliverSm.setShortMessage(CharsetUtil.encode(message.getProperty("text", String.class), CharsetUtil.CHARSET_GSM));
    }

    Collection<SmppSession> sessions = smppServer.getSessions();
    for (SmppSession session : sessions) {
View Full Code Here

TOP

Related Classes of net.gescobar.smppserver.packet.Address

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.