Status Codes
  • 03 Jun 2021
  • 3 Minutes to read
  • Dark
    Light
  • PDF

Status Codes

  • Dark
    Light
  • PDF

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 Notifications

Condition

Info Message (level: info)

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

Potential warning notifications

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',  
message:'Unable to establish acoustic echo cancellation'

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'

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, with value that is not in prescribed list

code: 'RAPPORT_ALLOWED_MOODS'

message: "Please set mood to either 'neutral', 'positive', 'negative', 'acknowledge'"

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
message: 'PERMISSION DENIED: User did not grant microphone access.'

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'


Known bugs

Some browsers like Chromium and Firefox require an internal WebRTC connection for echo cancellation to be activated. This connection can sometimes not be established. Usually when a previous session has had a failed WebRTC connection, and microphone access has not been granted. This becomes a problem when microphone access is granted and the user is not using a headset. In this instance the session will have echo and the AI will end up having a conversation with itself. 

Restarting the browser resolves the issue.


If using a pandorabot AI and using Google TTS, it has been noted that there can be severe latency issues of up to 30 seconds.


Some browsers may require additional clicks or swipes on the page before audio context can start, especially when using auto-start and the page does not have access to the microphone.


Was this article helpful?

What's Next