code: public QuerySmResult queryShortMessage(String messageId,
              TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi,
              String sourceAddr) throws PDUException, ResponseTimeoutException,
              InvalidResponseException, NegativeResponseException, IOException {
          
          ensureTransmittable("queryShortMessage");
          
          QuerySmCommandTask task = new QuerySmCommandTask(pduSender(),
                  messageId, sourceAddrTon, sourceAddrNpi, sourceAddr);
          
          QuerySmResp resp = (QuerySmResp)executeSendCommand(task,
                  getTransactionTimer());
  
          if (resp.getMessageId().equals(messageId)) {
              return new QuerySmResult(resp.getFinalDate(), resp
                      .getMessageState(), resp.getErrorCode());
          } else {
              // message id requested not same as the returned
              throw new InvalidResponseException(
                      "Requested message_id doesn't match with the result");
          }
      }
docs: /* (non-Javadoc)
  @see org.jsmpp.session.ClientSession#queryShortMessage(java.lang.String, org.jsmpp.bean.TypeOfNumber, org.jsmpp.bean.NumberingPlanIndicator, java.lang.String)