001: /*
002: * Portions Copyright 2000-2007 Sun Microsystems, Inc. All Rights
003: * Reserved. Use is subject to license terms.
004: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
005: *
006: * This program is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU General Public License version
008: * 2 only, as published by the Free Software Foundation.
009: *
010: * This program is distributed in the hope that it will be useful, but
011: * WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * General Public License version 2 for more details (a copy is
014: * included at /legal/license.txt).
015: *
016: * You should have received a copy of the GNU General Public License
017: * version 2 along with this work; if not, write to the Free Software
018: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
019: * 02110-1301 USA
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
022: * Clara, CA 95054 or visit www.sun.com if you need additional
023: * information or have any questions.
024: */
025: /*
026: */
027: package gov.nist.siplite;
028:
029: /**
030: * A list of error codes for SIP
031: */
032: public interface SIPErrorCodes {
033:
034: /**
035: * This response indicates that the request has been received by the
036: * next-hop server and that some unspecified action is being taken on
037: * behalf of this call (for example, a database is being consulted). This
038: * response, like all other provisional responses, stops retransmissions of
039: * an INVITE by a UAC. The 100 (Trying) response is different from other
040: * provisional responses, in that it is never forwarded upstream by a
041: * stateful proxy.
042: */
043: public static final int TRYING = 100;
044:
045: /**
046: * The User Agent receiving the INVITE is trying to alert the user. This
047: * response MAY be used to initiate local ringback.
048: */
049: public static final int RINGING = 180;
050:
051: /**
052: * A server MAY use this status code to indicate that the call is being
053: * forwarded to a different set of destinations.
054: */
055: public static final int CALL_IS_BEING_FORWARDED = 181;
056:
057: /**
058: * The called party is temporarily unavailable, but the server has decided
059: * to queue the call rather than reject it. When the callee becomes
060: * available, it will return the appropriate final status response. The
061: * reason phrase MAY give further details about the status of the call,
062: * for example, "5 calls queued; expected waiting time is 15 minutes". The
063: * server MAY issue several 182 (Queued) responses to update the caller
064: * about the status of the queued call.
065: */
066: public static final int QUEUED = 182;
067:
068: /**
069: * The 183 (Session Progress) response is used to convey information about
070: * the progress of the call that is not otherwise classified. The
071: * Reason-Phrase, header fields, or message body MAY be used to convey more
072: * details about the call progress.
073: *
074: * @since v1.1
075: */
076: public static final int SESSION_PROGRESS = 183;
077:
078: /**
079: * The request has succeeded. The information returned with the response
080: * depends on the method used in the request.
081: */
082: public static final int OK = 200;
083:
084: /**
085: * The Acceptable extension response code signifies that the request has
086: * been accepted for processing, but the processing has not been completed.
087: * The request might or might not eventually be acted upon, as it might be
088: * disallowed when processing actually takes place. There is no facility
089: * for re-sending a status code from an asynchronous operation such as this.
090: * The 202 response is intentionally non-committal. Its purpose is to allow
091: * a server to accept a request for some other process (perhaps a
092: * batch-oriented process that is only run once per day) without requiring
093: * that the user agent's connection to the server persist until the process
094: * is completed. The entity returned with this response SHOULD include an
095: * indication of the request's current status and either a pointer to a
096: * status monitor or some estimate of when the user can expect the request
097: * to be fulfilled. This response code is specific to the event
098: * notification framework.
099: *
100: * @since v1.1
101: */
102: public static final int ACCEPTED = 202;
103:
104: /**
105: * The address in the request resolved to several choices, each with its
106: * own specific location, and the user (or UA) can select a preferred
107: * communication end point and redirect its request to that location.
108: * <p>
109: * The response MAY include a message body containing a list of resource
110: * characteristics and location(s) from which the user or UA can choose
111: * the one most appropriate, if allowed by the Accept request header field.
112: * However, no MIME types have been defined for this message body.
113: * <p>
114: * The choices SHOULD also be listed as Contact fields. Unlike HTTP, the
115: * SIP response MAY contain several Contact fields or a list of addresses
116: * in a Contact field. User Agents MAY use the Contact header field value
117: * for automatic redirection or MAY ask the user to confirm a choice.
118: * However, this specification does not define any standard for such
119: * automatic selection.
120: * <p>
121: * This status response is appropriate if the callee can be reached at
122: * several different locations and the server cannot or prefers not to
123: * proxy the request.
124: */
125: public static final int MULTIPLE_CHOICES = 300;
126:
127: /**
128: * The user can no longer be found at the address in the Request-URI, and
129: * the requesting client SHOULD retry at the new address given by the
130: * Contact header field. The requestor SHOULD update any local directories,
131: * address books, and user location caches with this new value and redirect
132: * future requests to the address(es) listed.
133: */
134: public static final int MOVED_PERMANENTLY = 301;
135:
136: /**
137: * The requesting client SHOULD retry the request at the new address(es)
138: * given by the Contact header field. The Request-URI of the new request
139: * uses the value of the Contact header field in the response.
140: * <p>
141: * The duration of the validity of the Contact URI can be indicated through
142: * an Expires header field or an expires parameter in the Contact header
143: * field. Both proxies and User Agents MAY cache this URI for the duration
144: * of the expiration time. If there is no explicit expiration time, the
145: * address is only valid once for recursing, and MUST NOT be cached for
146: * future transactions.
147: * <p>
148: * If the URI cached from the Contact header field fails, the Request-URI
149: * from the redirected request MAY be tried again a single time. The
150: * temporary URI may have become out-of-date sooner than the expiration
151: * time, and a new temporary URI may be available.
152: */
153: public static final int MOVED_TEMPORARILY = 302;
154:
155: /**
156: * The requested resource MUST be accessed through the proxy given by the
157: * Contact field. The Contact field gives the URI of the proxy. The
158: * recipient is expected to repeat this single request via the proxy.
159: * 305 (Use Proxy) responses MUST only be generated by UASs.
160: */
161: public static final int USE_PROXY = 305;
162:
163: /**
164: * The call was not successful, but alternative services are possible. The
165: * alternative services are described in the message body of the response.
166: * Formats for such bodies are not defined here, and may be the subject of
167: * future standardization.
168: */
169: public static final int ALTERNATIVE_SERVICE = 380;
170:
171: /**
172: * The request could not be understood due to malformed syntax. The
173: * Reason-Phrase SHOULD identify the syntax problem in more detail, for
174: * example, "Missing Call-ID header field".
175: */
176: public static final int BAD_REQUEST = 400;
177:
178: /**
179: * The request requires user authentication. This response is issued by
180: * UASs and registrars, while 407 (Proxy Authentication Required) is used
181: * by proxy servers.
182: */
183: public static final int UNAUTHORIZED = 401;
184:
185: /**
186: * Reserved for future use.
187: */
188: public static final int PAYMENT_REQUIRED = 402;
189:
190: /**
191: * The server understood the request, but is refusing to fulfill it.
192: * Authorization will not help, and the request SHOULD NOT be repeated.
193: */
194: public static final int FORBIDDEN = 403;
195:
196: /**
197: * The server has definitive information that the user does not exist at
198: * the domain specified in the Request-URI. This status is also returned
199: * if the domain in the Request-URI does not match any of the domains
200: * handled by the recipient of the request.
201: */
202: public static final int NOT_FOUND = 404;
203:
204: /**
205: * The method specified in the Request-Line is understood, but not allowed
206: * for the address identified by the Request-URI. The response MUST include
207: * an Allow header field containing a list of valid methods for the
208: * indicated address
209: */
210: public static final int METHOD_NOT_ALLOWED = 405;
211:
212: /**
213: * The resource identified by the request is only capable of generating
214: * response entities that have content characteristics not acceptable
215: * according to the Accept header field sent in the request.
216: */
217: public static final int NOT_ACCEPTABLE = 406;
218:
219: /**
220: * This code is similar to 401 (Unauthorized), but indicates that
221: * the client MUST first authenticate itself with the proxy. This
222: * status code can be used for applications where access to the
223: * communication channel (for example, a telephony gateway) rather
224: * than the callee requires authentication.
225: */
226: public static final int PROXY_AUTHENTICATION_REQUIRED = 407;
227:
228: /**
229: * The server could not produce a response within a suitable amount of
230: * time, for example, if it could not determine the location of the user
231: * in time. The client MAY repeat the request without modifications at
232: * any later time.
233: */
234: public static final int REQUEST_TIMEOUT = 408;
235:
236: /**
237: * The requested resource is no longer available at the server and no
238: * forwarding address is known. This condition is expected to be considered
239: * permanent. If the server does not know, or has no facility to determine,
240: * whether or not the condition is permanent, the status code 404
241: * (Not Found) SHOULD be used instead.
242: */
243: public static final int GONE = 410;
244:
245: /**
246: * The server is refusing to process a request because the request
247: * entity-body is larger than the server is willing or able to process. The
248: * server MAY close the connection to prevent the client from continuing
249: * the request. If the condition is temporary, the server SHOULD include a
250: * Retry-After header field to indicate that it is temporary and after what
251: * time the client MAY try again.
252: *
253: * @since v1.1
254: */
255: public static final int REQUEST_ENTITY_TOO_LARGE = 413;
256:
257: /**
258: * The server is refusing to service the request because the Request-URI
259: * is longer than the server is willing to interpret.
260: *
261: * @since v1.1
262: */
263: public static final int REQUEST_URI_TOO_LONG = 414;
264:
265: /**
266: * The server is refusing to service the request because the message body
267: * of the request is in a format not supported by the server for the
268: * requested method. The server MUST return a list of acceptable formats
269: * using the Accept, Accept-Encoding, or Accept-Language header field,
270: * depending on the specific problem with the content.
271: */
272: public static final int UNSUPPORTED_MEDIA_TYPE = 415;
273:
274: /**
275: * The server cannot process the request because the scheme of the URI in
276: * the Request-URI is unknown to the server.
277: *
278: * @since v1.1
279: */
280: public static final int UNSUPPORTED_URI_SCHEME = 416;
281:
282: /**
283: * The server did not understand the protocol extension specified in a
284: * Proxy-Require or Require header field. The server MUST include a list of
285: * the unsupported extensions in an Unsupported header field in
286: * the response.
287: */
288: public static final int BAD_EXTENSION = 420;
289:
290: /**
291: * The UAS needs a particular extension to process the request, but this
292: * extension is not listed in a Supported header field in the request.
293: * Responses with this status code MUST contain a Require header field
294: * listing the required extensions.
295: * <p>
296: * A UAS SHOULD NOT use this response unless it truly cannot provide any
297: * useful service to the client. Instead, if a desirable extension is not
298: * listed in the Supported header field, servers SHOULD process the request
299: * using baseline SIP capabilities and any extensions supported by the
300: * client.
301: *
302: * @since v1.1
303: */
304: public static final int EXTENSION_REQUIRED = 421;
305:
306: /**
307: * The server is rejecting the request because the expiration time of the
308: * resource refreshed by the request is too short. This response can be
309: * used by a registrar to reject a registration whose Contact header field
310: * expiration time was too small.
311: *
312: * @since v1.1
313: */
314: public static final int INTERVAL_TOO_BRIEF = 423;
315:
316: /**
317: * The callee's end system was contacted successfully but the callee is
318: * currently unavailable (for example, is not logged in, logged in but in a
319: * state that precludes communication with the callee, or has activated the
320: * "do not disturb" feature). The response MAY indicate a better time to
321: * call in the Retry-After header field. The user could also be available
322: * elsewhere (unbeknownst to this server). The reason phrase
323: * SHOULD indicate
324: * a more precise cause as to why the callee is unavailable. This value
325: * SHOULD be settable by the UA. Status 486 (Busy Here) MAY be used to more
326: * precisely indicate a particular reason for the call failure.
327: * <p>
328: * This status is also returned by a redirect or proxy server that
329: * recognizes the user identified by the Request-URI, but does not
330: * currently
331: * have a valid forwarding location for that user.
332: *
333: * @since v1.1
334: */
335: public static final int TEMPORARILY_UNAVAILABLE = 480;
336:
337: /**
338: * This status indicates that the UAS received a request that does not
339: * match any existing dialog or transaction.
340: */
341: public static final int CALL_OR_TRANSACTION_DOES_NOT_EXIST = 481;
342:
343: /**
344: * The server has detected a loop.
345: */
346: public static final int LOOP_DETECTED = 482;
347:
348: /**
349: * The server received a request that contains a Max-Forwards header field
350: * with the value zero.
351: */
352: public static final int TOO_MANY_HOPS = 483;
353:
354: /**
355: * The server received a request with a Request-URI that was incomplete.
356: * Additional information SHOULD be provided in the reason phrase. This
357: * status code allows overlapped dialing. With overlapped dialing, the
358: * client does not know the length of the dialing string. It sends strings
359: * of increasing lengths, prompting the user for more input, until it no
360: * longer receives a 484 (Address Incomplete) status response.
361: */
362: public static final int ADDRESS_INCOMPLETE = 484;
363:
364: /**
365: * The Request-URI was ambiguous. The response MAY contain a listing of
366: * possible unambiguous addresses in Contact header fields. Revealing
367: * alternatives can infringe on privacy of the user or the organization.
368: * It MUST be possible to configure a server to respond with status 404
369: * (Not Found) or to suppress the listing of possible choices for ambiguous
370: * Request-URIs. Some email and voice mail systems provide this
371: * functionality. A status code separate from 3xx is used since the
372: * semantics are different: for 300, it is assumed that the same person or
373: * service will be reached by the choices provided. While an automated
374: * choice or sequential search makes sense for a 3xx response, user
375: * intervention is required for a 485 (Ambiguous) response.
376: */
377: public static final int AMBIGUOUS = 485;
378:
379: /**
380: * The callee's end system was contacted successfully, but the callee is
381: * currently not willing or able to take additional calls at this end
382: * system. The response MAY indicate a better time to call in the
383: * Retry-After
384: * header field. The user could also be available elsewhere, such as
385: * through a voice mail service. Status 600 (Busy Everywhere) SHOULD be
386: * used if the client knows that no other end system will be able to accept
387: * this call.
388: */
389: public static final int BUSY_HERE = 486;
390:
391: /**
392: * The request was terminated by a BYE or CANCEL request. This response is
393: * never returned for a CANCEL request itself.
394: *
395: * @since v1.1
396: */
397: public static final int REQUEST_TERMINATED = 487;
398:
399: /**
400: * The response has the same meaning as 606 (Not Acceptable), but only
401: * applies to the specific resource addressed by the Request-URI and the
402: * request may succeed elsewhere. A message body containing a description
403: * of media capabilities MAY be present in the response, which is formatted
404: * according to the Accept header field in the INVITE (or application/sdp
405: * if not present), the same as a message body in a 200 (OK) response to
406: * an OPTIONS request.
407: *
408: * @since v1.1
409: */
410: public static final int NOT_ACCEPTABLE_HERE = 488;
411:
412: /**
413: * The Bad Event extension response code is used to indicate that the
414: * server did not understand the event package specified in a "Event"
415: * header field. This response code is specific to the event notification
416: * framework.
417: *
418: * @since v1.1
419: */
420: public static final int BAD_EVENT = 489;
421:
422: /**
423: * The request was received by a UAS that had a pending request within
424: * the same dialog.
425: *
426: * @since v1.1
427: */
428: public static final int REQUEST_PENDING = 491;
429:
430: /**
431: * The request was received by a UAS that contained an encrypted MIME body
432: * for which the recipient does not possess or will not provide an
433: * appropriate decryption key. This response MAY have a single body
434: * containing an appropriate public key that should be used to encrypt MIME
435: * bodies sent to this UA.
436: *
437: * @since v1.1
438: */
439: public static final int UNDECIPHERABLE = 493;
440:
441: /**
442: * The server encountered an unexpected condition that prevented it from
443: * fulfilling the request. The client MAY display the specific error
444: * condition and MAY retry the request after several seconds. If the
445: * condition is temporary, the server MAY indicate when the client may
446: * retry the request using the Retry-After header field.
447: */
448: public static final int SERVER_INTERNAL_ERROR = 500;
449:
450: /**
451: * The server does not support the functionality required to fulfill the
452: * request. This is the appropriate response when a UAS does not recognize
453: * the request method and is not capable of supporting it for any user.
454: * Proxies forward all requests regardless of method. Note that a 405
455: * (Method Not Allowed) is sent when the server recognizes the request
456: * method, but that method is not allowed or supported.
457: */
458: public static final int NOT_IMPLEMENTED = 501;
459:
460: /**
461: * The server, while acting as a gateway or proxy, received an invalid
462: * response from the downstream server it accessed in attempting to
463: * fulfill the request.
464: */
465: public static final int BAD_GATEWAY = 502;
466:
467: /**
468: * The server is temporarily unable to process the request due to a
469: * temporary overloading or maintenance of the server. The server MAY
470: * indicate when the client should retry the request in a Retry-After
471: * header field. If no Retry-After is given, the client MUST act as if it
472: * had received a 500 (Server Internal Error) response.
473: * <p>
474: * A client (proxy or UAC) receiving a 503 (Service Unavailable) SHOULD
475: * attempt to forward the request to an alternate server. It SHOULD NOT
476: * forward any other requests to that server for the duration specified
477: * in the Retry-After header field, if present.
478: * <p>
479: * Servers MAY refuse the connection or drop the request instead of
480: * responding with 503 (Service Unavailable).
481: *
482: * @since v1.1
483: */
484: public static final int SERVICE_UNAVAILABLE = 503;
485:
486: /**
487: * The server did not receive a timely response from an external server
488: * it accessed in attempting to process the request. 408 (Request Timeout)
489: * should be used instead if there was no response within the
490: * period specified in the Expires header field from the upstream server.
491: */
492: public static final int SERVER_TIMEOUT = 504;
493:
494: /**
495: * The server does not support, or refuses to support, the SIP protocol
496: * version that was used in the request. The server is indicating that
497: * it is unable or unwilling to complete the request using the same major
498: * version as the client, other than with this error message.
499: */
500: public static final int VERSION_NOT_SUPPORTED = 505;
501:
502: /**
503: * The server was unable to process the request since the message length
504: * exceeded its capabilities.
505: *
506: * @since v1.1
507: */
508: public static final int MESSAGE_TOO_LARGE = 513;
509:
510: /**
511: * The callee's end system was contacted successfully but the callee is
512: * busy and does not wish to take the call at this time. The response
513: * MAY indicate a better time to call in the Retry-After header field.
514: * If the callee does not wish to reveal the reason for declining the call,
515: * the callee uses status code 603 (Decline) instead. This status response
516: * is returned only if the client knows that no other end point (such as a
517: * voice mail system) will answer the request. Otherwise, 486 (Busy Here)
518: * should be returned.
519: */
520: public static final int BUSY_EVERYWHERE = 600;
521:
522: /**
523: * The callee's machine was successfully contacted but the user explicitly
524: * does not wish to or cannot participate. The response MAY indicate a
525: * better time to call in the Retry-After header field. This status
526: * response is returned only if the client knows that no other end point
527: * will answer the request.
528: */
529: public static final int DECLINE = 603;
530:
531: /**
532: * The server has authoritative information that the user indicated in the
533: * Request-URI does not exist anywhere.
534: */
535: public static final int DOES_NOT_EXIST_ANYWHERE = 604;
536:
537: /**
538: * The user's agent was contacted successfully but some aspects of the
539: * session description such as the requested media, bandwidth, or
540: * addressing
541: * style were not acceptable. A 606 (Not Acceptable) response means that
542: * the user wishes to communicate, but cannot adequately support the
543: * session described. The 606 (Not Acceptable) response MAY contain a list
544: * of reasons in a Warning header field describing why the session
545: * described cannot be supported.
546: * <p>
547: * A message body containing a description of media capabilities MAY be
548: * present in the response, which is formatted according to the Accept
549: * header field in the INVITE (or application/sdp if not present), the same
550: * as a message body in a 200 (OK) response to an OPTIONS request.
551: * <p>
552: * It is hoped that negotiation will not frequently be needed, and when a
553: * new user is being invited to join an already existing conference,
554: * negotiation may not be possible. It is up to the invitation initiator to
555: * decide whether or not to act on a 606 (Not Acceptable) response.
556: * <p>
557: * This status response is returned only if the client knows that no other
558: * end point will answer the request. This specification renames this
559: * status code from NOT_ACCEPTABLE as in RFC3261 to SESSION_NOT_ACCEPTABLE
560: * due to it conflict with 406 (Not Acceptable) defined in this interface.
561: */
562: public static final int SESSION_NOT_ACCEPTABLE = 606;
563: }
|