OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license | |
5 * that can be found in the LICENSE file in the root of the source | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 #include "webrtc/libjingle/session/constants.h" | |
12 | |
13 #include <string> | |
14 | |
15 #include "webrtc/libjingle/xmllite/qname.h" | |
16 #include "webrtc/p2p/base/constants.h" | |
17 | |
18 namespace cricket { | |
19 | |
20 const char NS_EMPTY[] = ""; | |
21 const char NS_JINGLE[] = "urn:xmpp:jingle:1"; | |
22 const char NS_JINGLE_DRAFT[] = "google:jingle"; | |
23 const char NS_GINGLE[] = "http://www.google.com/session"; | |
24 | |
25 // actions (aka <session> or <jingle>) | |
26 const buzz::StaticQName QN_ACTION = { NS_EMPTY, "action" }; | |
27 const char LN_INITIATOR[] = "initiator"; | |
28 const buzz::StaticQName QN_INITIATOR = { NS_EMPTY, LN_INITIATOR }; | |
29 const buzz::StaticQName QN_CREATOR = { NS_EMPTY, "creator" }; | |
30 | |
31 const buzz::StaticQName QN_JINGLE = { NS_JINGLE, "jingle" }; | |
32 const buzz::StaticQName QN_JINGLE_CONTENT = { NS_JINGLE, "content" }; | |
33 const buzz::StaticQName QN_JINGLE_CONTENT_NAME = { NS_EMPTY, "name" }; | |
34 const buzz::StaticQName QN_JINGLE_CONTENT_MEDIA = { NS_EMPTY, "media" }; | |
35 const buzz::StaticQName QN_JINGLE_REASON = { NS_JINGLE, "reason" }; | |
36 const buzz::StaticQName QN_JINGLE_DRAFT_GROUP = { NS_JINGLE_DRAFT, "group" }; | |
37 const buzz::StaticQName QN_JINGLE_DRAFT_GROUP_TYPE = { NS_EMPTY, "type" }; | |
38 const char JINGLE_CONTENT_MEDIA_AUDIO[] = "audio"; | |
39 const char JINGLE_CONTENT_MEDIA_VIDEO[] = "video"; | |
40 const char JINGLE_CONTENT_MEDIA_DATA[] = "data"; | |
41 const char JINGLE_ACTION_SESSION_INITIATE[] = "session-initiate"; | |
42 const char JINGLE_ACTION_SESSION_INFO[] = "session-info"; | |
43 const char JINGLE_ACTION_SESSION_ACCEPT[] = "session-accept"; | |
44 const char JINGLE_ACTION_SESSION_TERMINATE[] = "session-terminate"; | |
45 const char JINGLE_ACTION_TRANSPORT_INFO[] = "transport-info"; | |
46 const char JINGLE_ACTION_TRANSPORT_ACCEPT[] = "transport-accept"; | |
47 const char JINGLE_ACTION_DESCRIPTION_INFO[] = "description-info"; | |
48 | |
49 const buzz::StaticQName QN_GINGLE_SESSION = { NS_GINGLE, "session" }; | |
50 const char GINGLE_ACTION_INITIATE[] = "initiate"; | |
51 const char GINGLE_ACTION_INFO[] = "info"; | |
52 const char GINGLE_ACTION_ACCEPT[] = "accept"; | |
53 const char GINGLE_ACTION_REJECT[] = "reject"; | |
54 const char GINGLE_ACTION_TERMINATE[] = "terminate"; | |
55 const char GINGLE_ACTION_CANDIDATES[] = "candidates"; | |
56 const char GINGLE_ACTION_UPDATE[] = "update"; | |
57 | |
58 const char LN_ERROR[] = "error"; | |
59 const buzz::StaticQName QN_GINGLE_REDIRECT = { NS_GINGLE, "redirect" }; | |
60 const char STR_REDIRECT_PREFIX[] = "xmpp:"; | |
61 | |
62 // Session Contents (aka Gingle <session><description> | |
63 // or Jingle <content><description>) | |
64 const char LN_DESCRIPTION[] = "description"; | |
65 const char LN_PAYLOADTYPE[] = "payload-type"; | |
66 const buzz::StaticQName QN_ID = { NS_EMPTY, "id" }; | |
67 const buzz::StaticQName QN_SID = { NS_EMPTY, "sid" }; | |
68 const buzz::StaticQName QN_NAME = { NS_EMPTY, "name" }; | |
69 const buzz::StaticQName QN_CLOCKRATE = { NS_EMPTY, "clockrate" }; | |
70 const buzz::StaticQName QN_BITRATE = { NS_EMPTY, "bitrate" }; | |
71 const buzz::StaticQName QN_CHANNELS = { NS_EMPTY, "channels" }; | |
72 const buzz::StaticQName QN_WIDTH = { NS_EMPTY, "width" }; | |
73 const buzz::StaticQName QN_HEIGHT = { NS_EMPTY, "height" }; | |
74 const buzz::StaticQName QN_FRAMERATE = { NS_EMPTY, "framerate" }; | |
75 const char LN_NAME[] = "name"; | |
76 const char LN_VALUE[] = "value"; | |
77 const buzz::StaticQName QN_PAYLOADTYPE_PARAMETER_NAME = { NS_EMPTY, LN_NAME }; | |
78 const buzz::StaticQName QN_PAYLOADTYPE_PARAMETER_VALUE = { NS_EMPTY, LN_VALUE }; | |
79 const char PAYLOADTYPE_PARAMETER_BITRATE[] = "bitrate"; | |
80 const char PAYLOADTYPE_PARAMETER_HEIGHT[] = "height"; | |
81 const char PAYLOADTYPE_PARAMETER_WIDTH[] = "width"; | |
82 const char PAYLOADTYPE_PARAMETER_FRAMERATE[] = "framerate"; | |
83 const char LN_BANDWIDTH[] = "bandwidth"; | |
84 | |
85 const buzz::StaticQName QN_JINGLE_RTP_CONTENT = | |
86 { NS_JINGLE_RTP, LN_DESCRIPTION }; | |
87 const buzz::StaticQName QN_SSRC = { NS_EMPTY, "ssrc" }; | |
88 const buzz::StaticQName QN_JINGLE_RTP_PAYLOADTYPE = | |
89 { NS_JINGLE_RTP, LN_PAYLOADTYPE }; | |
90 const buzz::StaticQName QN_JINGLE_RTP_BANDWIDTH = | |
91 { NS_JINGLE_RTP, LN_BANDWIDTH }; | |
92 const buzz::StaticQName QN_JINGLE_RTCP_MUX = { NS_JINGLE_RTP, "rtcp-mux" }; | |
93 const buzz::StaticQName QN_JINGLE_RTCP_FB = { NS_JINGLE_RTP, "rtcp-fb" }; | |
94 const buzz::StaticQName QN_SUBTYPE = { NS_EMPTY, "subtype" }; | |
95 const buzz::StaticQName QN_PARAMETER = { NS_JINGLE_RTP, "parameter" }; | |
96 const buzz::StaticQName QN_JINGLE_RTP_HDREXT = | |
97 { NS_JINGLE_RTP, "rtp-hdrext" }; | |
98 const buzz::StaticQName QN_URI = { NS_EMPTY, "uri" }; | |
99 | |
100 const buzz::StaticQName QN_JINGLE_DRAFT_SCTP_CONTENT = | |
101 { NS_JINGLE_DRAFT_SCTP, LN_DESCRIPTION }; | |
102 const buzz::StaticQName QN_JINGLE_DRAFT_SCTP_STREAM = | |
103 { NS_JINGLE_DRAFT_SCTP, "stream" }; | |
104 | |
105 const char NS_GINGLE_AUDIO[] = "http://www.google.com/session/phone"; | |
106 const buzz::StaticQName QN_GINGLE_AUDIO_CONTENT = | |
107 { NS_GINGLE_AUDIO, LN_DESCRIPTION }; | |
108 const buzz::StaticQName QN_GINGLE_AUDIO_PAYLOADTYPE = | |
109 { NS_GINGLE_AUDIO, LN_PAYLOADTYPE }; | |
110 const buzz::StaticQName QN_GINGLE_AUDIO_SRCID = { NS_GINGLE_AUDIO, "src-id" }; | |
111 const char NS_GINGLE_VIDEO[] = "http://www.google.com/session/video"; | |
112 const buzz::StaticQName QN_GINGLE_VIDEO_CONTENT = | |
113 { NS_GINGLE_VIDEO, LN_DESCRIPTION }; | |
114 const buzz::StaticQName QN_GINGLE_VIDEO_PAYLOADTYPE = | |
115 { NS_GINGLE_VIDEO, LN_PAYLOADTYPE }; | |
116 const buzz::StaticQName QN_GINGLE_VIDEO_SRCID = { NS_GINGLE_VIDEO, "src-id" }; | |
117 const buzz::StaticQName QN_GINGLE_VIDEO_BANDWIDTH = | |
118 { NS_GINGLE_VIDEO, LN_BANDWIDTH }; | |
119 | |
120 // Crypto support. | |
121 const buzz::StaticQName QN_ENCRYPTION = { NS_JINGLE_RTP, "encryption" }; | |
122 const buzz::StaticQName QN_ENCRYPTION_REQUIRED = { NS_EMPTY, "required" }; | |
123 const buzz::StaticQName QN_CRYPTO = { NS_JINGLE_RTP, "crypto" }; | |
124 const buzz::StaticQName QN_GINGLE_AUDIO_CRYPTO_USAGE = | |
125 { NS_GINGLE_AUDIO, "usage" }; | |
126 const buzz::StaticQName QN_GINGLE_VIDEO_CRYPTO_USAGE = | |
127 { NS_GINGLE_VIDEO, "usage" }; | |
128 const buzz::StaticQName QN_CRYPTO_SUITE = { NS_EMPTY, "crypto-suite" }; | |
129 const buzz::StaticQName QN_CRYPTO_KEY_PARAMS = { NS_EMPTY, "key-params" }; | |
130 const buzz::StaticQName QN_CRYPTO_TAG = { NS_EMPTY, "tag" }; | |
131 const buzz::StaticQName QN_CRYPTO_SESSION_PARAMS = | |
132 { NS_EMPTY, "session-params" }; | |
133 | |
134 // Transports and candidates. | |
135 const char LN_TRANSPORT[] = "transport"; | |
136 const char LN_CANDIDATE[] = "candidate"; | |
137 const buzz::StaticQName QN_UFRAG = { cricket::NS_EMPTY, "ufrag" }; | |
138 const buzz::StaticQName QN_PWD = { cricket::NS_EMPTY, "pwd" }; | |
139 const buzz::StaticQName QN_COMPONENT = { cricket::NS_EMPTY, "component" }; | |
140 const buzz::StaticQName QN_IP = { cricket::NS_EMPTY, "ip" }; | |
141 const buzz::StaticQName QN_PORT = { cricket::NS_EMPTY, "port" }; | |
142 const buzz::StaticQName QN_NETWORK = { cricket::NS_EMPTY, "network" }; | |
143 const buzz::StaticQName QN_GENERATION = { cricket::NS_EMPTY, "generation" }; | |
144 const buzz::StaticQName QN_PRIORITY = { cricket::NS_EMPTY, "priority" }; | |
145 const buzz::StaticQName QN_PROTOCOL = { cricket::NS_EMPTY, "protocol" }; | |
146 const char ICE_CANDIDATE_TYPE_PEER_STUN[] = "prflx"; | |
147 const char ICE_CANDIDATE_TYPE_SERVER_STUN[] = "srflx"; | |
148 | |
149 const buzz::StaticQName QN_FINGERPRINT = { cricket::NS_EMPTY, "fingerprint" }; | |
150 const buzz::StaticQName QN_FINGERPRINT_ALGORITHM = | |
151 { cricket::NS_EMPTY, "algorithm" }; | |
152 const buzz::StaticQName QN_FINGERPRINT_DIGEST = { cricket::NS_EMPTY, "digest" }; | |
153 | |
154 const buzz::StaticQName QN_GINGLE_P2P_TRANSPORT = | |
155 { NS_GINGLE_P2P, LN_TRANSPORT }; | |
156 const buzz::StaticQName QN_GINGLE_P2P_CANDIDATE = | |
157 { NS_GINGLE_P2P, LN_CANDIDATE }; | |
158 const buzz::StaticQName QN_GINGLE_P2P_UNKNOWN_CHANNEL_NAME = | |
159 { NS_GINGLE_P2P, "unknown-channel-name" }; | |
160 const buzz::StaticQName QN_GINGLE_CANDIDATE = { NS_GINGLE, LN_CANDIDATE }; | |
161 const buzz::StaticQName QN_ADDRESS = { cricket::NS_EMPTY, "address" }; | |
162 const buzz::StaticQName QN_USERNAME = { cricket::NS_EMPTY, "username" }; | |
163 const buzz::StaticQName QN_PASSWORD = { cricket::NS_EMPTY, "password" }; | |
164 const buzz::StaticQName QN_PREFERENCE = { cricket::NS_EMPTY, "preference" }; | |
165 | |
166 // terminate reasons and errors | |
167 const char JINGLE_ERROR_BAD_REQUEST[] = "bad-request"; | |
168 const char JINGLE_ERROR_OUT_OF_ORDER[] = "out-of-order"; | |
169 const char JINGLE_ERROR_UNKNOWN_SESSION[] = "unknown-session"; | |
170 | |
171 // Call terminate reasons from XEP-166 | |
172 const char STR_TERMINATE_DECLINE[] = "decline"; | |
173 const char STR_TERMINATE_SUCCESS[] = "success"; | |
174 const char STR_TERMINATE_ERROR[] = "general-error"; | |
175 const char STR_TERMINATE_INCOMPATIBLE_PARAMETERS[] = "incompatible-parameters"; | |
176 | |
177 // Old terminate reasons used by cricket | |
178 const char STR_TERMINATE_CALL_ENDED[] = "call-ended"; | |
179 const char STR_TERMINATE_RECIPIENT_UNAVAILABLE[] = "recipient-unavailable"; | |
180 const char STR_TERMINATE_RECIPIENT_BUSY[] = "recipient-busy"; | |
181 const char STR_TERMINATE_INSUFFICIENT_FUNDS[] = "insufficient-funds"; | |
182 const char STR_TERMINATE_NUMBER_MALFORMED[] = "number-malformed"; | |
183 const char STR_TERMINATE_NUMBER_DISALLOWED[] = "number-disallowed"; | |
184 const char STR_TERMINATE_PROTOCOL_ERROR[] = "protocol-error"; | |
185 const char STR_TERMINATE_INTERNAL_SERVER_ERROR[] = "internal-server-error"; | |
186 const char STR_TERMINATE_UNKNOWN_ERROR[] = "unknown-error"; | |
187 | |
188 // Draft view and notify messages. | |
189 const char STR_JINGLE_DRAFT_CONTENT_NAME_VIDEO[] = "video"; | |
190 const char STR_JINGLE_DRAFT_CONTENT_NAME_AUDIO[] = "audio"; | |
191 const buzz::StaticQName QN_NICK = { cricket::NS_EMPTY, "nick" }; | |
192 const buzz::StaticQName QN_TYPE = { cricket::NS_EMPTY, "type" }; | |
193 const buzz::StaticQName QN_JINGLE_DRAFT_VIEW = { NS_JINGLE_DRAFT, "view" }; | |
194 const char STR_JINGLE_DRAFT_VIEW_TYPE_NONE[] = "none"; | |
195 const char STR_JINGLE_DRAFT_VIEW_TYPE_STATIC[] = "static"; | |
196 const buzz::StaticQName QN_JINGLE_DRAFT_PARAMS = { NS_JINGLE_DRAFT, "params" }; | |
197 const buzz::StaticQName QN_JINGLE_DRAFT_STREAMS = { NS_JINGLE_DRAFT, "streams" }
; | |
198 const buzz::StaticQName QN_JINGLE_DRAFT_STREAM = { NS_JINGLE_DRAFT, "stream" }; | |
199 const buzz::StaticQName QN_DISPLAY = { cricket::NS_EMPTY, "display" }; | |
200 const buzz::StaticQName QN_CNAME = { cricket::NS_EMPTY, "cname" }; | |
201 const buzz::StaticQName QN_JINGLE_DRAFT_SSRC = { NS_JINGLE_DRAFT, "ssrc" }; | |
202 const buzz::StaticQName QN_JINGLE_DRAFT_SSRC_GROUP = | |
203 { NS_JINGLE_DRAFT, "ssrc-group" }; | |
204 const buzz::StaticQName QN_SEMANTICS = { cricket::NS_EMPTY, "semantics" }; | |
205 const buzz::StaticQName QN_JINGLE_LEGACY_NOTIFY = { NS_JINGLE_DRAFT, "notify" }; | |
206 const buzz::StaticQName QN_JINGLE_LEGACY_SOURCE = { NS_JINGLE_DRAFT, "source" }; | |
207 | |
208 const buzz::StaticQName QN_GINGLE_RAW_TRANSPORT = { NS_GINGLE_RAW, "transport" }
; | |
209 const buzz::StaticQName QN_GINGLE_RAW_CHANNEL = { NS_GINGLE_RAW, "channel" }; | |
210 | |
211 // old stuff | |
212 #ifdef FEATURE_ENABLE_VOICEMAIL | |
213 const char NS_VOICEMAIL[] = "http://www.google.com/session/voicemail"; | |
214 const buzz::StaticQName QN_VOICEMAIL_REGARDING = { NS_VOICEMAIL, "regarding" }; | |
215 #endif | |
216 | |
217 } // namespace cricket | |
OLD | NEW |