001: /**
002: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
003: * Unpublished - rights reserved under the Copyright Laws of the United States.
004: * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
005: * Copyright © 2005 BEA Systems, Inc. All rights reserved.
006: *
007: * Use is subject to license terms.
008: *
009: * This distribution may include materials developed by third parties.
010: *
011: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
012: *
013: * Module Name : JSIP Specification
014: * File Name : Response.java
015: * Author : Phelim O'Doherty
016: *
017: * HISTORY
018: * Version Date Author Comments
019: * 1.1 08/10/2002 Phelim O'Doherty Initial version
020: *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
021: */package javax.sip.message;
022:
023: import java.text.ParseException;
024:
025: /**
026: * A Response message is sent by a recipient of Request once it has received
027: * and interpreted the Request. Responses are contain a Status-Code and a
028: * Reason-Phrase, as well as Headers and a possible message body.
029: * <p>
030: * The Status-Code is a 3-digit integer result code that indicates the
031: * outcome of the attempt to understand and satisfy the Request. The
032: * Reason-Phrase is intended to give a short textual description of the
033: * Status-Code. The Status-Code is intended for use by automata, whereas
034: * the Reason-Phrase is intended for the human user. The client is not
035: * required to examine or display the Reason-Phrase.
036: * <p>
037: * RFC3261 defines status codes in the following classes:
038: * <ul>
039: * <li><b>1xx: Provisional</b> -- request received, continuing to process the request;
040: * Provisional responses, also known as informational responses, indicate that
041: * the server contacted is performing some further action and does not yet have
042: * a definitive response.
043: * <ul>
044: * <li> This specification also supports the delivery of reliable provisional responses as defined in
045: * <a href = "http://www.ietf.org/rfc/rfc3262.txt">RFC 3262</a>. When
046: * the UAC creates a new request, it can insist on reliable delivery of
047: * provisional responses for that request. To do that, it inserts a Require
048: * header field with the option tag 100rel into the request. A Require header
049: * with the value <code>100rel</code> MUST NOT be present in any requests excepting INVITE,
050: * although other extensions to SIP may allow its usage with other request
051: * methods. If the UAC does not wish to insist on usage of reliable provisional
052: * responses, but merely indicate that it supports them if the UAS needs to send
053: * one, a Supported header MUST be included in the request with the option tag
054: * <code>100rel</code>. The UAC SHOULD include this in all INVITE requests.
055: * <p>
056: * A UAS MAY send any non-100 provisional response to INVITE reliably, so long
057: * as the initial INVITE request (the request whose provisional response is
058: * being sent reliably) contained a Supported header field with the option tag
059: * <code>100rel</code>. The provisional response to be sent reliably is
060: * constructed by the UAS and MUST contain a Require header field containing
061: * the option tag <code>100rel</code>, and MUST include an RSeq header field.
062: * Retransmissions of the reliable provisional response cease when a
063: * matching PRACK is received by the UA core. PRACK is like any other request
064: * within a dialog, and is treated likewise. A matching PRACK is defined as one
065: * within the same dialog as the response, and whose method, CSeq-num, and
066: * RSeq-num in the RAck header field match, respectively, the method and
067: * sequence number from the CSeq and the sequence number from the RSeq of the
068: * reliable provisional response.
069: * </ul>
070: * <li><b>2xx: Success</b> -- the action was successfully received, understood, and
071: * accepted.
072: * <li><b>3xx: Redirection</b> -- further action needs to be taken in order to
073: * complete the request; 3xx responses give information about the user's new
074: * location, or about alternative services that might be able to satisfy the call.
075: * <li><b>4xx: Client Error</b> -- the request contains bad syntax or cannot be
076: * fulfilled at this server; 4xx responses are definite failure responses from
077: * a particular server. The client SHOULD NOT retry the same request without
078: * modification. However, the same request to a different server might be
079: * successful.
080: * <li><b>5xx: Server Error</b> -- the server failed to fulfill an apparently valid
081: * request; 5xx responses are failure responses given when a server itself has
082: * erred.
083: * <li><b>6xx: Global Failure</b> -- the request cannot be fulfilled at any server;
084: * 6xx responses indicate that a server has definitive information about a
085: * particular user, not just the particular instance indicated in the Request-URI.
086: * </ul>
087: * SIP status codes are extensible. The response codes are consistent with, and
088: * extend, <a href = "http://www.ietf.org/rfc/rfc2616.txt">HTTP/1.1</a> response codes. Not all HTTP/1.1 response codes are
089: * appropriate, and only those that are appropriate are given here. Other
090: * HTTP/1.1 response codes SHOULD NOT be used. Also, SIP defines a new class,
091: * 6xx.
092: * <p>
093: * SIP applications are not required to understand the meaning of all
094: * registered response codes, though such understanding is obviously desirable.
095: * However, applications must understand the class of any status code, as
096: * indicated by the first digit and outlined above. Applications treat any
097: * unrecognized status code as being equivalent to the x00 status code of that
098: * class, with the exception that an unrecognized status code must not be
099: * cached. For example, if a client receives an unrecognized status code of 431,
100: * it can safely assume that there was something wrong with its request and
101: * treat the Response as if it had received a BAD_REQUEST(400) status code. In
102: * such cases, user agents should present to the user the message body returned
103: * with the Response, since that message body is likely to include
104: * human-readable information which will explain the unusual status.
105: * <p>
106: * This specification supports the response codes defined in RFC3261 and also the response
107: * code extensions for the event notification framework and PUBLISH, documented in
108: * <a href = "http://www.ietf.org/rfc/rfc3262.txt">RFC3265</a> and
109: * <a href = "http://www.ietf.org/rfc/rfc3909.txt">RFC3909</a>, these are
110: * highlighted in italic. Class status codes (x00, i.e. 100) are are highlighted
111: * in bold.
112: * </p>
113: * <table BORDER WIDTH="75%" >
114: * <tr>
115: * <td><b>Class</b></td>
116: * <td><b>Code</b></td>
117: * </tr>
118: * <tr>
119: * <td>PROVISIONAL (1xx)</td>
120: * <td>
121: * <LI><b>TRYING - 100</b></LI>
122: * <LI>RINGING - 180</LI>
123: * <LI>CALL_IS_BEING_FORWARDED - 181</LI>
124: * <LI>QUEUED - 182</LI>
125: * <li>SESSION_PROGRESS - 183</li>
126: * </td>
127: * </tr>
128: * <tr>
129: * <td>SUCCESS (2xx)</td>
130: * <td>
131: * <LI><b>OK - 200</b></LI>
132: * <LI><i>ACCEPTED - 202 (Extension RFC3265)</i></LI>
133: * </td>
134: * </tr>
135: * <tr>
136: * <td>REDIRECTION (3xx)</td>
137: * <td>
138: * <LI><b>MULTIPLE_CHOICES - 300</b></LI>
139: * <LI>MOVED_PERMANENTLY - 301</LI>
140: * <LI>MOVED_TEMPORARILY - 302</LI>
141: * <LI>USE_PROXY - 305</LI>
142: * <LI>ALTERNATIVE_SERVICE - 380</LI>
143: * </td>
144: * </tr>
145: * <tr>
146: * <td>CLIENT_ERROR (4xx)</td>
147: * <td>
148: * <LI><b>BAD_REQUEST - 400</b></LI>
149: * <LI>UNAUTHORIZED - 401</LI>
150: * <LI>PAYMENT_REQUIRED - 402</LI>
151: * <LI>FORBIDDEN - 403</LI>
152: * <LI>NOT_FOUND - 404</LI>
153: * <LI>METHOD_NOT_ALLOWED - 405</LI>
154: * <LI>NOT_ACCEPTABLE - 406</LI>
155: * <LI>PROXY_AUTHENTICATION_REQUIRED - 407</LI>
156: * <LI>REQUEST_TIMEOUT - 408</LI>
157: * <LI>GONE - 410</LI>
158: * <LI><i>CONDITIONAL_REQUEST_FAILED - 412 (Extension RFC3909)<i>
159: * <LI>REQUEST_ENTITY_TOO_LARGE - 413
160: * <LI>REQUEST_URI_TOO_LONG - 414
161: * <LI>UNSUPPORTED_MEDIA_TYPE - 415</LI>
162: * <LI>UNSUPPORTED_URI_SCHEME - 416
163: * <LI>BAD_EXTENSION - 420</LI>
164: * <LI>EXTENSION_REQUIRED - 421
165: * <LI>INTERVAL_TOO_BRIEF - 423
166: * <LI>TEMPORARILY_UNAVAILABLE - 480</LI>
167: * <LI>CALL_OR_TRANSACTION_DOES_NOT_EXIST - 481</LI>
168: * <LI>LOOP_DETECTED - 482</LI>
169: * <LI>TOO_MANY_HOPS - 483</LI>
170: * <LI>ADDRESS_INCOMPLETE - 484</LI>
171: * <LI>AMBIGUOUS - 485</LI>
172: * <LI>BUSY_HERE - 486</LI>
173: * <LI>REQUEST_TERMINATED - 487
174: * <LI>NOT_ACCEPTABLE_HERE - 488
175: * <LI><i>BAD EVENT - 489 (Extension RFC3265)<i></LI>
176: * <LI>REQUEST_PENDING - 491
177: * <LI>UNDECIPHERABLE - 493
178: * </td>
179: * </tr>
180: * <tr>
181: * <td>SERVER_ERROR (5xx)</td>
182: * <td>
183: * <LI><b>SERVER_INTERNAL_ERROR - 500</b></LI>
184: * <LI>NOT_IMPLEMENTED - 501</LI>
185: * <LI>BAD_GATEWAY - 502</LI>
186: * <LI>SERVICE_UNAVAILABLE - 503</LI>
187: * <LI>SERVER_TIMEOUT - 504</LI>
188: * <LI>VERSION_NOT_SUPPORTED - 505</LI>
189: * <LI>MESSAGE_TOO_LARGE - 513
190: * </td>
191: * </tr>
192: * <tr>
193: * <td>GLOBAL_ERROR (6xx)</td>
194: * <td>
195: * <LI><b>BUSY_EVERYWHERE - 600</b></LI>
196: * <LI>DECLINE - 603</LI>
197: * <LI>DOES_NOT_EXIST_ANYWHERE - 604</LI>
198: * <LI>SESSION_NOT_ACCEPTABLE - 606</LI>
199: * </td>
200: * </tr>
201: * </table>
202: *
203: * @author BEA Systems, NIST
204: * @version 1.2
205: *
206: */
207:
208: public interface Response extends Message {
209:
210: /**
211: * Sets the status-code of Response. The status-code is a 3-digit integer
212: * result code that indicates the outcome of an attempt to understand and
213: * satisfy a request. The Status-Code is intended for use by automata.
214: *
215: * @param statusCode the new integer value of the status code.
216: * @throws ParseException which signals that an error has been reached
217: * unexpectedly while parsing the statusCode value.
218: */
219: public void setStatusCode(int statusCode) throws ParseException;
220:
221: /**
222: * Gets the integer value of the status code of Response, which identifies
223: * the outcome of the request to which this response is related.
224: *
225: * @return the integer status-code of this Response message.
226: */
227: public int getStatusCode();
228:
229: /**
230: * Sets reason phrase of Response. The reason-phrase is intended to give a
231: * short textual description of the status-code. The reason-phrase is
232: * intended for the human user. A client is not required to examine or
233: * display the reason-phrase. While RFC3261 suggests specific wording for
234: * the reason phrase, implementations MAY choose other text.
235: *
236: * @param reasonPhrase the new string value of the reason phrase.
237: * @throws ParseException which signals that an error has been reached
238: * unexpectedly while parsing the reasonPhrase value.
239: */
240: public void setReasonPhrase(String reasonPhrase)
241: throws ParseException;
242:
243: /**
244: * Gets the reason phrase of this Response message.
245: *
246: * @return the string value of the reason phrase of this Response message.
247: */
248: public String getReasonPhrase();
249:
250: // Response status codes
251:
252: /**
253: * This response indicates that the request has been received by the
254: * next-hop server and that some unspecified action is being taken on
255: * behalf of this call (for example, a database is being consulted). This
256: * response, like all other provisional responses, stops retransmissions of
257: * an INVITE by a UAC. The 100 (Trying) response is different from other
258: * provisional responses, in that it is never forwarded upstream by a
259: * stateful proxy.
260: */
261: public static final int TRYING = 100;
262:
263: /**
264: * The User Agent receiving the INVITE is trying to alert the user. This
265: * response MAY be used to initiate local ringback.
266: */
267: public static final int RINGING = 180;
268:
269: /**
270: * A server MAY use this status code to indicate that the call is being
271: * forwarded to a different set of destinations.
272: */
273: public static final int CALL_IS_BEING_FORWARDED = 181;
274:
275: /**
276: * The called party is temporarily unavailable, but the server has decided
277: * to queue the call rather than reject it. When the callee becomes
278: * available, it will return the appropriate final status response. The
279: * reason phrase MAY give further details about the status of the call,
280: * for example, "5 calls queued; expected waiting time is 15 minutes". The
281: * server MAY issue several 182 (Queued) responses to update the caller
282: * about the status of the queued call.
283: */
284: public static final int QUEUED = 182;
285:
286: /**
287: * The 183 (Session Progress) response is used to convey information about
288: * the progress of the call that is not otherwise classified. The
289: * Reason-Phrase, header fields, or message body MAY be used to convey more
290: * details about the call progress.
291: */
292: public static final int SESSION_PROGRESS = 183;
293:
294: /**
295: * The request has succeeded. The information returned with the response
296: * depends on the method used in the request.
297: */
298: public static final int OK = 200;
299:
300: /**
301: * The Acceptable extension response code signifies that the request has
302: * been accepted for processing, but the processing has not been completed.
303: * The request might or might not eventually be acted upon, as it might be
304: * disallowed when processing actually takes place. There is no facility
305: * for re-sending a status code from an asynchronous operation such as this.
306: * The 202 response is intentionally non-committal. Its purpose is to allow
307: * a server to accept a request for some other process (perhaps a
308: * batch-oriented process that is only run once per day) without requiring
309: * that the user agent's connection to the server persist until the process
310: * is completed. The entity returned with this response SHOULD include an
311: * indication of the request's current status and either a pointer to a
312: * status monitor or some estimate of when the user can expect the request
313: * to be fulfilled. This response code is specific to the event notification
314: * framework.
315: */
316: public static final int ACCEPTED = 202;
317:
318: /**
319: * The address in the request resolved to several choices, each with its
320: * own specific location, and the user (or UA) can select a preferred
321: * communication end point and redirect its request to that location.
322: * <p>
323: * The response MAY include a message body containing a list of resource
324: * characteristics and location(s) from which the user or UA can choose
325: * the one most appropriate, if allowed by the Accept request header field.
326: * However, no MIME types have been defined for this message body.
327: * <p>
328: * The choices SHOULD also be listed as Contact fields. Unlike HTTP, the
329: * SIP response MAY contain several Contact fields or a list of addresses
330: * in a Contact field. User Agents MAY use the Contact header field value
331: * for automatic redirection or MAY ask the user to confirm a choice.
332: * However, this specification does not define any standard for such
333: * automatic selection.
334: * <p>
335: * This status response is appropriate if the callee can be reached at
336: * several different locations and the server cannot or prefers not to
337: * proxy the request.
338: */
339: public static final int MULTIPLE_CHOICES = 300;
340:
341: /**
342: * The user can no longer be found at the address in the Request-URI, and
343: * the requesting client SHOULD retry at the new address given by the
344: * Contact header field. The requestor SHOULD update any local directories,
345: * address books, and user location caches with this new value and redirect
346: * future requests to the address(es) listed.
347: */
348: public static final int MOVED_PERMANENTLY = 301;
349:
350: /**
351: * The requesting client SHOULD retry the request at the new address(es)
352: * given by the Contact header field. The Request-URI of the new request
353: * uses the value of the Contact header field in the response.
354: * <p>
355: * The duration of the validity of the Contact URI can be indicated through
356: * an Expires header field or an expires parameter in the Contact header
357: * field. Both proxies and User Agents MAY cache this URI for the duration
358: * of the expiration time. If there is no explicit expiration time, the
359: * address is only valid once for recursing, and MUST NOT be cached for
360: * future transactions.
361: * <p>
362: * If the URI cached from the Contact header field fails, the Request-URI
363: * from the redirected request MAY be tried again a single time. The
364: * temporary URI may have become out-of-date sooner than the expiration
365: * time, and a new temporary URI may be available.
366: */
367: public static final int MOVED_TEMPORARILY = 302;
368:
369: /**
370: * The requested resource MUST be accessed through the proxy given by the
371: * Contact field. The Contact field gives the URI of the proxy. The
372: * recipient is expected to repeat this single request via the proxy.
373: * 305 (Use Proxy) responses MUST only be generated by UASs.
374: */
375: public static final int USE_PROXY = 305;
376:
377: /**
378: * The call was not successful, but alternative services are possible. The
379: * alternative services are described in the message body of the response.
380: * Formats for such bodies are not defined here, and may be the subject of
381: * future standardization.
382: */
383: public static final int ALTERNATIVE_SERVICE = 380;
384:
385: /**
386: * The request could not be understood due to malformed syntax. The
387: * Reason-Phrase SHOULD identify the syntax problem in more detail, for
388: * example, "Missing Call-ID header field".
389: */
390: public static final int BAD_REQUEST = 400;
391:
392: /**
393: * The request requires user authentication. This response is issued by
394: * UASs and registrars, while 407 (Proxy Authentication Required) is used
395: * by proxy servers.
396: */
397: public static final int UNAUTHORIZED = 401;
398:
399: /**
400: * Reserved for future use.
401: */
402: public static final int PAYMENT_REQUIRED = 402;
403:
404: /**
405: * The server understood the request, but is refusing to fulfill it.
406: * Authorization will not help, and the request SHOULD NOT be repeated.
407: */
408: public static final int FORBIDDEN = 403;
409:
410: /**
411: * The server has definitive information that the user does not exist at
412: * the domain specified in the Request-URI. This status is also returned
413: * if the domain in the Request-URI does not match any of the domains
414: * handled by the recipient of the request.
415: */
416: public static final int NOT_FOUND = 404;
417:
418: /**
419: * The method specified in the Request-Line is understood, but not allowed
420: * for the address identified by the Request-URI. The response MUST include
421: * an Allow header field containing a list of valid methods for the
422: * indicated address
423: */
424: public static final int METHOD_NOT_ALLOWED = 405;
425:
426: /**
427: * The resource identified by the request is only capable of generating
428: * response entities that have content characteristics not acceptable
429: * according to the Accept header field sent in the request.
430: */
431: public static final int NOT_ACCEPTABLE = 406;
432:
433: /**
434: * This code is similar to 401 (Unauthorized), but indicates that the client
435: * MUST first authenticate itself with the proxy. This status code can be
436: * used for applications where access to the communication channel (for
437: * example, a telephony gateway) rather than the callee requires
438: * authentication.
439: */
440: public static final int PROXY_AUTHENTICATION_REQUIRED = 407;
441:
442: /**
443: * The server could not produce a response within a suitable amount of
444: * time, for example, if it could not determine the location of the user
445: * in time. The client MAY repeat the request without modifications at
446: * any later time.
447: */
448: public static final int REQUEST_TIMEOUT = 408;
449:
450: /**
451: * The requested resource is no longer available at the server and no
452: * forwarding address is known. This condition is expected to be considered
453: * permanent. If the server does not know, or has no facility to determine,
454: * whether or not the condition is permanent, the status code 404
455: * (Not Found) SHOULD be used instead.
456: */
457: public static final int GONE = 410;
458:
459: /**
460: * The server is refusing to service the PUBLISH request because the
461: * entity-tag in the SIP-If-Match header does not match with existing
462: * event state.
463: *
464: * @since v1.2
465: */
466: public static final int CONDITIONAL_REQUEST_FAILED = 412;
467:
468: /**
469: * The server is refusing to process a request because the request
470: * entity-body is larger than the server is willing or able to process. The
471: * server MAY close the connection to prevent the client from continuing
472: * the request. If the condition is temporary, the server SHOULD include a
473: * Retry-After header field to indicate that it is temporary and after what
474: * time the client MAY try again.
475: */
476: public static final int REQUEST_ENTITY_TOO_LARGE = 413;
477:
478: /**
479: * The server is refusing to service the request because the Request-URI
480: * is longer than the server is willing to interpret.
481: */
482: public static final int REQUEST_URI_TOO_LONG = 414;
483:
484: /**
485: * The server is refusing to service the request because the message body
486: * of the request is in a format not supported by the server for the
487: * requested method. The server MUST return a list of acceptable formats
488: * using the Accept, Accept-Encoding, or Accept-Language header field,
489: * depending on the specific problem with the content.
490: */
491: public static final int UNSUPPORTED_MEDIA_TYPE = 415;
492:
493: /**
494: * The server cannot process the request because the scheme of the URI in
495: * the Request-URI is unknown to the server.
496: */
497: public static final int UNSUPPORTED_URI_SCHEME = 416;
498:
499: /**
500: * The server did not understand the protocol extension specified in a
501: * Proxy-Require or Require header field. The server MUST include a list of
502: * the unsupported extensions in an Unsupported header field in the response.
503: */
504: public static final int BAD_EXTENSION = 420;
505:
506: /**
507: * The UAS needs a particular extension to process the request, but this
508: * extension is not listed in a Supported header field in the request.
509: * Responses with this status code MUST contain a Require header field
510: * listing the required extensions.
511: * <p>
512: * A UAS SHOULD NOT use this response unless it truly cannot provide any
513: * useful service to the client. Instead, if a desirable extension is not
514: * listed in the Supported header field, servers SHOULD process the request
515: * using baseline SIP capabilities and any extensions supported by the
516: * client.
517: */
518: public static final int EXTENSION_REQUIRED = 421;
519:
520: /**
521: * The server is rejecting the request because the expiration time of the
522: * resource refreshed by the request is too short. This response can be
523: * used by a registrar to reject a registration whose Contact header field
524: * expiration time was too small.
525: */
526: public static final int INTERVAL_TOO_BRIEF = 423;
527:
528: /**
529: * The callee's end system was contacted successfully but the callee is
530: * currently unavailable (for example, is not logged in, logged in but in a
531: * state that precludes communication with the callee, or has activated the
532: * "do not disturb" feature). The response MAY indicate a better time to
533: * call in the Retry-After header field. The user could also be available
534: * elsewhere (unbeknownst to this server). The reason phrase SHOULD indicate
535: * a more precise cause as to why the callee is unavailable. This value
536: * SHOULD be settable by the UA. Status 486 (Busy Here) MAY be used to more
537: * precisely indicate a particular reason for the call failure.
538: * <p>
539: * This status is also returned by a redirect or proxy server that
540: * recognizes the user identified by the Request-URI, but does not currently
541: * have a valid forwarding location for that user.
542: */
543: public static final int TEMPORARILY_UNAVAILABLE = 480;
544:
545: /**
546: * This status indicates that the UAS received a request that does not
547: * match any existing dialog or transaction.
548: */
549: public static final int CALL_OR_TRANSACTION_DOES_NOT_EXIST = 481;
550:
551: /**
552: * The server has detected a loop.
553: */
554: public static final int LOOP_DETECTED = 482;
555:
556: /**
557: * The server received a request that contains a Max-Forwards header field
558: * with the value zero.
559: */
560: public static final int TOO_MANY_HOPS = 483;
561:
562: /**
563: * The server received a request with a Request-URI that was incomplete.
564: * Additional information SHOULD be provided in the reason phrase. This
565: * status code allows overlapped dialing. With overlapped dialing, the
566: * client does not know the length of the dialing string. It sends strings
567: * of increasing lengths, prompting the user for more input, until it no
568: * longer receives a 484 (Address Incomplete) status response.
569: */
570: public static final int ADDRESS_INCOMPLETE = 484;
571:
572: /**
573: * The Request-URI was ambiguous. The response MAY contain a listing of
574: * possible unambiguous addresses in Contact header fields. Revealing
575: * alternatives can infringe on privacy of the user or the organization.
576: * It MUST be possible to configure a server to respond with status 404
577: * (Not Found) or to suppress the listing of possible choices for ambiguous
578: * Request-URIs. Some email and voice mail systems provide this
579: * functionality. A status code separate from 3xx is used since the
580: * semantics are different: for 300, it is assumed that the same person or
581: * service will be reached by the choices provided. While an automated
582: * choice or sequential search makes sense for a 3xx response, user
583: * intervention is required for a 485 (Ambiguous) response.
584: */
585: public static final int AMBIGUOUS = 485;
586:
587: /**
588: * The callee's end system was contacted successfully, but the callee is
589: * currently not willing or able to take additional calls at this end
590: * system. The response MAY indicate a better time to call in the Retry-After
591: * header field. The user could also be available elsewhere, such as
592: * through a voice mail service. Status 600 (Busy Everywhere) SHOULD be
593: * used if the client knows that no other end system will be able to accept
594: * this call.
595: */
596: public static final int BUSY_HERE = 486;
597:
598: /**
599: * The request was terminated by a BYE or CANCEL request. This response is
600: * never returned for a CANCEL request itself.
601: */
602: public static final int REQUEST_TERMINATED = 487;
603:
604: /**
605: * The response has the same meaning as 606 (Not Acceptable), but only
606: * applies to the specific resource addressed by the Request-URI and the
607: * request may succeed elsewhere. A message body containing a description
608: * of media capabilities MAY be present in the response, which is formatted
609: * according to the Accept header field in the INVITE (or application/sdp
610: * if not present), the same as a message body in a 200 (OK) response to
611: * an OPTIONS request.
612: */
613: public static final int NOT_ACCEPTABLE_HERE = 488;
614:
615: /**
616: * The Bad Event extension response code is used to indicate that the
617: * server did not understand the event package specified in a "Event"
618: * header field. This response code is specific to the event notification
619: * framework.
620: */
621: public static final int BAD_EVENT = 489;
622:
623: /**
624: * The request was received by a UAS that had a pending request within
625: * the same dialog.
626: */
627: public static final int REQUEST_PENDING = 491;
628:
629: /**
630: * The request was received by a UAS that contained an encrypted MIME body
631: * for which the recipient does not possess or will not provide an
632: * appropriate decryption key. This response MAY have a single body
633: * containing an appropriate public key that should be used to encrypt MIME
634: * bodies sent to this UA.
635: */
636: public static final int UNDECIPHERABLE = 493;
637:
638: /**
639: * The server encountered an unexpected condition that prevented it from
640: * fulfilling the request. The client MAY display the specific error
641: * condition and MAY retry the request after several seconds. If the
642: * condition is temporary, the server MAY indicate when the client may
643: * retry the request using the Retry-After header field.
644: */
645: public static final int SERVER_INTERNAL_ERROR = 500;
646:
647: /**
648: * The server does not support the functionality required to fulfill the
649: * request. This is the appropriate response when a UAS does not recognize
650: * the request method and is not capable of supporting it for any user.
651: * Proxies forward all requests regardless of method. Note that a 405
652: * (Method Not Allowed) is sent when the server recognizes the request
653: * method, but that method is not allowed or supported.
654: */
655: public static final int NOT_IMPLEMENTED = 501;
656:
657: /**
658: * The server, while acting as a gateway or proxy, received an invalid
659: * response from the downstream server it accessed in attempting to
660: * fulfill the request.
661: */
662: public static final int BAD_GATEWAY = 502;
663:
664: /**
665: * The server is temporarily unable to process the request due to a
666: * temporary overloading or maintenance of the server. The server MAY
667: * indicate when the client should retry the request in a Retry-After
668: * header field. If no Retry-After is given, the client MUST act as if it
669: * had received a 500 (Server Internal Error) response.
670: * <p>
671: * A client (proxy or UAC) receiving a 503 (Service Unavailable) SHOULD
672: * attempt to forward the request to an alternate server. It SHOULD NOT
673: * forward any other requests to that server for the duration specified
674: * in the Retry-After header field, if present.
675: * <p>
676: * Servers MAY refuse the connection or drop the request instead of
677: * responding with 503 (Service Unavailable).
678: */
679: public static final int SERVICE_UNAVAILABLE = 503;
680:
681: /**
682: * The server did not receive a timely response from an external server
683: * it accessed in attempting to process the request. 408 (Request Timeout)
684: * should be used instead if there was no response within the
685: * period specified in the Expires header field from the upstream server.
686: */
687: public static final int SERVER_TIMEOUT = 504;
688:
689: /**
690: * The server does not support, or refuses to support, the SIP protocol
691: * version that was used in the request. The server is indicating that
692: * it is unable or unwilling to complete the request using the same major
693: * version as the client, other than with this error message.
694: */
695: public static final int VERSION_NOT_SUPPORTED = 505;
696:
697: /**
698: * The server was unable to process the request since the message length
699: * exceeded its capabilities.
700: */
701: public static final int MESSAGE_TOO_LARGE = 513;
702:
703: /**
704: * The callee's end system was contacted successfully but the callee is
705: * busy and does not wish to take the call at this time. The response
706: * MAY indicate a better time to call in the Retry-After header field.
707: * If the callee does not wish to reveal the reason for declining the call,
708: * the callee uses status code 603 (Decline) instead. This status response
709: * is returned only if the client knows that no other end point (such as a
710: * voice mail system) will answer the request. Otherwise, 486 (Busy Here)
711: * should be returned.
712: */
713: public static final int BUSY_EVERYWHERE = 600;
714:
715: /**
716: * The callee's machine was successfully contacted but the user explicitly
717: * does not wish to or cannot participate. The response MAY indicate a
718: * better time to call in the Retry-After header field. This status
719: * response is returned only if the client knows that no other end point
720: * will answer the request.
721: */
722: public static final int DECLINE = 603;
723:
724: /**
725: * The server has authoritative information that the user indicated in the
726: * Request-URI does not exist anywhere.
727: */
728: public static final int DOES_NOT_EXIST_ANYWHERE = 604;
729:
730: /**
731: * The user's agent was contacted successfully but some aspects of the
732: * session description such as the requested media, bandwidth, or addressing
733: * style were not acceptable. A 606 (Not Acceptable) response means that
734: * the user wishes to communicate, but cannot adequately support the
735: * session described. The 606 (Not Acceptable) response MAY contain a list
736: * of reasons in a Warning header field describing why the session described
737: * cannot be supported.
738: * <p>
739: * A message body containing a description of media capabilities MAY be
740: * present in the response, which is formatted according to the Accept
741: * header field in the INVITE (or application/sdp if not present), the same
742: * as a message body in a 200 (OK) response to an OPTIONS request.
743: * <p>
744: * It is hoped that negotiation will not frequently be needed, and when a
745: * new user is being invited to join an already existing conference,
746: * negotiation may not be possible. It is up to the invitation initiator to
747: * decide whether or not to act on a 606 (Not Acceptable) response.
748: * <p>
749: * This status response is returned only if the client knows that no other
750: * end point will answer the request. This specification renames this
751: * status code from NOT_ACCEPTABLE as in RFC3261 to SESSION_NOT_ACCEPTABLE
752: * due to it conflict with 406 (Not Acceptable) defined in this interface.
753: */
754: public static final int SESSION_NOT_ACCEPTABLE = 606;
755:
756: }
|