Info
Info, warning, and sessionDisconnected notification system. Info and warning notifications can be disabled by setting the appropriate logLevel parameter.
myRapportScene.addEventListener(info, infoHandler);
myRapportScene.addEventListener('warning', warningHandler);
myRapportScene.addEventListener('sessionDisconnected', sessionDisconnectedHandler);
or
await rapport.sessionRequest({
info: (ev) => infoHandler(ev),
warning: (ev) => warningHandler(ev),
sessionDisconnected: (ev) => sessionDisconnectedHandler(ev)
})
Potential Info Notificaitons
|
Condition |
Warning Message (level: warning) |
|
Able to ping CPI Tower |
code: 'RAPPORT_CPI_COMMUNICATIONS' message: 'Receiving messages from CPI' |
|
API call to sessionDisconnect and no network |
code: 'RAPPORT_UNABLE_TO_LOGOUT' message: 'Unable to log out of rapport session' |
|
Inactivity timeout. No received CPI modules messages for inactivity attribute duration. Default 180 second. |
code: 'RAPPORT_INACTIVITY_TIMEOUT' message: 'The rapport session has timed out due to inactivity' |
|
Timeout. Max session duration reached of timeout attribute. Default 600 seconds. |
code: 'RAPPORT_TIMEOUT' message: 'The rapport session has timed out' |
Warning
|
Condition |
Warning Message (level: warning) |
|
Session has started without AEC |
code: 'RAPPORT_NO_AEC' message: 'Unable to establish acoustic echo cancellation. Echo possible if microphone is not headset.' |
|
Session has started without AEC, mic access is granted, and microphone label does not contain 'headphone', 'headset' or 'airpod' |
code: 'RAPPORT_HEADPHONES' message: 'Unable to establish acoustic echo cancellation. Please use headphones.' |
|
Unable to start an audio context. Audio context will start on page click or swipe. |
code: 'RAPPORT_NO_RUNNING_AUDIO_CONTEXT' message: 'Audio context will be resumed after page gesture' |
|
Peer connection to CPI disconnected, network error, network disconnect. Can recover if the network resolves. |
code: 'RAPPORT_PEER_CONNECTION_DISCONNECTED' message: 'WebRTC peer connection disconnected' |
|
A session heartbeat fails to reach backend |
code: 'RAPPORT_UNSTABLE_CONNECTION’ message: 'The network connection is unstable' |
sessionDisconnected
sessionDisconnected events will end the session. Most are level error. Inactivity and timeout also disconnect the session and are info levels.
Potential sessionDisconnected Notifications
|
Condition |
sessionDisconnected message (level: error) |
|
aecRequired is true and browser unable to create internal loopback webrtc connection |
code: 'RAPPORT_NO_AEC',
|
|
Maximum rooms reached on account |
code: 'RAPPORT_MAX_ROOMS', message: 'You have reached your maximum rooms allowance', |
|
Peer connection to CPI failed, network error, network disconnect |
code: 'RAPPORT_PEER_CONNECTION_FAILED', message: 'WebRTC peer connection failed', |
|
Peer connection to CPI closed, network error, network disconnect |
code: 'RAPPORT_PEER_CONNECTION_CLOSED’ message: 'WebRTC peer connection closed', |
|
Unable to ping CPI Tower |
code: 'RAPPORT_PEER_CONNECTION_DISCONNECTED' message: 'WebRTC peer connection disconnected' |
|
Inactivity timeout. No received CPI modules messages for inactivity attribute duration. Default 180 second. |
code: 'RAPPORT_INACTIVITY_TIMEOUT' message: 'The rapport session has timed out due to inactivity' level: info |
|
Timeout. Max session duration reached of timeout attribute. Default 600 seconds. |
code: 'RAPPORT_TIMEOUT' message: 'The rapport session has timed out' level: info |
|
Undefined errors
|
code: 'RAPPORT_UNDEFINED' message: 'An undefined error has occurred' |
|
WebSocket connection to Unreal Pixel Streaming's signaling server failed, network error, network disconnect |
code: 'RAPPORT_UPXS_SIGNALING_CLOSED' message: 'UPXS signaling connection closed' |
|
Peer connection to Unreal Pixel Streaming failed, network error, network disconnect |
code: 'RAPPORT_UPXS_RTC_CLOSED' message: 'UPXS RTC connection closed' |
|
Initializing Unreal Pixel Streaming video player failed |
code: 'RAPPORT_UPXS_RENDERING_FAILURE' message: 'UPXS rendering initialization failed' |
API Call Thrown Errors
|
Session has started with micRequired = false, and API call to getMic() fails |
code: 'RAPPORT_NO_MIC_PERMISSION' message: 'PERMISSION DENIED: User did not grant microphone access.' |
|
API call to mute speaker before session has connected |
code: 'RAPPORT_WAIT_FOR_SESSION_CONNECTED' message: 'Please wait for sessionConnected after calling sessionRequest' |
|
API call to setMood, sendText, setUserId, and parameter is not a string |
code: 'RAPPORT_NOT_A_STRING' message: 'Parameter needs to be a string' |
|
API call to setScale with value that is not a number |
code: 'RAPPORT_SCALE_NOT_A_NUMBER' message: 'Please enter a number, usually between 0 and 2' |
|
API call to sessionRequest, micRequired is true and mic access denied |
code: 'RAPPORT_NO_MIC_PERMISSION
|
|
API call to sessionRequest, and Unable to download model |
code: 'RAPPORT_GET_MODEL_FAIL’ message: 'Failed to get character model’ |
|
API call to sessionRequest with wrong session credentials, no network |
code: 'RAPPORT_SETUP_SESSION_FAIL' message: 'Failed to initialize the AI session’ |
|
API call to sessionRequest, and CPI provisioning error |
code: 'RAPPORT_JOIN_SESSION_FAIL’ message: 'Failed to join the AI session' |
|
API call to sessionRequest, and session’s tier limit is reached. |
code: ‘RAPPORT_SESSION_LIMIT_REACHED’ message: ‘Session limit reached.’ |