Exemplo n.º 1
0
  /**
   * Starts a new InviteTransactionClient and initializes the dialog state information.
   *
   * @param callee the callee url (and display name)
   * @param caller the caller url (and display name)
   * @param contact the contact url OR the contact username
   * @param session_descriptor SDP body
   * @param icsi the ICSI for this session
   */
  public void invite(
      String callee,
      String caller,
      String contact,
      String session_descriptor,
      String icsi) { // modified by mandrajg
    printLog("inside invite(callee,caller,contact,sdp)", LogLevel.MEDIUM);
    if (!statusIs(D_INIT)) return;
    // else
    NameAddress to_url = new NameAddress(callee);
    NameAddress from_url = new NameAddress(caller);
    SipURL request_uri = to_url.getAddress();

    NameAddress contact_url = null;
    if (contact != null) {
      if (contact.indexOf("sip:") >= 0) contact_url = new NameAddress(contact);
      else
        contact_url =
            new NameAddress(
                new SipURL(contact, sip_provider.getViaAddress(), sip_provider.getPort()));
    } else contact_url = from_url;

    Message invite =
        MessageFactory.createInviteRequest(
            sip_provider,
            request_uri,
            to_url,
            from_url,
            contact_url,
            session_descriptor,
            icsi); // modified by mandrajg
    // do invite
    invite(invite);
  }