osip_const.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /*
  2. The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
  3. Copyright (C) 2001-2020 Aymeric MOIZARD amoizard@antisip.com
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with this library; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  15. */
  16. #ifndef _OSIP_CONST_H_
  17. #define _OSIP_CONST_H_
  18. #ifdef ENABLE_MPATROL
  19. #include <mpatrol.h>
  20. #endif
  21. #define OSIP_CRLF "\r\n\0"
  22. #define OSIP_CR "\r\0"
  23. #define OSIP_LF "\n\0"
  24. #define OSIP_SP " \0"
  25. #define ACCEPT "accept"
  26. #define ACCEPT_ENCODING "accept-encoding"
  27. #define ACCEPT_LANGUAGE "accept-language"
  28. #define ALERT_INFO "alert-info"
  29. #define ALLOW "allow"
  30. #define AUTHENTICATION_INFO "authentication-info"
  31. #define AUTHORIZATION "authorization"
  32. #define CALL_ID "call-id"
  33. #define CALL_ID_SHORT "i"
  34. #define CALL_INFO "call-info"
  35. #define CONTACT "contact"
  36. #define CONTACT_SHORT "m"
  37. #define CONTENT_DISPOSITION "content-disposition"
  38. #define CONTENT_ENCODING_SHORT "e"
  39. #define CONTENT_ENCODING "content-encoding"
  40. #define CONTENT_LANGUAGE "content-language"
  41. #define CONTENT_LENGTH_SHORT "l"
  42. #define CONTENT_LENGTH "content-length"
  43. #define CONTENT_TYPE_SHORT "c"
  44. #define CONTENT_TYPE "content-type"
  45. #define CSEQ "cseq"
  46. #define SIPDATE "date"
  47. #define ERROR_INFO "error-info"
  48. #define EXPIRES "expires"
  49. #define FROM "from"
  50. #define FROM_SHORT "f"
  51. #define IN_REPLY_TO "in-reply-to"
  52. #define MAX_FORWARDS "max-forwards"
  53. #define MIME_VERSION "mime-version"
  54. #define MIN_EXPIRES "min-expires"
  55. #define ORGANIZATION "organization"
  56. #define PRIORITY "priority"
  57. #define PROXY_AUTHENTICATE "proxy-authenticate"
  58. #define PROXY_AUTHENTICATION_INFO "proxy-authentication-info"
  59. #define PROXY_AUTHORIZATION "proxy-authorization"
  60. #define PROXY_REQUIRE "proxy-require"
  61. #define RECORD_ROUTE "record-route"
  62. #define REPLY_TO "reply-to"
  63. #define REQUIRE "require"
  64. #define RETRY_AFTER "retry-after"
  65. #define ROUTE "route"
  66. #define SERVER "server"
  67. #define SUBJECT "subject"
  68. #define SUBJECT_SHORT "s"
  69. #define SUPPORTED "supported"
  70. #define TIMESTAMP "timestamp"
  71. #define TO "to"
  72. #define TO_SHORT "t"
  73. #define UNSUPPORTED "unsupported"
  74. #define USER_AGENT "user-agent"
  75. #define VIA "via"
  76. #define VIA_SHORT "v"
  77. #define WARNING "warning"
  78. #define WWW_AUTHENTICATE "www-authenticate"
  79. #define RESPONSE_CODES 51
  80. #define SIP_TRYING 100
  81. #define SIP_RINGING 180
  82. #define SIP_CALL_IS_BEING_FORWARDED 181
  83. #define SIP_QUEUED 182
  84. #define SIP_SESSION_PROGRESS 183
  85. #define SIP_OK 200
  86. #define SIP_ACCEPTED 202
  87. #define SIP_MULTIPLE_CHOICES 300
  88. #define SIP_MOVED_PERMANENTLY 301
  89. #define SIP_MOVED_TEMPORARILY 302
  90. #define SIP_USE_PROXY 305
  91. #define SIP_ALTERNATIVE_SERVICE 380
  92. #define SIP_BAD_REQUEST 400
  93. #define SIP_UNAUTHORIZED 401
  94. #define SIP_PAYMENT_REQUIRED 402
  95. #define SIP_FORBIDDEN 403
  96. #define SIP_NOT_FOUND 404
  97. #define SIP_METHOD_NOT_ALLOWED 405
  98. #define SIP_406_NOT_ACCEPTABLE 406
  99. #define SIP_PROXY_AUTHENTICATION_REQUIRED 407
  100. #define SIP_REQUEST_TIME_OUT 408
  101. #define SIP_GONE 410
  102. #define SIP_REQUEST_ENTITY_TOO_LARGE 413
  103. #define SIP_REQUEST_URI_TOO_LARGE 414
  104. #define SIP_UNSUPPORTED_MEDIA_TYPE 415
  105. #define SIP_UNSUPPORTED_URI_SCHEME 416
  106. #define SIP_BAD_EXTENSION 420
  107. #define SIP_EXTENSION_REQUIRED 421
  108. #define SIP_INTERVAL_TOO_BRIEF 423
  109. #define SIP_TEMPORARILY_UNAVAILABLE 480
  110. #define SIP_CALL_TRANSACTION_DOES_NOT_EXIST 481
  111. #define SIP_LOOP_DETECTED 482
  112. #define SIP_TOO_MANY_HOPS 483
  113. #define SIP_ADDRESS_INCOMPLETE 484
  114. #define SIP_AMBIGUOUS 485
  115. #define SIP_BUSY_HERE 486
  116. #define SIP_REQUEST_TERMINATED 487
  117. #define SIP_NOT_ACCEPTABLE_HERE 488
  118. #define SIP_BAD_EVENT 489
  119. #define SIP_REQUEST_PENDING 491
  120. #define SIP_UNDECIPHERABLE 493
  121. #define SIP_INTERNAL_SERVER_ERROR 500
  122. #define SIP_NOT_IMPLEMENTED 501
  123. #define SIP_BAD_GATEWAY 502
  124. #define SIP_SERVICE_UNAVAILABLE 503
  125. #define SIP_SERVER_TIME_OUT 504
  126. #define SIP_VERSION_NOT_SUPPORTED 505
  127. #define SIP_MESSAGE_TOO_LARGE 513
  128. #define SIP_BUSY_EVRYWHERE 600
  129. #define SIP_DECLINE 603
  130. #define SIP_DOES_NOT_EXIST_ANYWHERE 604
  131. #define SIP_606_NOT_ACCEPTABLE 606
  132. /** is the status code informational */
  133. #define OSIP_IS_SIP_INFO(x) (((x) >= 100) && ((x) < 200))
  134. /** is the status code OK ?*/
  135. #define OSIP_IS_SIP_SUCCESS(x) (((x) >= 200) && ((x) < 300))
  136. /** is the status code a redirect */
  137. #define OSIP_IS_SIP_REDIRECT(x) (((x) >= 300) && ((x) < 400))
  138. /** is the status code a error (client or server) */
  139. #define OSIP_IS_SIP_ERROR(x) (((x) >= 400) && ((x) < 600))
  140. /** is the status code a client error */
  141. #define OSIP_IS_SIP_CLIENT_ERROR(x) (((x) >= 400) && ((x) < 500))
  142. /** is the status code a server error */
  143. #define OSIP_IS_SIP_SERVER_ERROR(x) (((x) >= 500) && ((x) < 600))
  144. #endif /* _CONST_H_ */