Ejemplo 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);
  }
Ejemplo n.º 2
0
 /**
  * Re-invites the remote user.
  *
  * <p>Starts a new InviteTransactionClient and changes the dialog state information
  *
  * <p>Parameters: <br>
  * - contact : the contact url OR the contact username; if null, the previous contact is used <br>
  * - session_descriptor : the message body
  */
 public void reInvite(String contact, String session_descriptor) {
   printLog("inside reInvite(contact,sdp)", LogLevel.MEDIUM);
   if (!statusIs(D_CALL)) return;
   // else
   Message invite = MessageFactory.createInviteRequest(this, session_descriptor);
   if (contact != null) {
     NameAddress contact_url;
     if (contact.indexOf("sip:") >= 0) contact_url = new NameAddress(contact);
     else
       contact_url =
           new NameAddress(
               new SipURL(contact, sip_provider.getViaAddress(), sip_provider.getPort()));
     invite.setContactHeader(new ContactHeader(contact_url));
   }
   reInvite(invite);
 }