Examples of DeliverSM


Examples of com.cloudhopper.smpp.pdu.DeliverSm

        // any command id with its 31st bit set to true is a response
        if (PduUtil.isRequestCommandId(commandId)) {
            if (commandId == SmppConstants.CMD_ID_ENQUIRE_LINK) {
                pdu = new EnquireLink();
            } else if (commandId == SmppConstants.CMD_ID_DELIVER_SM) {
                pdu = new DeliverSm();
            } else if (commandId == SmppConstants.CMD_ID_SUBMIT_SM) {
                pdu = new SubmitSm();
            } else if (commandId == SmppConstants.CMD_ID_DATA_SM) {
                pdu = new DataSm();
            } else if (commandId == SmppConstants.CMD_ID_CANCEL_SM) {
View Full Code Here

Examples of com.logica.smpp.pdu.DeliverSM

    }
    else {
      myLog.error ("receive - received pdu: {}", pdu.debugString ());
      response.setCommand (SmppCommandType.decode (pdu.getCommandId ()));
      if (pdu instanceof DeliverSM) {
        DeliverSM deliver = (DeliverSM)pdu;
        updateResponse (response, deliver);

        // send DeliverSMResp
        try {
          getSession ().respond (deliver.getResponse ());
        }
        catch (ValueNotSetException exc) {
          myLog.error ("receive - value not set", exc);
          return false;
        }
View Full Code Here

Examples of com.logica.smpp.pdu.DeliverSM

   * @param event The {@link com.logica.smpp.ServerPDUEvent} should contain
   *              a {@link com.logica.smpp.pdu.DeliverSM} PDU.
   */
  protected void handleDeliverEvent (ServerPDUEvent event)
  {
    DeliverSM pdu = (DeliverSM)(event.getPDU ());
    myLog.debug ("handleDeliverEvent - async response: {}", pdu.debugString ());
    try {
      mySession.respond (pdu.getResponse ());
    }
    catch (ValueNotSetException exc) {
      myLog.error ("handleDeliverEvent - exception in pdu", exc);
    }
    catch (WrongSessionStateException exc) {
View Full Code Here

Examples of ie.omk.smpp.message.DeliverSM

    SMPPPacket packet = connection.readNextPacket();
    Assert.assertNotNull(packet);
    Assert.assertEquals(packet.getCommandId(), SMPPPacket.DELIVER_SM);

    DeliverSM deliverSm = (DeliverSM) packet;
    Assert.assertEquals(deliverSm.getEsmClass(), (byte) 0);
    Assert.assertEquals(deliverSm.getSource().getAddress(), "2222");
    Assert.assertEquals(deliverSm.getDestination().getAddress(), "1111");
    Assert.assertEquals(deliverSm.getMessageText(), "This is a test");

    connector.doStop();
  }
View Full Code Here

Examples of net.gescobar.smppserver.packet.DeliverSm

      Assert.assertEquals(server.getSessions().size(), 1);
      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;
      if (!receiveMessage(messageProducer, timeout)) {
View Full Code Here

Examples of org.jsmpp.bean.DeliverSm

    }
   
    static void processDeliverSm0(Command pduHeader, byte[] pdu,
            ResponseHandler responseHandler) throws IOException {
        try {
            DeliverSm deliverSm = pduDecomposer.deliverSm(pdu);
            responseHandler.processDeliverSm(deliverSm);
            responseHandler.sendDeliverSmResp(pduHeader.getSequenceNumber());
        } catch (PDUStringException e) {
            logger.error("Failed decomposing deliver_sm", e);
            responseHandler.sendNegativeResponse(pduHeader.getCommandId(), e
View Full Code Here

Examples of org.jsmpp.bean.DeliverSm

        assertSame(ExchangePattern.InOut, exchange.getPattern());
    }

    @Test
    public void createOnAcceptDeliverSmExchange() throws Exception {
        DeliverSm deliverSm = createMock(DeliverSm.class);
        SmppMessage message = createMock(SmppMessage.class);
        expect(binding.createSmppMessage(deliverSm)).andReturn(message);
        message.setExchange(isA(Exchange.class));
       
        replay(deliverSm, binding, message);
View Full Code Here

Examples of org.jsmpp.bean.DeliverSm

        assertSame(ExchangePattern.InOnly, exchange.getPattern());
    }

    @Test
    public void createOnAcceptDeliverSmWithExchangePattern() throws Exception {
        DeliverSm deliverSm = createMock(DeliverSm.class);
        SmppMessage message = createMock(SmppMessage.class);
        expect(binding.createSmppMessage(deliverSm)).andReturn(message);
        message.setExchange(isA(Exchange.class));
       
        replay(deliverSm, binding, message);
View Full Code Here

Examples of org.jsmpp.bean.DeliverSm

        assertEquals(SmppMessageType.AlertNotification.toString(), smppMessage.getHeader(SmppConstants.MESSAGE_TYPE));
    }

    @Test
    public void createSmppMessageFromDeliveryReceiptShouldReturnASmppMessage() throws Exception {
        DeliverSm deliverSm = new DeliverSm();
        deliverSm.setSmscDeliveryReceipt();
        deliverSm.setShortMessage("id:2 sub:001 dlvrd:001 submit date:0908312310 done date:0908312311 stat:DELIVRD err:xxx Text:Hello SMPP world!".getBytes());
        SmppMessage smppMessage = binding.createSmppMessage(deliverSm);
       
        assertEquals("Hello SMPP world!", smppMessage.getBody());
        assertEquals(8, smppMessage.getHeaders().size());
        assertEquals("2", smppMessage.getHeader(SmppConstants.ID));
View Full Code Here

Examples of org.jsmpp.bean.DeliverSm

        assertEquals(SmppMessageType.DeliveryReceipt.toString(), smppMessage.getHeader(SmppConstants.MESSAGE_TYPE));
    }
   
    @Test
    public void createSmppMessageFromDeliverSmShouldReturnASmppMessage() throws Exception {
        DeliverSm deliverSm = new DeliverSm();
        deliverSm.setShortMessage("Hello SMPP world!".getBytes());
        deliverSm.setSequenceNumber(1);
        deliverSm.setCommandId(1);
        deliverSm.setSourceAddr("1818");
        deliverSm.setSourceAddrNpi(NumberingPlanIndicator.NATIONAL.value());
        deliverSm.setSourceAddrTon(TypeOfNumber.NATIONAL.value());
        deliverSm.setDestAddress("1919");
        deliverSm.setDestAddrNpi(NumberingPlanIndicator.INTERNET.value());
        deliverSm.setDestAddrTon(TypeOfNumber.NETWORK_SPECIFIC.value());
        deliverSm.setScheduleDeliveryTime("090831230627004+");
        deliverSm.setValidityPeriod("090901230627004+");
        deliverSm.setServiceType("WAP");
        SmppMessage smppMessage = binding.createSmppMessage(deliverSm);
       
        assertEquals("Hello SMPP world!", smppMessage.getBody());
        assertEquals(12, smppMessage.getHeaders().size());
        assertEquals(1, smppMessage.getHeader(SmppConstants.SEQUENCE_NUMBER));
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.