Home | History | Annotate | Download | only in base
      1 /*
      2  * libjingle
      3  * Copyright 2004--2005, Google Inc.
      4  *
      5  * Redistribution and use in source and binary forms, with or without
      6  * modification, are permitted provided that the following conditions are met:
      7  *
      8  *  1. Redistributions of source code must retain the above copyright notice,
      9  *     this list of conditions and the following disclaimer.
     10  *  2. Redistributions in binary form must reproduce the above copyright notice,
     11  *     this list of conditions and the following disclaimer in the documentation
     12  *     and/or other materials provided with the distribution.
     13  *  3. The name of the author may not be used to endorse or promote products
     14  *     derived from this software without specific prior written permission.
     15  *
     16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
     17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     18  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
     19  * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     20  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     21  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     22  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     23  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     24  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
     25  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     26  */
     27 
     28 #ifndef TALK_P2P_BASE_CONSTANTS_H_
     29 #define TALK_P2P_BASE_CONSTANTS_H_
     30 
     31 #include <string>
     32 #include "talk/xmllite/qname.h"
     33 
     34 // This file contains constants related to signaling that are used in various
     35 // classes in this directory.
     36 
     37 namespace cricket {
     38 
     39 // NS_ == namespace
     40 // QN_ == buzz::QName (namespace + name)
     41 // LN_ == "local name" == QName::LocalPart()
     42 //   these are useful when you need to find a tag
     43 //   that has different namespaces (like <description> or <transport>)
     44 
     45 extern const char NS_EMPTY[];
     46 extern const char NS_JINGLE[];
     47 extern const char NS_JINGLE_DRAFT[];
     48 extern const char NS_GINGLE[];
     49 
     50 enum SignalingProtocol {
     51   PROTOCOL_JINGLE,
     52   PROTOCOL_GINGLE,
     53   PROTOCOL_HYBRID,
     54 };
     55 
     56 // actions (aka Gingle <session> or Jingle <jingle>)
     57 extern const buzz::StaticQName QN_ACTION;
     58 extern const char LN_INITIATOR[];
     59 extern const buzz::StaticQName QN_INITIATOR;
     60 extern const buzz::StaticQName QN_CREATOR;
     61 
     62 extern const buzz::StaticQName QN_JINGLE;
     63 extern const buzz::StaticQName QN_JINGLE_CONTENT;
     64 extern const buzz::StaticQName QN_JINGLE_CONTENT_NAME;
     65 extern const buzz::StaticQName QN_JINGLE_CONTENT_MEDIA;
     66 extern const buzz::StaticQName QN_JINGLE_REASON;
     67 extern const buzz::StaticQName QN_JINGLE_DRAFT_GROUP;
     68 extern const buzz::StaticQName QN_JINGLE_DRAFT_GROUP_TYPE;
     69 extern const char JINGLE_CONTENT_MEDIA_AUDIO[];
     70 extern const char JINGLE_CONTENT_MEDIA_VIDEO[];
     71 extern const char JINGLE_CONTENT_MEDIA_DATA[];
     72 extern const char JINGLE_ACTION_SESSION_INITIATE[];
     73 extern const char JINGLE_ACTION_SESSION_INFO[];
     74 extern const char JINGLE_ACTION_SESSION_ACCEPT[];
     75 extern const char JINGLE_ACTION_SESSION_TERMINATE[];
     76 extern const char JINGLE_ACTION_TRANSPORT_INFO[];
     77 extern const char JINGLE_ACTION_TRANSPORT_ACCEPT[];
     78 extern const char JINGLE_ACTION_DESCRIPTION_INFO[];
     79 
     80 extern const buzz::StaticQName QN_GINGLE_SESSION;
     81 extern const char GINGLE_ACTION_INITIATE[];
     82 extern const char GINGLE_ACTION_INFO[];
     83 extern const char GINGLE_ACTION_ACCEPT[];
     84 extern const char GINGLE_ACTION_REJECT[];
     85 extern const char GINGLE_ACTION_TERMINATE[];
     86 extern const char GINGLE_ACTION_CANDIDATES[];
     87 extern const char GINGLE_ACTION_UPDATE[];
     88 
     89 extern const char LN_ERROR[];
     90 extern const buzz::StaticQName QN_GINGLE_REDIRECT;
     91 extern const char STR_REDIRECT_PREFIX[];
     92 
     93 // Session Contents (aka Gingle <session><description>
     94 //                   or Jingle <content><description>)
     95 extern const char LN_DESCRIPTION[];
     96 extern const char LN_PAYLOADTYPE[];
     97 extern const buzz::StaticQName QN_ID;
     98 extern const buzz::StaticQName QN_SID;
     99 extern const buzz::StaticQName QN_NAME;
    100 extern const buzz::StaticQName QN_CLOCKRATE;
    101 extern const buzz::StaticQName QN_BITRATE;
    102 extern const buzz::StaticQName QN_CHANNELS;
    103 extern const buzz::StaticQName QN_PARAMETER;
    104 extern const char LN_NAME[];
    105 extern const char LN_VALUE[];
    106 extern const buzz::StaticQName QN_PAYLOADTYPE_PARAMETER_NAME;
    107 extern const buzz::StaticQName QN_PAYLOADTYPE_PARAMETER_VALUE;
    108 extern const char PAYLOADTYPE_PARAMETER_BITRATE[];
    109 extern const char PAYLOADTYPE_PARAMETER_HEIGHT[];
    110 extern const char PAYLOADTYPE_PARAMETER_WIDTH[];
    111 extern const char PAYLOADTYPE_PARAMETER_FRAMERATE[];
    112 extern const char LN_BANDWIDTH[];
    113 
    114 // CN_ == "content name".  When we initiate a session, we choose the
    115 // name, and when we receive a Gingle session, we provide default
    116 // names (since Gingle has no content names).  But when we receive a
    117 // Jingle call, the content name can be anything, so don't rely on
    118 // these values being the same as the ones received.
    119 extern const char CN_AUDIO[];
    120 extern const char CN_VIDEO[];
    121 extern const char CN_DATA[];
    122 extern const char CN_OTHER[];
    123 // other SDP related strings
    124 // GN stands for group name
    125 extern const char GROUP_TYPE_BUNDLE[];
    126 
    127 extern const char NS_JINGLE_RTP[];
    128 extern const buzz::StaticQName QN_JINGLE_RTP_CONTENT;
    129 extern const buzz::StaticQName QN_SSRC;
    130 extern const buzz::StaticQName QN_JINGLE_RTP_PAYLOADTYPE;
    131 extern const buzz::StaticQName QN_JINGLE_RTP_BANDWIDTH;
    132 extern const buzz::StaticQName QN_JINGLE_RTCP_MUX;
    133 extern const buzz::StaticQName QN_JINGLE_RTCP_FB;
    134 extern const buzz::StaticQName QN_SUBTYPE;
    135 extern const buzz::StaticQName QN_JINGLE_RTP_HDREXT;
    136 extern const buzz::StaticQName QN_URI;
    137 
    138 extern const char NS_JINGLE_DRAFT_SCTP[];
    139 extern const buzz::StaticQName QN_JINGLE_DRAFT_SCTP_CONTENT;
    140 extern const buzz::StaticQName QN_JINGLE_DRAFT_SCTP_STREAM;
    141 
    142 extern const char NS_GINGLE_AUDIO[];
    143 extern const buzz::StaticQName QN_GINGLE_AUDIO_CONTENT;
    144 extern const buzz::StaticQName QN_GINGLE_AUDIO_PAYLOADTYPE;
    145 extern const buzz::StaticQName QN_GINGLE_AUDIO_SRCID;
    146 extern const char NS_GINGLE_VIDEO[];
    147 extern const buzz::StaticQName QN_GINGLE_VIDEO_CONTENT;
    148 extern const buzz::StaticQName QN_GINGLE_VIDEO_PAYLOADTYPE;
    149 extern const buzz::StaticQName QN_GINGLE_VIDEO_SRCID;
    150 extern const buzz::StaticQName QN_GINGLE_VIDEO_BANDWIDTH;
    151 
    152 // Crypto support.
    153 extern const buzz::StaticQName QN_ENCRYPTION;
    154 extern const buzz::StaticQName QN_ENCRYPTION_REQUIRED;
    155 extern const buzz::StaticQName QN_CRYPTO;
    156 extern const buzz::StaticQName QN_GINGLE_AUDIO_CRYPTO_USAGE;
    157 extern const buzz::StaticQName QN_GINGLE_VIDEO_CRYPTO_USAGE;
    158 extern const buzz::StaticQName QN_CRYPTO_SUITE;
    159 extern const buzz::StaticQName QN_CRYPTO_KEY_PARAMS;
    160 extern const buzz::StaticQName QN_CRYPTO_TAG;
    161 extern const buzz::StaticQName QN_CRYPTO_SESSION_PARAMS;
    162 
    163 // Transports and candidates.
    164 extern const char LN_TRANSPORT[];
    165 extern const char LN_CANDIDATE[];
    166 extern const buzz::StaticQName QN_JINGLE_P2P_TRANSPORT;
    167 extern const buzz::StaticQName QN_JINGLE_P2P_CANDIDATE;
    168 extern const buzz::StaticQName QN_UFRAG;
    169 extern const buzz::StaticQName QN_COMPONENT;
    170 extern const buzz::StaticQName QN_PWD;
    171 extern const buzz::StaticQName QN_IP;
    172 extern const buzz::StaticQName QN_PORT;
    173 extern const buzz::StaticQName QN_NETWORK;
    174 extern const buzz::StaticQName QN_GENERATION;
    175 extern const buzz::StaticQName QN_PRIORITY;
    176 extern const buzz::StaticQName QN_PROTOCOL;
    177 extern const char ICE_CANDIDATE_TYPE_PEER_STUN[];
    178 extern const char ICE_CANDIDATE_TYPE_SERVER_STUN[];
    179 extern const int ICE_UFRAG_LENGTH;
    180 extern const int ICE_PWD_LENGTH;
    181 extern const size_t ICE_UFRAG_MIN_LENGTH;
    182 extern const size_t ICE_PWD_MIN_LENGTH;
    183 extern const size_t ICE_UFRAG_MAX_LENGTH;
    184 extern const size_t ICE_PWD_MAX_LENGTH;
    185 extern const int ICE_CANDIDATE_COMPONENT_RTP;
    186 extern const int ICE_CANDIDATE_COMPONENT_RTCP;
    187 extern const int ICE_CANDIDATE_COMPONENT_DEFAULT;
    188 
    189 extern const buzz::StaticQName QN_FINGERPRINT;
    190 extern const buzz::StaticQName QN_FINGERPRINT_ALGORITHM;
    191 extern const buzz::StaticQName QN_FINGERPRINT_DIGEST;
    192 
    193 extern const char NS_JINGLE_ICE_UDP[];
    194 
    195 extern const char ICE_OPTION_GICE[];
    196 extern const char NS_GINGLE_P2P[];
    197 extern const buzz::StaticQName QN_GINGLE_P2P_TRANSPORT;
    198 extern const buzz::StaticQName QN_GINGLE_P2P_CANDIDATE;
    199 extern const buzz::StaticQName QN_GINGLE_P2P_UNKNOWN_CHANNEL_NAME;
    200 extern const buzz::StaticQName QN_GINGLE_CANDIDATE;
    201 extern const buzz::StaticQName QN_ADDRESS;
    202 extern const buzz::StaticQName QN_USERNAME;
    203 extern const buzz::StaticQName QN_PASSWORD;
    204 extern const buzz::StaticQName QN_PREFERENCE;
    205 extern const char GINGLE_CANDIDATE_TYPE_STUN[];
    206 extern const char GICE_CHANNEL_NAME_RTP[];
    207 extern const char GICE_CHANNEL_NAME_RTCP[];
    208 extern const char GICE_CHANNEL_NAME_VIDEO_RTP[];
    209 extern const char GICE_CHANNEL_NAME_VIDEO_RTCP[];
    210 extern const char GICE_CHANNEL_NAME_DATA_RTP[];
    211 extern const char GICE_CHANNEL_NAME_DATA_RTCP[];
    212 
    213 extern const char NS_GINGLE_RAW[];
    214 extern const buzz::StaticQName QN_GINGLE_RAW_TRANSPORT;
    215 extern const buzz::StaticQName QN_GINGLE_RAW_CHANNEL;
    216 
    217 // terminate reasons and errors: see http://xmpp.org/extensions/xep-0166.html
    218 extern const char JINGLE_ERROR_BAD_REQUEST[];  // like parse error
    219 // got transport-info before session-initiate, for example
    220 extern const char JINGLE_ERROR_OUT_OF_ORDER[];
    221 extern const char JINGLE_ERROR_UNKNOWN_SESSION[];
    222 
    223 // Call terminate reasons from XEP-166
    224 extern const char STR_TERMINATE_DECLINE[];  // polite reject
    225 extern const char STR_TERMINATE_SUCCESS[];  // polite hangup
    226 extern const char STR_TERMINATE_ERROR[];  // something bad happened
    227 extern const char STR_TERMINATE_INCOMPATIBLE_PARAMETERS[];  // no codecs?
    228 
    229 // Old terminate reasons used by cricket
    230 extern const char STR_TERMINATE_CALL_ENDED[];
    231 extern const char STR_TERMINATE_RECIPIENT_UNAVAILABLE[];
    232 extern const char STR_TERMINATE_RECIPIENT_BUSY[];
    233 extern const char STR_TERMINATE_INSUFFICIENT_FUNDS[];
    234 extern const char STR_TERMINATE_NUMBER_MALFORMED[];
    235 extern const char STR_TERMINATE_NUMBER_DISALLOWED[];
    236 extern const char STR_TERMINATE_PROTOCOL_ERROR[];
    237 extern const char STR_TERMINATE_INTERNAL_SERVER_ERROR[];
    238 extern const char STR_TERMINATE_UNKNOWN_ERROR[];
    239 
    240 // Draft view and notify messages.
    241 extern const char STR_JINGLE_DRAFT_CONTENT_NAME_VIDEO[];
    242 extern const char STR_JINGLE_DRAFT_CONTENT_NAME_AUDIO[];
    243 extern const buzz::StaticQName QN_NICK;
    244 extern const buzz::StaticQName QN_TYPE;
    245 extern const buzz::StaticQName QN_JINGLE_DRAFT_VIEW;
    246 extern const char STR_JINGLE_DRAFT_VIEW_TYPE_NONE[];
    247 extern const char STR_JINGLE_DRAFT_VIEW_TYPE_STATIC[];
    248 extern const buzz::StaticQName QN_JINGLE_DRAFT_PARAMS;
    249 extern const buzz::StaticQName QN_WIDTH;
    250 extern const buzz::StaticQName QN_HEIGHT;
    251 extern const buzz::StaticQName QN_FRAMERATE;
    252 extern const buzz::StaticQName QN_JINGLE_DRAFT_STREAM;
    253 extern const buzz::StaticQName QN_JINGLE_DRAFT_STREAMS;
    254 extern const buzz::StaticQName QN_DISPLAY;
    255 extern const buzz::StaticQName QN_CNAME;
    256 extern const buzz::StaticQName QN_JINGLE_DRAFT_SSRC;
    257 extern const buzz::StaticQName QN_JINGLE_DRAFT_SSRC_GROUP;
    258 extern const buzz::StaticQName QN_SEMANTICS;
    259 extern const buzz::StaticQName QN_JINGLE_LEGACY_NOTIFY;
    260 extern const buzz::StaticQName QN_JINGLE_LEGACY_SOURCE;
    261 
    262 // old stuff
    263 #ifdef FEATURE_ENABLE_VOICEMAIL
    264 extern const char NS_VOICEMAIL[];
    265 extern const buzz::StaticQName QN_VOICEMAIL_REGARDING;
    266 #endif
    267 
    268 // RFC 4145, SDP setup attribute values.
    269 extern const char CONNECTIONROLE_ACTIVE_STR[];
    270 extern const char CONNECTIONROLE_PASSIVE_STR[];
    271 extern const char CONNECTIONROLE_ACTPASS_STR[];
    272 extern const char CONNECTIONROLE_HOLDCONN_STR[];
    273 
    274 }  // namespace cricket
    275 
    276 #endif  // TALK_P2P_BASE_CONSTANTS_H_
    277