예제 #1
0
 /**
  * Responds with <i>code</i> and <i>reason</i>. This method can be called when the InviteDialog is
  * in D_INVITED, D_ReINVITED states
  */
 public void respond(
     int code, String reason, int expires, String contact, String content_type, String body) {
   printLog("inside respond(" + code + "," + reason + ")", LogLevel.MEDIUM);
   NameAddress contact_url = null;
   if (contact != null) contact_url = new NameAddress(contact);
   Message resp =
       MessageFactory.createResponse(
           subscribe_req, code, SipResponses.reasonOf(code), contact_url);
   if (expires >= 0) resp.setExpiresHeader(new ExpiresHeader(expires));
   if (body != null) resp.setBody(content_type, body);
   respond(resp);
 }