Logo Search packages:      
Sourcecode: kmess version File versions  Download package

void P2PApplication::gotSlpInvite ( const MimeMessage slpMimeMessage  )  [private]

Got an MSNSLP INVITE message

Definition at line 1034 of file p2papplication.cpp.

References contactStarted1_ContactInvitesUser(), MimeMessage::getBody(), MimeMessage::getValue(), and sendCancelMessage().

Referenced by gotNegotiationMessage().

  kdDebug() << "P2PApplication: Got SLP INVITE message" << endl;
  ASSERT( waitingState_ == P2P_WAIT_DEFAULT || waitingState_ == P2P_WAIT_FOR_FILE_DATA );

  // Reset the waiting state if this is the second INVITE for a file transfer
  if(waitingState_ == P2P_WAIT_FOR_FILE_DATA)
    waitingState_ = P2P_WAIT_DEFAULT;

  // Session invitation

  // Extract the fields of the message. This is required for userRejected()
  MimeMessage slpMimeContent(slpMimeMessage.getBody());

  // Set global fields from INVITE message.
  QString slpVia         = slpMimeMessage.getValue("Via");
  callID_                = slpMimeMessage.getValue("Call-ID");
  invitationCSeq_        = slpMimeMessage.getValue("CSeq").toInt();
  invitationContentType_ = slpMimeMessage.getValue("Content-Type");

  if(invitationContentType_ == "application/x-msnmsgr-sessionreqbody")
    invitationSessionID_ = slpMimeContent.getValue("SessionID").toULong();

  // Extract branch from the "Via" parameter
  QRegExp callRE(";branch=(.+)");     // don't use a guid-pattern here, msn6 seams to accept random strings.
  branch_ = callRE.cap(1);

  // Don't forget the initialize the base class

  // Indicate this is an SLP message (sendCancelMessage() uses this)
  // This value is reset once a message is sent.
  gotSlpMessage_ = true;

  // Validate the content type
  if(invitationContentType_ != "application/x-msnmsgr-sessionreqbody" &&
     invitationContentType_ != "application/x-msnmsgr-transreqbody")
    kdWarning() << "P2PApplication: Received unexpected Content-Type: " << invitationContentType_ << "." << endl;

    // Indicate we don't like that content-type:
    // Don't QUIT, the error will be ACK-ed.

  // Extract the body of the SLP message
  MimeMessage slpContent(slpMimeMessage.getBody());

  // Tell the derived class we've got an invitation

Generated by  Doxygen 1.6.0   Back to index