Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

302 lines
14 KiB

  1. //
  2. // SIP Definitions
  3. //
  4. // This file contains SIP definitions, named constants, enumerated types, and data structures.
  5. // See RFC 2543 for more information.
  6. //
  7. // This file should never contain any implementation-specific information, including
  8. // function prototypes or C++ classes.
  9. //
  10. #ifndef __sipdef_h
  11. #define __sipdef_h
  12. //
  13. // Versions
  14. //
  15. #define SIP_VERSION_2_0_TEXT "SIP/2.0"
  16. // Used for User-Agent header
  17. #define SIP_USER_AGENT_TEXT "Windows RTC/1.0"
  18. // Used for Content-Type header
  19. #define SIP_CONTENT_TYPE_SDP_TEXT "application/sdp"
  20. #define SIP_CONTENT_TYPE_SDP_MEDIA_TYPE "application"
  21. #define SIP_CONTENT_TYPE_SDP_MEDIA_SUBTYPE "sdp"
  22. #define SIP_CONTENT_TYPE_MSGTEXT_TEXT "text/plain"
  23. #define SIP_CONTENT_TYPE_MSGTEXT_MEDIA_TYPE "text"
  24. #define SIP_CONTENT_TYPE_MSGTEXT_MEDIA_SUBTYPE "plain"
  25. #define SIP_CONTENT_TYPE_TEXTREG_TEXT "text/registration-event"
  26. #define SIP_CONTENT_TYPE_TEXTREG_MEDIA_TYPE "text"
  27. #define SIP_CONTENT_TYPE_TEXTREG_MEDIA_SUBTYPE "registration-event"
  28. #define SIP_CONTENT_TYPE_MSGXML_TEXT "application/xml"
  29. #define SIP_CONTENT_TYPE_MSGXPIDF_TEXT "application/xpidf+xml"
  30. #define SIP_CONTENT_TYPE_MSGXML_MEDIA_TYPE "application"
  31. #define SIP_CONTENT_TYPE_MSGXML_MEDIA_SUBTYPE "xml"
  32. #define SIP_CONTENT_TYPE_XPIDF_MEDIA_TYPE "application"
  33. #define SIP_CONTENT_TYPE_XPIDF_MEDIA_SUBTYPE "xpidf+xml"
  34. //
  35. // Status Codes
  36. //
  37. // Status codes are similar to HTTP.
  38. //
  39. // 1xx Informational: Request received, continuing to process the request.
  40. // 2xx Success: The action was successfully received, understood, and accepted.
  41. // 3xx Redirection: Further action needs to be taken in order to complete the request.
  42. // 4xx Client Error: The request contains bad syntax or cannot be fulfilled at this server.
  43. // 5xx Server Error: The server failed to fulfill an apparently valid request.
  44. // 6xx Global Failure: The request cannot be fulfilled at any server.
  45. //
  46. #define SIP_STATUS_CLASS_INFO 1
  47. #define SIP_STATUS_CLASS_SUCCESS 2
  48. #define SIP_STATUS_CLASS_REDIRECT 3
  49. #define SIP_STATUS_CLASS_CLIENT 4
  50. #define SIP_STATUS_CLASS_SERVER 5
  51. #define SIP_STATUS_CLASS_GLOBAL 6
  52. #define SIP_STATUS_INFO_TRYING 100
  53. #define SIP_STATUS_INFO_RINGING 180
  54. #define SIP_STATUS_INFO_CALL_FORWARDING 181
  55. #define SIP_STATUS_INFO_QUEUED 182
  56. #define SIP_STATUS_SESSION_PROGRESS 183
  57. #define SIP_STATUS_SUCCESS 200
  58. #define SIP_STATUS_REDIRECT_MULTIPLE_CHOICES 300
  59. #define SIP_STATUS_REDIRECT_MOVED_PERMANENTLY 301
  60. #define SIP_STATUS_REDIRECT_MOVED_TEMPORARILY 302
  61. #define SIP_STATUS_REDIRECT_SEE_OTHER 303
  62. #define SIP_STATUS_REDIRECT_USE_PROXY 305
  63. #define SIP_STATUS_REDIRECT_ALTERNATIVE_SERVICE 380
  64. #define SIP_STATUS_CLIENT_BAD_REQUEST 400
  65. #define SIP_STATUS_CLIENT_UNAUTHORIZED 401
  66. #define SIP_STATUS_CLIENT_PAYMENT_REQUIRED 402
  67. #define SIP_STATUS_CLIENT_FORBIDDEN 403
  68. #define SIP_STATUS_CLIENT_NOT_FOUND 404
  69. #define SIP_STATUS_CLIENT_METHOD_NOT_ALLOWED 405
  70. #define SIP_STATUS_CLIENT_NOT_ACCEPTABLE 406
  71. #define SIP_STATUS_CLIENT_PROXY_AUTHENTICATION_REQUIRED 407
  72. #define SIP_STATUS_CLIENT_REQUEST_TIMEOUT 408
  73. #define SIP_STATUS_CLIENT_CONFLICT 409
  74. #define SIP_STATUS_CLIENT_GONE 410
  75. #define SIP_STATUS_CLIENT_LENGTH_REQUIRED 411
  76. #define SIP_STATUS_CLIENT_REQUEST_ENTITY_TOO_LARGE 413
  77. #define SIP_STATUS_CLIENT_REQUEST_URI_TOO_LARGE 414
  78. #define SIP_STATUS_CLIENT_UNSUPPORTED_MEDIA_TYPE 415
  79. #define SIP_STATUS_CLIENT_BAD_EXTENSION 420
  80. #define SIP_STATUS_CLIENT_TEMPORARILY_NOT_AVAILABLE 480
  81. #define SIP_STATUS_CLIENT_TRANSACTION_DOES_NOT_EXIST 481
  82. #define SIP_STATUS_CLIENT_LOOP_DETECTED 482
  83. #define SIP_STATUS_CLIENT_TOO_MANY_HOPS 483
  84. #define SIP_STATUS_CLIENT_ADDRESS_INCOMPLETE 484
  85. #define SIP_STATUS_CLIENT_AMBIGUOUS 485
  86. #define SIP_STATUS_CLIENT_BUSY_HERE 486
  87. #define SIP_STATUS_REQUEST_TERMINATED 487
  88. #define SIP_STATUS_NOT_ACCEPTABLE_HERE 488
  89. #define SIP_STATUS_SERVER_INTERNAL_ERROR 500
  90. #define SIP_STATUS_SERVER_NOT_IMPLEMENTED 501
  91. #define SIP_STATUS_SERVER_BAD_GATEWAY 502
  92. #define SIP_STATUS_SERVER_SERVICE_UNAVAILABLE 503
  93. #define SIP_STATUS_SERVER_SERVER_TIMEOUT 504
  94. #define SIP_STATUS_SERVER_VERSION_NOT_SUPPORTED 505
  95. #define SIP_STATUS_GLOBAL_BUSY_EVERYWHERE 600
  96. #define SIP_STATUS_GLOBAL_DECLINE 603
  97. #define SIP_STATUS_GLOBAL_DOES_NOT_EXIST_ANYWHERE 604
  98. #define SIP_STATUS_GLOBAL_NOT_ACCEPTABLE 606
  99. // Text Phrases
  100. #define SIP_STATUS_INFO_TRYING_TEXT "Trying"
  101. #define SIP_STATUS_INFO_RINGING_TEXT "Ringing"
  102. #define SIP_STATUS_INFO_CALL_FORWARDING_TEXT "Call Is Being Forwarded"
  103. #define SIP_STATUS_INFO_QUEUED_TEXT "Queued"
  104. #define SIP_STATUS_SESSION_PROGRESS_TEXT "Session Progress"
  105. #define SIP_STATUS_SUCCESS_TEXT "OK"
  106. #define SIP_STATUS_REDIRECT_MULTIPLE_CHOICES_TEXT "Multiple Choices"
  107. #define SIP_STATUS_REDIRECT_MOVED_PERMANENTLY_TEXT "Moved Permanently"
  108. #define SIP_STATUS_REDIRECT_MOVED_TEMPORARILY_TEXT "Moved Temporarily"
  109. #define SIP_STATUS_REDIRECT_SEE_OTHER_TEXT "See Other"
  110. #define SIP_STATUS_REDIRECT_USE_PROXY_TEXT "Use Proxy"
  111. #define SIP_STATUS_REDIRECT_ALTERNATIVE_SERVICE_TEXT "Alternative Service"
  112. #define SIP_STATUS_CLIENT_BAD_REQUEST_TEXT "Bad Request"
  113. #define SIP_STATUS_CLIENT_UNAUTHORIZED_TEXT "Unauthorized"
  114. #define SIP_STATUS_CLIENT_PAYMENT_REQUIRED_TEXT "Payment Required"
  115. #define SIP_STATUS_CLIENT_FORBIDDEN_TEXT "Forbidden"
  116. #define SIP_STATUS_CLIENT_NOT_FOUND_TEXT "Not Found"
  117. #define SIP_STATUS_CLIENT_METHOD_NOT_ALLOWED_TEXT "Method Not Allowed"
  118. #define SIP_STATUS_CLIENT_NOT_ACCEPTABLE_TEXT "Not Acceptable"
  119. #define SIP_STATUS_CLIENT_PROXY_AUTHENTICATION_REQUIRED_TEXT "Proxy Authentication Required"
  120. #define SIP_STATUS_CLIENT_REQUEST_TIMEOUT_TEXT "Request Timeout"
  121. #define SIP_STATUS_CLIENT_CONFLICT_TEXT "Conflict"
  122. #define SIP_STATUS_CLIENT_GONE_TEXT "Gone"
  123. #define SIP_STATUS_CLIENT_LENGTH_REQUIRED_TEXT "Length Required"
  124. #define SIP_STATUS_CLIENT_REQUEST_ENTITY_TOO_LARGE_TEXT "Request Entity Too Large"
  125. #define SIP_STATUS_CLIENT_REQUEST_URI_TOO_LARGE_TEXT "Request-URI Too Long"
  126. #define SIP_STATUS_CLIENT_UNSUPPORTED_MEDIA_TYPE_TEXT "Unsupported Media Type"
  127. #define SIP_STATUS_CLIENT_BAD_EXTENSION_TEXT "Bad Extension"
  128. #define SIP_STATUS_CLIENT_TEMPORARILY_NOT_AVAILABLE_TEXT "Temporarily Unavailable"
  129. #define SIP_STATUS_CLIENT_TRANSACTION_DOES_NOT_EXIST_TEXT "Call Leg/Transaction Does Not Exist"
  130. #define SIP_STATUS_CLIENT_LOOP_DETECTED_TEXT "Loop Detected"
  131. #define SIP_STATUS_CLIENT_TOO_MANY_HOPS_TEXT "Too Many Hops"
  132. #define SIP_STATUS_CLIENT_ADDRESS_INCOMPLETE_TEXT "Address Incomplete"
  133. #define SIP_STATUS_CLIENT_AMBIGUOUS_TEXT "Ambiguous"
  134. #define SIP_STATUS_CLIENT_BUSY_HERE_TEXT "Busy Here"
  135. #define SIP_STATUS_REQUEST_TERMINATED_TEXT "Request Terminated"
  136. #define SIP_STATUS_NOT_ACCEPTABLE_HERE_TEXT "Not Acceptable Here"
  137. #define SIP_STATUS_SERVER_INTERNAL_ERROR_TEXT "Server Internal Error"
  138. #define SIP_STATUS_SERVER_NOT_IMPLEMENTED_TEXT "Not Implemented"
  139. #define SIP_STATUS_SERVER_BAD_GATEWAY_TEXT "Bad Gateway"
  140. #define SIP_STATUS_SERVER_SERVICE_UNAVAILABLE_TEXT "Service Unavailable"
  141. #define SIP_STATUS_SERVER_SERVER_TIMEOUT_TEXT "Server Time-out"
  142. #define SIP_STATUS_SERVER_VERSION_NOT_SUPPORTED_TEXT "Version Not Supported"
  143. #define SIP_STATUS_GLOBAL_BUSY_EVERYWHERE_TEXT "Busy Everywhere"
  144. #define SIP_STATUS_GLOBAL_DECLINE_TEXT "Decline"
  145. #define SIP_STATUS_GLOBAL_DOES_NOT_EXIST_ANYWHERE_TEXT "Does Not Exist Anywhere"
  146. #define SIP_STATUS_GLOBAL_NOT_ACCEPTABLE_TEXT "Not Acceptable"
  147. // Phrases
  148. #define SIP_STATUS_100_TEXT "Trying"
  149. #define SIP_STATUS_180_TEXT "Ringing"
  150. #define SIP_STATUS_181_TEXT "Call Is Being Forwarded"
  151. #define SIP_STATUS_182_TEXT "Queued"
  152. #define SIP_STATUS_183_TEXT "Session Progress"
  153. #define SIP_STATUS_200_TEXT "OK"
  154. #define SIP_STATUS_300_TEXT "Multiple Choices"
  155. #define SIP_STATUS_301_TEXT "Moved Permanently"
  156. #define SIP_STATUS_302_TEXT "Moved Temporarily"
  157. #define SIP_STATUS_303_TEXT "See Other"
  158. #define SIP_STATUS_305_TEXT "Use Proxy"
  159. #define SIP_STATUS_380_TEXT "Alternative Service"
  160. #define SIP_STATUS_400_TEXT "Bad Request"
  161. #define SIP_STATUS_401_TEXT "Unauthorized"
  162. #define SIP_STATUS_402_TEXT "Payment Required"
  163. #define SIP_STATUS_403_TEXT "Forbidden"
  164. #define SIP_STATUS_404_TEXT "Not Found"
  165. #define SIP_STATUS_405_TEXT "Method Not Allowed"
  166. #define SIP_STATUS_406_TEXT "Not Acceptable"
  167. #define SIP_STATUS_407_TEXT "Proxy Authentication Required"
  168. #define SIP_STATUS_408_TEXT "Request Timeout"
  169. #define SIP_STATUS_409_TEXT "Conflict"
  170. #define SIP_STATUS_410_TEXT "Gone"
  171. #define SIP_STATUS_411_TEXT "Length Required"
  172. #define SIP_STATUS_413_TEXT "Request Entity Too Large"
  173. #define SIP_STATUS_414_TEXT "Request-URI Too Long"
  174. #define SIP_STATUS_415_TEXT "Unsupported Media Type"
  175. #define SIP_STATUS_420_TEXT "Bad Extension"
  176. #define SIP_STATUS_480_TEXT "Temporarily Unavailable"
  177. #define SIP_STATUS_481_TEXT "Call Leg/Transaction Does Not Exist"
  178. #define SIP_STATUS_482_TEXT "Loop Detected"
  179. #define SIP_STATUS_483_TEXT "Too Many Hops"
  180. #define SIP_STATUS_484_TEXT "Address Incomplete"
  181. #define SIP_STATUS_485_TEXT "Ambiguous"
  182. #define SIP_STATUS_486_TEXT "Busy Here"
  183. #define SIP_STATUS_487_TEXT "Request Terminated"
  184. #define SIP_STATUS_488_TEXT "Not Acceptable Here"
  185. #define SIP_STATUS_500_TEXT "Server Internal Error"
  186. #define SIP_STATUS_501_TEXT "Not Implemented"
  187. #define SIP_STATUS_502_TEXT "Bad Gateway"
  188. #define SIP_STATUS_503_TEXT "Service Unavailable"
  189. #define SIP_STATUS_504_TEXT "Server Time-out"
  190. #define SIP_STATUS_505_TEXT "Version Not Supported"
  191. #define SIP_STATUS_600_TEXT "Busy Everywhere"
  192. #define SIP_STATUS_603_TEXT "Decline"
  193. #define SIP_STATUS_604_TEXT "Does Not Exist Anywhere"
  194. #define SIP_STATUS_606_TEXT "Not Acceptable"
  195. #define SIP_STATUS_TEXT(Code) SIP_STATUS_## Code ## _TEXT
  196. #define SIP_STATUS_TEXT_SIZE(Code) sizeof(SIP_STATUS_TEXT(Code)) - 1
  197. //
  198. // Timer values
  199. //
  200. // All values are in milliseconds
  201. //
  202. #ifndef SIP_TIMER_DBG
  203. // Actual Timer values in milliseconds
  204. #define SIP_TIMER_RETRY_INTERVAL_T1 500
  205. #define SIP_TIMER_RETRY_INTERVAL_T2 4000
  206. #define SIP_TIMER_INTERVAL_AFTER_INVITE_SENT_TCP 32000
  207. #define SIP_TIMER_INTERVAL_AFTER_BYE_SENT_TCP 32000
  208. #define SIP_TIMER_INTERVAL_AFTER_REGISTER_SENT_TCP 32000
  209. #define SIP_TIMER_INTERVAL_AFTER_REQFAIL_SENT_TCP 32000
  210. #define SIP_TIMER_INTERVAL_AFTER_PROV_RESPONSE_RCVD 32000
  211. #define SIP_TIMER_INTERVAL_AFTER_INVITE_PROV_RESPONSE_RCVD 128000
  212. #define SIP_TIMER_MAX_RETRY_INTERVAL 32000
  213. #define SIP_TIMER_MAX_INTERVAL 32000
  214. // Timer used for SSL negotiation
  215. #define SSL_DEFAULT_TIMER 30000
  216. // Timer used for HTTPS connect
  217. #define HTTPS_CONNECT_DEFAULT_TIMER 60000
  218. // in seconds
  219. #define REGISTER_DEFAULT_TIMER 900
  220. #define SUBSCRIBE_DEFAULT_TIMER 3000 //50 minutes.
  221. #define REGISTER_SSL_TUNNEL_TIMER 90
  222. #else // SIP_TIMER_DBG
  223. // Timer values to play with while debugging
  224. #define SIP_TIMER_RETRY_INTERVAL_T1 500
  225. #define SIP_TIMER_RETRY_INTERVAL_T2 4000
  226. #define SIP_TIMER_INTERVAL_AFTER_INVITE_SENT_TCP 32000
  227. #define SIP_TIMER_INTERVAL_AFTER_BYE_SENT_TCP 32000
  228. #define SIP_TIMER_INTERVAL_AFTER_REGISTER_SENT_TCP 32000
  229. #define SIP_TIMER_INTERVAL_AFTER_PROV_RESPONSE_RCVD 32000
  230. #define SIP_TIMER_INTERVAL_AFTER_INVITE_PROV_RESPONSE_RCVD 128000
  231. #define SIP_TIMER_MAX_RETRY_INTERVAL 32000
  232. #define SIP_TIMER_MAX_INTERVAL 32000
  233. // Timer used for HTTPS connect
  234. #define HTTPS_CONNECT_DEFAULT_TIMER 500
  235. // in seconds
  236. #define REGISTER_DEFAULT_TIMER 900
  237. #define SUBSCRIBE_DEFAULT_TIMER 3000 //50 minutes.
  238. #define REGISTER_SSL_TUNNEL_TIMER 90
  239. #endif // SIP_TIMER_DBG
  240. //
  241. // Well-known protocol addresses
  242. // Taken from RFC 2543
  243. //
  244. #define SIP_NETWORK_ADDRESS_ALL_SERVERS 0xE0000149 // 224.0.1.75
  245. #define SIP_DEFAULT_TCP_PORT 5060
  246. #define SIP_DEFAULT_UDP_PORT 5060
  247. #define SIP_DEFAULT_SSL_PORT 5061
  248. //#define SIP_DEFAULT_PORT 5060
  249. #define SIP_ACCEPT_ENCODING_TEXT "identity"
  250. #define SIP_ALLOW_TEXT "INVITE, BYE, OPTIONS, MESSAGE, ACK, CANCEL, NOTIFY, SUBSCRIBE, INFO"
  251. #define USR_STATUS_TYPING_TEXT "Typing"
  252. #define USR_STATUS_IDLE_TEXT "Idle"
  253. #endif // __sipdef_h