Package net.sf.jml.protocol.msnslp

Examples of net.sf.jml.protocol.msnslp.MsnslpMessage


    public void startFileTransfer()
    {
        if(fileTransfer.isReceiver())
        {
            MsnslpMessage msnslpRequest = fileTransfer.getReqMessage().getSlpMessage();
            MsnslpResponse okSlpMessage = new MsnslpResponse();
            okSlpMessage.setTo(msnslpRequest.getFrom());
            okSlpMessage.setFrom(msnslpRequest.getTo());
            okSlpMessage.setVia(msnslpRequest.getVia());
            okSlpMessage.setCSeq(msnslpRequest.getCSeq() + 1);
            okSlpMessage.setCallId(msnslpRequest.getCallId());
            okSlpMessage.setMaxForwards(msnslpRequest.getMaxForwards());
            okSlpMessage.setContentType(msnslpRequest.getContentType());

            StringHolder body = new StringHolder();
            body.setProperty("SessionID", fileTransfer.getID());

            okSlpMessage.setBody(body.toString() + JmlConstants.LINE_SEPARATOR
View Full Code Here


        }
    }

    private void sendDecline()
    {
        MsnslpMessage msnslpRequest =
            fileTransfer.getReqMessage().getSlpMessage();

        MsnslpResponse okSlpMessage = new MsnslpResponse();
        okSlpMessage.setStatusCode(603);
        okSlpMessage.setReasonPhrase("Decline");
        okSlpMessage.setTo(msnslpRequest.getFrom());
        okSlpMessage.setFrom(msnslpRequest.getTo());
        okSlpMessage.setVia(msnslpRequest.getVia());
        okSlpMessage.setCSeq(msnslpRequest.getCSeq() + 1);
        okSlpMessage.setCallId(msnslpRequest.getCallId());
        okSlpMessage.setMaxForwards(msnslpRequest.getMaxForwards());
        okSlpMessage.setContentType(msnslpRequest.getContentType());

        StringHolder body = new StringHolder();
        body.setProperty("SessionID", fileTransfer.getID());
        okSlpMessage.setBody(body.toString() + JmlConstants.LINE_SEPARATOR
                + "\0");
View Full Code Here

      sessionId == 0 &&
      totalLength == currentLength) {
      MsnP2PSlpMessage slpMessage = new MsnP2PSlpMessage();
      slpMessage.parseMessage(message);

      MsnslpMessage msg = slpMessage.getSlpMessage();
      if (msg instanceof MsnslpRequest) {
        MsnslpRequest msnslpRequest = (MsnslpRequest) slpMessage
            .getSlpMessage();
        if (msnslpRequest.getRequestMethod() != null &&
          msnslpRequest.getRequestMethod().
                equals(MsnP2PByeMessage.METHOD_BYE)) {
          return new MsnP2PByeMessage();
        }
        if (msnslpRequest.getRequestMethod() != null
            && msnslpRequest.getRequestMethod().
                equals(MsnP2PInvitationMessage.METHOD_INVITE)) {
          return new MsnP2PInvitationMessage();
        }
      }
      return slpMessage;
    }

        if(flag == MsnP2PMessage.FLAG_OLD_NONE)
        {
            MsnP2PSlpMessage slpMessage = new MsnP2PSlpMessage();
      slpMessage.parseMessage(message);

      MsnslpMessage msg = slpMessage.getSlpMessage();
      if (msg instanceof MsnslpRequest)
            {
        MsnslpRequest msnslpRequest = (MsnslpRequest) slpMessage
            .getSlpMessage();
                if (msnslpRequest.getRequestMethod() == null)
View Full Code Here

    if ((flag == MsnP2PMessage.FLAG_NONE || flag==MsnP2PMessage.FLAG_OLD_NONE)&&
      sessionId == 0 &&
      totalLength == currentLength) {
      MsnP2PSlpMessage slpMessage = new MsnP2PSlpMessage();
      slpMessage.parseMessage(message);
      MsnslpMessage msg = slpMessage.getSlpMessage();
      if (msg instanceof MsnslpRequest) {
        MsnslpRequest msnslpRequest = (MsnslpRequest) slpMessage
            .getSlpMessage();
        if (msnslpRequest.getRequestMethod() != null &&
          msnslpRequest.getRequestMethod().
                equals(MsnP2PByeMessage.METHOD_BYE)) {
          return new MsnP2PByeMessage();
        }
        if (msnslpRequest.getRequestMethod() != null
            && msnslpRequest.getRequestMethod().
                equals(MsnP2PInvitationMessage.METHOD_INVITE)) {
            return new MsnP2PInvitationMessage();
        }
      }
      return slpMessage;
    }

        if(flag == MsnP2PMessage.FLAG_OLD_NONE)
        {
            MsnP2PSlpMessage slpMessage = new MsnP2PSlpMessage();
      slpMessage.parseMessage(message);

      MsnslpMessage msg = slpMessage.getSlpMessage();
      if (msg instanceof MsnslpRequest)
            {
        MsnslpRequest msnslpRequest = (MsnslpRequest) slpMessage
            .getSlpMessage();
                if (msnslpRequest.getRequestMethod() == null)
View Full Code Here

    public void startFileTransfer()
    {
        if(fileTransfer.isReceiver())
        {
            MsnslpMessage msnslpRequest = fileTransfer.getReqMessage().getSlpMessage();
            MsnslpResponse okSlpMessage = new MsnslpResponse();
            okSlpMessage.setTo(msnslpRequest.getFrom());
            okSlpMessage.setFrom(msnslpRequest.getTo());
            okSlpMessage.setVia(msnslpRequest.getVia());
            okSlpMessage.setCSeq(msnslpRequest.getCSeq() + 1);
            okSlpMessage.setCallId(msnslpRequest.getCallId());
            okSlpMessage.setMaxForwards(msnslpRequest.getMaxForwards());
            okSlpMessage.setContentType(msnslpRequest.getContentType());

            StringHolder body = new StringHolder();
            body.setProperty("SessionID", fileTransfer.getID());

            okSlpMessage.setBody(body.toString() + JmlConstants.LINE_SEPARATOR
View Full Code Here

        }
    }

    private void sendDecline()
    {
        MsnslpMessage msnslpRequest =
            fileTransfer.getReqMessage().getSlpMessage();

        MsnslpResponse okSlpMessage = new MsnslpResponse();
        okSlpMessage.setStatusCode(603);
        okSlpMessage.setReasonPhrase("Decline");
        okSlpMessage.setTo(msnslpRequest.getFrom());
        okSlpMessage.setFrom(msnslpRequest.getTo());
        okSlpMessage.setVia(msnslpRequest.getVia());
        okSlpMessage.setCSeq(msnslpRequest.getCSeq() + 1);
        okSlpMessage.setCallId(msnslpRequest.getCallId());
        okSlpMessage.setMaxForwards(msnslpRequest.getMaxForwards());
        okSlpMessage.setContentType(msnslpRequest.getContentType());

        StringHolder body = new StringHolder();
        body.setProperty("SessionID", fileTransfer.getID());
        okSlpMessage.setBody(body.toString() + JmlConstants.LINE_SEPARATOR
                + "\0");
View Full Code Here

        .getActualMsnProtocol());
        for (OutgoingMSG anOutgoing : outgoing) {
            session.sendSynchronousMessage(anOutgoing);
        }

        MsnslpMessage msnslpRequest = message.getSlpMessage();
    MsnslpResponse okSlpMessage = new MsnslpResponse();
    okSlpMessage.setTo(msnslpRequest.getFrom());
    okSlpMessage.setFrom(msnslpRequest.getTo());
    okSlpMessage.setVia(msnslpRequest.getVia());
    okSlpMessage.setCSeq(msnslpRequest.getCSeq() + 1);
    okSlpMessage.setCallId(msnslpRequest.getCallId());
    okSlpMessage.setMaxForwards(msnslpRequest.getMaxForwards());
    okSlpMessage.setContentType(msnslpRequest.getContentType());
    sessionId = msnslpRequest.getBodys().getIntProperty("SessionID", -1);
    StringHolder body = new StringHolder();
    body.setProperty("SessionID", sessionId);
    okSlpMessage.setBody(body.toString() + JmlConstants.LINE_SEPARATOR
        + "\0");
View Full Code Here

   *
   * @param invite Original invitation message.
   */
  private void sendDirectConnectionDeny(MsnP2PInvitationMessage invite) {

        MsnslpMessage msnslpRequest = invite.getSlpMessage();
    MsnslpResponse okSlpMessage = new MsnslpResponse();
    okSlpMessage.setStatusCode(405);
    okSlpMessage.setReasonPhrase("Not supported");
    okSlpMessage.setTo(msnslpRequest.getFrom());
    okSlpMessage.setFrom(msnslpRequest.getTo());
    okSlpMessage.setVia(msnslpRequest.getVia());
    okSlpMessage.setCSeq(msnslpRequest.getCSeq() + 1);
    okSlpMessage.setCallId(msnslpRequest.getCallId());
    okSlpMessage.setMaxForwards(msnslpRequest.getMaxForwards());
    okSlpMessage.setContentType(msnslpRequest.getContentType());
   
    StringHolder body = new StringHolder();
    body.setProperty("SessionID", transferSessionId);
    okSlpMessage.setBody(body.toString() + JmlConstants.LINE_SEPARATOR
        + "\0");
View Full Code Here

TOP

Related Classes of net.sf.jml.protocol.msnslp.MsnslpMessage

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.