Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Call Disconnected event sent when accepting call if there are more than one incoming call #208

Closed
7 of 8 tasks
tejinder-sarna opened this issue Oct 16, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@tejinder-sarna
Copy link

  • I have verified that the issue occurs with the latest twilio.js release and is not marked as a known issue in the CHANGELOG.md.
  • I reviewed the Common Issues and open GitHub issues and verified that this report represents a potentially new issue.
  • I verified that the Quickstart application works in my environment.
  • I am not sharing any Personally Identifiable Information (PII)
    or sensitive account information (API keys, credentials, etc.) when reporting this issue.

Code to reproduce the issue:

const TWILIO_VOICE_OPTIONS = {
  closeProtection: true,
  allowIncomingWhileBusy: true,
  edge: "roaming",
  logLevel: "debug",
  maxAverageBitrate: 0,
  maxCallSignalingTimeoutMs: 30000,
  tokenRefreshMs: 60000,
};

new Device(token, TWILIO_VOICE_OPTIONS);

Expected behavior:

If there are two incoming calls, and we accept one, Twilio voice should connect to the call and send a "call connected" event.

Actual behavior:

Twilio voice sends a "call disconnected" event BUT the call is connected and users can hear each other.
If the caller hangs up the call, Twilio voice prints this error in the console

call.js:324 Uncaught TypeError: Cannot read properties of null (reading 'pc')

Debug logs:

 Setting up VSP
 Initializing preferred transport backoff using config:  {factor: 2, maxDelay: 1000, randomisationFactor: 0.4}
 Initializing primary transport backoff using config:  {factor: 2, initialDelay: 100, maxDelay: 20000, randomisationFactor: 0.4}
 WSTransport.open() called...
 Attempting to connect...
 Closing and cleaning up WebSocket...
 No WebSocket to clean up.
 WebSocket opened successfully.
 Setting token and publishing listen
 Stream is ready
 signalingState is "have-remote-offer"
 signalingState is "stable"
 dtlsTransportState is "new"
 pc.iceGatheringState is "gathering"
 pc.iceConnectionState is "checking"
 ICE Candidate: {"candidate":"candidate:34xxxxxxxx 1 udp 2122194687 1xx.xxx.x.x 6xxxx typ host generation 0 ufrag i+s4 network-id 1 network-cost 10","sdpMid":"audio","sdpMLineIndex":0,"usernameFragment":"i+s4"}
 ICE Candidate: {"candidate":"candidate:3x9xxxxxx 1 udp 2xxxxxxxxxxx 2xxx:xxxx:xxxx:xx:xxxx:xxxx:xxxx:xxxx 5xxxx typ host generation 0 ufrag i+s4 network-id 2 network-cost 10","sdpMid":"audio","sdpMLineIndex":0,"usernameFragment":"i+s4"}
 pc.connectionState is "connecting"
 ICE Candidate: {"candidate":"candidate:84xxxxxxx 1 tcp 15xxxxxxx 1xx.xxx.x.x 9 typ host tcptype active generation 0 ufrag i+s4 network-id 1 network-cost 10","sdpMid":"audio","sdpMLineIndex":0,"usernameFragment":"i+s4"}
 ICE Candidate: {"candidate":"candidate:1xxxxxxxxxx 1 tcp 15xxxxxxxx 2xxx:xxxx:xxxx:xx:xxxx:xxxx:xxxx:xxxx 9 typ host tcptype active generation 0 ufrag i+s4 network-id 2 network-cost 10","sdpMid":"audio","sdpMLineIndex":0,"usernameFragment":"i+s4"}
 pc.iceGatheringState is "complete"
 ICE Candidate: null
 dtlsTransportState is "connecting"
 pc.iceConnectionState is "connected"
 Media connection established.
 dtlsTransportState is "connected"
 pc.connectionState is "connected"
 Rejected: CAxxxxxxx
 pc.iceConnectionState is "disconnected"
 ICE liveliness check failed. May be having trouble connecting to Twilio
 ICE liveliness check failed. May be having trouble connecting to Twilio
 pc.connectionState is "disconnected"
 pc.connectionState is "failed"
 Connection with Twilio was interrupted.

Software versions:

  • Browser(s): Chromium Version 118.0.5993.70
  • Operating System: MacOS
  • twilio.js: 4.18.1
  • Third-party libraries (e.g., Angular, React, etc.): React Native 0.64.4, Expo SDK - 44, React Native Web: 0.17.1
@tejinder-sarna tejinder-sarna added the bug Something isn't working label Oct 16, 2023
@tejinder-sarna
Copy link
Author

To add, this does not happen if there is a single incoming call

@charliesantos
Copy link
Collaborator

@tejinder-sarna can you please provide the correct SDK version you're using? I see you listed 4.18.1 but we're currently only at 2.7.x.

@tejinder-sarna
Copy link
Author

@charliesantos sorry that was for "twilio" library and not twilio voice sdk
Using @twilio/voice-sdk is 2.7.3.
I'm working on making a demo app so that you could see the code and help in figuring out if there's some configuration problem.

@tejinder-sarna
Copy link
Author

tejinder-sarna commented Oct 16, 2023

@charliesantos Here's a demo app that I created with Expo SDK 49 and Twilio Voice 2.7.3
I could reproduce it on that. and I have added steps in the readme file please refer to them
https://github.com/sarnaTejinder/twilio-multi-calls

@tejinder-sarna
Copy link
Author

@charliesantos I found the issue, I was using lodash.cloneDeep in my code which might have changed the correct reference to call and caused the problem. I have tried removing that and it works well :). Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants