@SuppressWarnings("rawtypes")
		@Override
        public PduResponse firePduRequestReceived(PduRequest pduRequest) {   
        	// Check receiver type
        	if(config.get("type").equals("MO")){
        		//Process MO parse
                // Check type of PDU
                if (pduRequest.getCommandId() == SmppConstants.CMD_ID_DELIVER_SM) {
                	// Parse MO and build JSON payload
                    DeliverSm mo = (DeliverSm) pduRequest;
                    // Get Sender
                    Address source_address = mo.getSourceAddress();
                    // Get Recipient
                    Address dest_address = mo.getDestAddress();
                    // Get message to be parsed.
                    byte[] shortMessage = mo.getShortMessage();
                    // Bytes to String
                    String SMS = new String(shortMessage);
                    // Object containing complete MO
                    MobileOriginated mobileOriginated = new MobileOriginated(source_address.getAddress(), dest_address.getAddress(), SMS);
                    // Create Beanstalk Client
                    BeanStalkHandler beanstalkc = new BeanStalkHandler((String) config.get("beanstalk_host"), (int) config.get("beanstalk_port"), (String) config.get("beanstalk_tube"));
                    // Object to JSON
                    Gson gson = new Gson();
                	String jsonMO = gson.toJson(mobileOriginated);
                	// Push to Beanstalk
                    beanstalkc.push(jsonMO);
                }
        	}else if(config.get("type").equals("MT")){
                // Check type of PDU
                if (pduRequest.getCommandId() == SmppConstants.CMD_ID_DELIVER_SM) {
                	// Parse MO and build JSON payload
                    DeliverSm mo = (DeliverSm) pduRequest;
                    // DeliveryReport object
                    DeliveryReport dr = null;
                    // Get Recipient
                    Address source_address = mo.getSourceAddress();
                    // Get message to be parsed.
                    byte[] shortMessage = mo.getShortMessage();
                    // Bytes to String
                    String DLR = new String(shortMessage); 
                    // Split ""
                    String[]  splitter = DLR.split(" ");
                    // length should be > 5
                    if(splitter.length > 5){
                    	// hex to dec
                    	int hToD = Integer.parseInt(splitter[1], 16);
                    	int bToD = splitter[3].equals("false")?0:1;
                    	dr = new DeliveryReport(source_address.getAddress(), Integer.toString(hToD), Integer.toString(bToD), splitter[5]);	
                    }
                    
                    // Create Beanstalk Client
                    BeanStalkHandler beanstalkc = new BeanStalkHandler((String) config.get("beanstalk_host"), (int) config.get("beanstalk_port"), (String) config.get("beanstalk_tube"));
                    // Object to JSON
                    Gson gson = new Gson();
                    if(dr != null){
                    	String jsonMT = gson.toJson(dr);
                    	// Push to Beanstalk
                        beanstalkc.push(jsonMT);                    	
                    }
                }        		
        	}

  
            // PDU Acknowledgement
            PduResponse response = pduRequest.createResponse();
            return response;
        }