Connection Issues
Client Fails to Connect
Client Fails to Connect
connect() or connectAndCall() throws an error or times out.Possible Causes and Solutions:- Incorrect endpoint URL. Verify that the
endpointUrlin your configuration is correct and accessible. The URL must point to a valid Cognigy Click To Call configuration endpoint. - Network restrictions. Make sure your network allows WebSocket connections and UDP traffic. SIP/WebRTC communication needs both. Check firewall and proxy settings.
- CORS issues. If the SDK canโt fetch the SIP configuration, the endpoint server might not allow cross-origin requests from your domain.
SIP Registration Fails
SIP Registration Fails
registered event is never emitted, or the error event emits after connecting.registered event. In this case, the missing event isnโt an error.- Invalid SIP credentials. The SIP configuration returned by the endpoint URL may contain invalid credentials. Contact your Cognigy administrator to verify the configuration.
- SIP server unreachable. Ensure that the SIP server is reachable from the clientโs network. Network firewalls may block the required ports.
Call Issues
Call Not Starting
Call Not Starting
startCall() throws an error or doesnโt initiate a call.Possible Causes and Solutions:- Client not connected. Call
connect()and wait for it to finish before you callstartCall(). If your endpoint requires registration,connect()finishes after theregisteredevent. If you callstartCall()before that, it fails withClient not connected. Call connect() first.orSIP client not registered. Alternatively, useconnectAndCall()to combine both steps. - Microphone permission denied. The browser requires microphone access for Click To Call calls. Ensure that the user has granted microphone permission.
No Audio
No Audio
- Autoplay policy. Modern browsers block autoplay of media with audio. Start the call from a user gesture, for example, a button click. The SDK plays audio through an internal
Audioelement, but browser autoplay restrictions still apply. - No audio tracks in stream. The remote stream may not contain audio tracks. Check the browser developer console for warnings from the SDK such as โStream has no audio tracksโ.
Call Control Methods Fail
Call Control Methods Fail
endCall(), mute(), sendInfo(), or sendDTMF() rejects with an error that contains No active session or Session not established.Possible Causes and Solutions:- Call not answered yet. These methods work only on an answered call. While the call is ringing, they fail. Wait for the
answeredevent before you call them. - Call already ended. After the call ends or fails, no session is active.
unmute() method does nothing if thereโs no answered call and doesnโt throw an error.Call Drops Unexpectedly
Call Drops Unexpectedly
ended or failed event emits shortly after the call starts.Possible Causes and Solutions:- Network instability. Check the network connection. Click To Call is sensitive to network changes, especially on mobile devices.
- Session timeout. The SIP server might have a session timeout configured. Check the
cause,originator, anddescriptionfields of theCallEndInfoobject. You get this object in theendedorfailedevent callback.
Transcription Issues
Transcription Events Not Received
Transcription Events Not Received
transcription event is never emitted during a call.Possible Causes and Solutions:- Transcription not enabled. Ensure that transcription is enabled in your Voice Gateway or Cognigy Flow configuration.
- Info messages without
_transcription. The SDK emits atranscriptionevent only when an incoming info message contains a_transcriptionproperty. Regular info messages are emitted viainfoReceivedinstead.
Browser Issues
Click To Call Not Supported
Click To Call Not Supported
checkWebRTCSupport() returns { supported: false }.Possible Causes and Solutions:- Unsupported browser. The SDK requires a browser that supports WebRTC APIs:
RTCPeerConnection,getUserMedia. - Insecure context. WebRTC APIs are only available in secure contexts such as HTTPS or
localhost. Serve your application over HTTPS.
Microphone Permission Issues
Microphone Permission Issues
- Permission denied. The user must grant microphone permission. If the user denies it, the browser blocks access to the local audio stream.
- Permission previously blocked. If the user blocked microphone access before, they must reset the permission manually in the browserโs site settings.
Error Handling
The SDK supports two complementary approaches for catching errors.Promise-Based
Promise-Based
try and catch blocks:Event-Based
Event-Based
error event to catch asynchronous errors during the SDK lifecycle:Debugging Tips
Enable Event Logging
Enable Event Logging
Inspect WebRTC Internals
Inspect WebRTC Internals
chrome://webrtc-internals/. The page shows active WebRTC connections, including ICE candidates, codec negotiation, and media statistics.Check Network Traffic
Check Network Traffic