vivox-sdk-node 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,300 @@
1
+ /* Copyright (c) 2019 Unity Technologies.
2
+ *
3
+ * This software is subject to, and made available under, the Unity Terms of Service (see Unity Terms of Service).
4
+ * Your use of this software constitutes your acceptance of such terms.
5
+
6
+ * Unless expressly provided otherwise, the software under this license is made available strictly on an "AS IS" BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.
7
+ * Please review the Terms of Service for details on these and other terms and conditions.”
8
+ */
9
+ #pragma once
10
+
11
+ #include <VxcExports.h>
12
+ #include <Vxc.h>
13
+ #include <VxcEvents.h>
14
+
15
+ // Error Code Definitions (V4)
16
+ #define VX_E_NO_MESSAGE_AVAILABLE -1
17
+ #define VX_E_SUCCESS 0
18
+ #define VX_E_INVALID_XML 1000
19
+ #define VX_E_NO_EXIST 1001
20
+ #define VX_E_MAX_CONNECTOR_LIMIT_EXCEEDED 1002
21
+ #define VX_E_MAX_SESSION_LIMIT_EXCEEDED 1003
22
+ #define VX_E_FAILED 1004
23
+ #define VX_E_ALREADY_LOGGED_IN 1005
24
+ #define VX_E_ALREADY_LOGGED_OUT 1006 // This is not returned.
25
+ #define VX_E_NOT_LOGGED_IN 1007 // This is not returned.
26
+ #define VX_E_INVALID_ARGUMENT 1008
27
+ #define VX_E_INVALID_USERNAME_OR_PASSWORD 1009
28
+ #define VX_E_INSUFFICIENT_PRIVILEGE 1010
29
+ #define VX_E_NO_SUCH_SESSION 1011
30
+ #define VX_E_NOT_INITIALIZED 1012
31
+ #define VX_E_REQUESTCONTEXT_NOT_FOUND 1013
32
+ #define VX_E_LOGIN_FAILED 1014
33
+ #define VX_E_SESSION_MAX 1015 // Used if already on a call.
34
+ #define VX_E_WRONG_CONNECTOR 1016
35
+ #define VX_E_NOT_IMPL 1017
36
+ #define VX_E_REQUEST_CANCELLED 1018
37
+ #define VX_E_INVALID_SESSION_STATE 1019
38
+ #define VX_E_SESSION_CREATE_PENDING 1020
39
+ #define VX_E_SESSION_TERMINATE_PENDING 1021
40
+ #define VX_E_SESSION_CHANNEL_TEXT_DENIED 1022 // Multi-party text chat is not supported.
41
+ #define VX_E_SESSION_TEXT_DENIED 1023 // This session does not support text messaging.
42
+ #define VX_E_SESSION_MESSAGE_BUILD_FAILED 1024 // The call to am_message_build failed for an unknown reason.
43
+ #define VX_E_SESSION_MSG_CONTENT_TYPE_FAILED 1025 // The call to osip_message_set_content_type failed for an unknown reason.
44
+ #define VX_E_SESSION_MEDIA_CONNECT_FAILED 1026 // The media connect call failed.
45
+ #define VX_E_SESSION_MEDIA_DISCONNECT_FAILED 1026 // The media disconnect call failed.
46
+ #define VX_E_SESSION_DOES_NOT_HAVE_TEXT 1027 // The session does not have text.
47
+ #define VX_E_SESSION_DOES_NOT_HAVE_AUDIO 1028 // The session does not have audio.
48
+ #define VX_E_SESSION_MUST_HAVE_MEDIA 1029 // The session must have media specified (audio or text).
49
+ #define VX_E_SESSION_IS_NOT_3D 1030 // The session is not a SIREN14-3D codec call, so it cannot be a 3D call.
50
+ #define VX_E_SESSIONGROUP_NOT_FOUND 1031 // The session group cannot be found.
51
+ #define VX_E_REQUEST_TYPE_NOT_SUPPORTED 1032
52
+ #define VX_E_REQUEST_NOT_SUPPORTED 1033
53
+ #define VX_E_MULTI_CHANNEL_DENIED 1034
54
+ #define VX_E_MEDIA_DISCONNECT_NOT_ALLOWED 1035
55
+ #define VX_E_PRELOGIN_INFO_NOT_RETURNED 1036
56
+ #define VX_E_SUBSCRIPTION_NOT_FOUND 1037 // The subscription cannot be found.
57
+ #define VX_E_INVALID_SUBSCRIPTION_RULE_TYPE 1038
58
+ #define VX_E_INVALID_MASK 1040
59
+ #define VX_E_INVALID_CONNECTOR_STATE 1041 // The operation cannot be performed because the connector is in an invalid state.
60
+ #define VX_E_BUFSIZE 1042 // The request operation could not return data because the supplied buffer was too small.
61
+ #define VX_E_FILE_OPEN_FAILED 1043 // The file could not be opened because it does not exist, is locked, or due to insufficient privileges.
62
+ #define VX_E_FILE_CORRUPT 1044 // The file was corrupt.
63
+ #define VX_E_FILE_WRITE_FAILED 1045 // Unable to write to the file.
64
+ #define VX_E_INVALID_FILE_OPERATION 1046 // An invalid operation was performed on the file.
65
+ #define VX_E_NO_MORE_FRAMES 1047 // There are no more frames to read.
66
+ #define VX_E_UNEXPECTED_END_OF_FILE 1048 // The file appears truncated or corrupt.
67
+ #define VX_E_FILE_WRITE_FAILED_REACHED_MAX_FILESIZE 1049 // The maximum file size has been reached. The app can close the file and continue.
68
+ #define VX_E_TERMINATESESSION_NOT_VALID 1050
69
+ #define VX_E_MAX_PLAYBACK_SESSIONGROUPS_EXCEEDED 1051 // The maximum number of playback groups (1) has been exceeded.
70
+ #define VX_E_TEXT_DISCONNECT_NOT_ALLOWED 1052
71
+ #define VX_E_TEXT_CONNECT_NOT_ALLOWED 1053
72
+ #define VX_E_SESSION_TEXT_DISABLED 1055
73
+ #define VX_E_SESSIONGROUP_TRANSMIT_NOT_ALLOWED 1056
74
+ #define VX_E_CALL_CREATION_FAILED 1057 // The call creation failed. Check to ensure that the URI is valid.
75
+ #define VX_E_RTP_TIMEOUT 1058
76
+ #define VX_E_ACCOUNT_MISCONFIGURED 1059
77
+ #define VX_E_MAXIMUM_NUMBER_OF_CALLS_EXCEEEDED 1060
78
+ #define VX_E_NO_SESSION_PORTS_AVAILABLE 1061
79
+ #define VX_E_INVALID_MEDIA_FORMAT 1062
80
+ #define VX_E_INVALID_CODEC_TYPE 1063
81
+ #define VX_E_RENDER_DEVICE_DOES_NOT_EXIST 1064
82
+ #define VX_E_RENDER_CONTEXT_DOES_NOT_EXIST 1065
83
+ #define VX_E_RENDER_SOURCE_DOES_NOT_EXIST 1067
84
+ #define VX_E_RECORDING_ALREADY_ACTIVE 1068
85
+ #define VX_E_RECORDING_LOOP_BUFFER_EMPTY 1069
86
+ #define VX_E_STREAM_READ_FAILED 1070
87
+ #define VX_E_INVALID_SDK_HANDLE 1071
88
+ #define VX_E_FAILED_TO_CONNECT_TO_VOICE_SERVICE 1072
89
+ #define VX_E_FAILED_TO_SEND_REQUEST_TO_VOICE_SERVICE 1073
90
+ #define VX_E_MAX_LOGINS_PER_USER_EXCEEDED 1074
91
+ #define VX_E_MAX_HTTP_DATA_RESPONSE_SIZE_EXCEEDED 1075
92
+ #define VX_E_CHANNEL_URI_REQUIRED 1076
93
+ #define VX_E_INVALID_CAPTURE_DEVICE_FOR_REQUESTED_OPERATION 1077
94
+ #define VX_E_LOOP_MODE_RECORDING_NOT_ENABLED 1078
95
+ #define VX_E_TEXT_DISABLED 1079
96
+ #define VX_E_VOICE_FONT_NOT_FOUND 1080
97
+ #define VX_E_CROSS_DOMAIN_LOGINS_DISABLED 1081
98
+ #define VX_E_INVALID_AUTH_TOKEN 1082
99
+ #define VX_E_INVALID_APP_TOKEN 1083
100
+ #define VX_E_CAPACITY_EXCEEDED 1084
101
+ #define VX_E_ALREADY_INITIALIZED 1085
102
+ #define VX_E_NOT_UNINITIALIZED_YET 1086
103
+ #define VX_E_NETWORK_ADDRESS_CHANGE 1087
104
+ #define VX_E_NETWORK_DOWN 1088
105
+ #define VX_E_POWER_STATE_CHANGE 1089
106
+ #define VX_E_HANDLE_ALREADY_TAKEN 1090
107
+ #define VX_E_HANDLE_IS_RESERVED 1091
108
+ #define VX_E_XNETCONNECT_FAILED 1093
109
+ #define VX_E_REQUEST_CANCELED 1094
110
+ #define VX_E_CALL_TERMINATED_NO_RTP_RXED 1095
111
+ #define VX_E_CALL_TERMINATED_NO_ANSWER_LOCAL 1096
112
+ #define VX_E_CHANNEL_URI_TOO_LONG 1097
113
+ #define VX_E_CALL_TERMINATED_BAN 1098
114
+ #define VX_E_CALL_TERMINATED_KICK 1099
115
+ #define VX_E_CALL_TERMINATED_BY_SERVER 1100
116
+ #define VX_E_ALREADY_EXIST 1101
117
+ #define VX_E_FEATURE_DISABLED 1102
118
+ #define VX_E_SIZE_LIMIT_EXCEEDED 1103
119
+ #define VX_E_RTP_SESSION_SOCKET_ERROR 1104
120
+ #define VX_E_SIP_BACKEND_REQUIRED 1105
121
+ #define VX_E_DEPRECATED 1106
122
+
123
+ #define VX_E_NO_RENDER_DEVICES_FOUND 7001
124
+ #define VX_E_NO_CAPTURE_DEVICES_FOUND 7002
125
+ #define VX_E_INVALID_RENDER_DEVICE_SPECIFIER 7003
126
+ #define VX_E_RENDER_DEVICE_IN_USE 7004
127
+ #define VX_E_INVALID_CAPTURE_DEVICE_SPECIFIER 7005
128
+ #define VX_E_CAPTURE_DEVICE_IN_USE 7006
129
+ #define VX_E_UNABLE_TO_OPEN_CAPTURE_DEVICE 7009
130
+
131
+ #define VX_E_FAILED_TO_CONNECT_TO_SERVER 10007
132
+
133
+ #define VX_E_ACCESSTOKEN_ALREADY_USED 20120
134
+ #define VX_E_ACCESSTOKEN_EXPIRED 20121
135
+ #define VX_E_ACCESSTOKEN_INVALID_SIGNATURE 20122
136
+ #define VX_E_ACCESSTOKEN_CLAIMS_MISMATCH 20123
137
+ #define VX_E_ACCESSTOKEN_MALFORMED 20124
138
+ #define VX_E_ACCESSTOKEN_INTERNAL_ERROR 20125
139
+ #define VX_E_ACCESSTOKEN_SERVICE_UNAVAILABLE 20127
140
+ #define VX_E_ACCESSTOKEN_ISSUER_MISMATCH 20128
141
+
142
+ // Error Code Definitions (V5)
143
+ #define VxErrorNoMessageAvailable VX_E_NO_MESSAGE_AVAILABLE // Old value is -1 (not changed)
144
+ #define VxErrorSuccess VX_E_SUCCESS // Old value is 0 (not changed)
145
+ #define VxErrorFailed VX_E_FAILED
146
+ #define VxErrorAsyncOperationCanceled 5001
147
+ #define VxErrorCaptureDeviceInUse 5002
148
+ #define VxErrorConnectionTerminated 5003
149
+ #define VxErrorFileOpenFailed VX_E_FILE_OPEN_FAILED // Old value is 5004
150
+ #define VxErrorHandleReserved 5005
151
+ #define VxErrorHandleTaken 5006
152
+ #define VxErrorInternalError VX_E_FAILED // Old value is 5007
153
+ #define VxErrorInvalidArgument VX_E_INVALID_ARGUMENT // Old value is 5008
154
+ #define VxErrorInvalidFormat 5009
155
+ #define VxErrorInvalidOperation 5010
156
+ #define VxErrorInvalidState VX_E_INVALID_SESSION_STATE // Old value is 5011
157
+ #define VxErrorInvalidValueTypeXmlQuery 5012
158
+ #define VxErrorNoMatchingXmlAttributeFound 5013
159
+ #define VxErrorNoMatchingXmlNodeFound 5014
160
+ #define VxErrorNoMemory 5015
161
+ #define VxErrorNoMoreData 5016
162
+ #define VxErrorNotSupported 5018
163
+ #define VxErrorPortNotAvailable 5019
164
+ #define VxErrorRtpTimeout VX_E_RTP_TIMEOUT // Old value is 5020
165
+ #define VxErrorUnableToOpenCaptureDevice 5021
166
+ #define VxErrorXmppBackEndRequired 5023
167
+ #define VxErrorPreloginDownloadFailed 5024
168
+ #define VxErrorNotLoggedIn 5025
169
+ #define VxErrorPresenceMustBeEnabled 5026
170
+ #define VxErrorConnectorLimitExceeded 5027
171
+ #define VxErrorTargetObjectNotRelated 5028
172
+ #define VxErrorTargetObjectDoesNotExist VX_E_NO_EXIST // Old value is 5029
173
+ #define VxErrorMaxLoginsPerUserExceeded 5030
174
+ #define VxErrorRequestCanceled 5031
175
+ #define VxErrorBuddyDoesNotExist 5032
176
+ #define VxErrorChannelUriRequired 5033
177
+ #define VxErrorTargetObjectAlreadyExists 5034
178
+ #define VxErrorInvalidCaptureDeviceForRequestedOperation 5035
179
+ #define VxErrorInvalidCaptureDeviceSpecifier 5036
180
+ #define VxErrorInvalidRenderDeviceSpecifier 5037
181
+ #define VxErrorDeviceLimitReached 5038
182
+ #define VxErrorInvalidEventType 5039
183
+ #define VxErrorNotInitialized VX_E_NOT_INITIALIZED // Old value is 5040
184
+ #define VxErrorAlreadyInitialized VX_E_ALREADY_INITIALIZED // Old value is 5041
185
+ #define VxErrorNotImplemented VX_E_NOT_IMPL // Old value is 5042
186
+ #define VxErrorTimeout 5043
187
+ #define VxNoAuthenticationStanzaReceived 5044
188
+ #define VxFailedToConnectToXmppServer 5045
189
+ #define VxSSLNegotiationToXmppServerFailed 5046
190
+ #define VxErrorUserOffLineOrDoesNotExist 5047
191
+ #define VxErrorCaptureDeviceInvalidated 5048
192
+ #define VxErrorMaxEtherChannelLimitReached 5049
193
+ #define VxErrorHostUnknown 5050
194
+ #define VxErrorChannelUriTooLong 5051
195
+ #define VxErrorUserUriTooLong 5052
196
+ #define VxErrorInvalidChannelUri 5053
197
+ #define VxErrorCrossDomainLoginDisabled 5054
198
+ #define VxErrorSipRegistrationAuthorizationFailure 5055
199
+ #define VxErrorUserAlreadyLoggingOut 5056
200
+ #define VxErrorBuddyGroupDoesNotExist 5057
201
+ #define VxErrorPowerEvent 5058
202
+ #define VxErrorNetworkAddressChanged 5059
203
+ #define VxErrorNetworkDown 5060
204
+ #define VxErrorNotUninitializedYet VX_E_NOT_UNINITIALIZED_YET
205
+ #define VxErrorCallTerminatedBanned 5098
206
+ #define VxErrorCallTerminatedKick 5099
207
+ #define VxErrorCallTerminatedByServer 5100
208
+ #define VxErrorServerRtpTimeout VX_E_CALL_TERMINATED_NO_RTP_RXED // Old value is 5101
209
+ #define VxErrorDeprecated VX_E_DEPRECATED
210
+ #define VxErrorUserBlocked 5102
211
+ #define VxErrorMessageTextTooLong 5103
212
+ #define VxErrorNoMicrophonePermission 5104
213
+ #define VxErrorMessageTextRateExceeded 5105
214
+ #define VxErrorSessionDoesNotHaveAudio VX_E_SESSION_DOES_NOT_HAVE_AUDIO
215
+ #define VxSafeVoiceConsentUnauthorized 5106
216
+ #define VxSafeVoiceConsentInvalidProjectOrEnvironment 5107
217
+ #define VxSafeVoiceInternalError 5108
218
+ #define VxSafeVoiceConsentNotSet 5109
219
+ #define VxSafeVoiceUnknownError 5110
220
+ #define VxErrorJobDependencyFailed 5111
221
+
222
+ // 20xxx-20xxx reserved for 3-digit XMPP error codes returned from server
223
+ #define VxXmppErrorCodesRangeStart 20000
224
+ #define VxUnknownXmppError 20000
225
+ #define VxAccessTokenAlreadyUsed 20120
226
+ #define VxAccessTokenExpired 20121
227
+ #define VxAccessTokenInvalidSignature 20122
228
+ #define VxAccessTokenClaimsMismatch 20123
229
+ #define VxAccessTokenMalformed 20124
230
+ #define VxAccessTokenInternalError 20125
231
+ #define VxAccessTokenServiceUnavailable 20127
232
+ #define VxAccessTokenIssuerMismatch 20128
233
+ #define VxErrorTitleDisabled 20129
234
+ #define VxXmppErrorBadRequest 20400
235
+ #define VxXmppErrorNotAuthorized 20401
236
+ #define VxXmppErrorItemNotFound 20404
237
+ #define VxXmppErrorNotAllowed 20405
238
+ #define VxXmppInternalServerError 20500
239
+ #define VxXmppErrorFeatureNotImplemented 20501
240
+ #define VxXmppServerErrorServiceUnavailable 20502
241
+ #define VxXmppErrorServiceUnavailable 20503
242
+ #define VxXmppErrorChannelAtCapacity 20507
243
+ #define VxXmppErrorCodesRangeEnd 20999
244
+
245
+ // 21000+ - internal XMPP error codes
246
+ #define VxErrorXmppServerResponseMalformed 21000
247
+ #define VxErrorXmppServerResponseBadSdp 21001
248
+ #define VxErrorXmppServerResponseInviteMissing 21002
249
+ #define VxErrorXmppServerResponseChanAddMissing 21003
250
+
251
+ #define VxNetworkSocketErrorUnknown 10000
252
+ #define VxNetworkNameResolutionFailed 10006
253
+ #define VxNetworkUnableToConnectToServer 10007
254
+ #define VxNetworkHttpTimeout 10028
255
+ #define VxNetworkHttpInvalidUrl 10003
256
+ #define VxNetworkHttpInvalidCertificate 10077
257
+ #define VxNetworkHttpConnectionReset 10056
258
+ #define VxNetworkHttpInvalidServerResponse 10052
259
+ #define VxNetworkHttpGeneralConnectionFailure 10100
260
+ #define VxNetworkReconnectFailure 10101
261
+
262
+
263
+ // Compatibility
264
+ #define VX_E_XMPP_BACKEND_REQUIRED VxErrorXmppBackEndRequired
265
+ #define VxErrorSipBackEndRequired VX_E_SIP_BACKEND_REQUIRED
266
+
267
+ #ifdef __cplusplus
268
+ extern "C" {
269
+ #endif
270
+ #if !defined(VIVOX_TYPES_ONLY)
271
+ /**
272
+ * Get an error string for a particular error code.
273
+ * \ingroup diagnostics
274
+ */
275
+ VIVOXSDK_DLLEXPORT const char *vx_get_error_string(int errorCode);
276
+ VIVOXSDK_DLLEXPORT const char *vx_get_request_type_string(vx_request_type t);
277
+ VIVOXSDK_DLLEXPORT const char *vx_get_response_type_string(vx_response_type t);
278
+ VIVOXSDK_DLLEXPORT const char *vx_get_event_type_string(vx_event_type t);
279
+ VIVOXSDK_DLLEXPORT const char *vx_get_login_state_string(vx_login_state_change_state t);
280
+ VIVOXSDK_DLLEXPORT const char *vx_get_presence_state_string(vx_buddy_presence_state t);
281
+ VIVOXSDK_DLLEXPORT const char *vx_get_self_presence_state_string(vx_presence_state t);
282
+ VIVOXSDK_DLLEXPORT const char *vx_get_notification_type_string(vx_notification_type t);
283
+ VIVOXSDK_DLLEXPORT const char *vx_get_session_media_state_string(vx_session_media_state t);
284
+ VIVOXSDK_DLLEXPORT const char *vx_get_session_text_state_string(vx_session_text_state t);
285
+ VIVOXSDK_DLLEXPORT const char *vx_get_media_completion_type_string(vx_media_completion_type t);
286
+ VIVOXSDK_DLLEXPORT const char *vx_get_participant_removed_reason_string(vx_participant_removed_reason t);
287
+ VIVOXSDK_DLLEXPORT const char *vx_get_audio_device_hot_swap_type_string(vx_audio_device_hot_swap_event_type_t t);
288
+ VIVOXSDK_DLLEXPORT const char *vx_get_channel_rolloff_curve_type_string(vx_channel_rolloff_curve_type t);
289
+ VIVOXSDK_DLLEXPORT const char *vx_get_tts_dest_string(vx_tts_destination t);
290
+ VIVOXSDK_DLLEXPORT const char *vx_get_connection_state_string(vx_connection_state t);
291
+
292
+ /**
293
+ * Translate a vx_log_level to a string.
294
+ */
295
+ VIVOXSDK_DLLEXPORT const char *vx_get_log_level_string(vx_log_level level);
296
+
297
+ #endif // !defined(VIVOX_TYPES_ONLY)
298
+ #ifdef __cplusplus
299
+ }
300
+ #endif