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] Incoming sound keeps playing even after the call is disconnected #133

Closed
6 tasks done
kamalbennani opened this issue Dec 28, 2022 · 7 comments
Closed
6 tasks done
Labels
bug Something isn't working

Comments

@kamalbennani
Copy link
Contributor

kamalbennani commented Dec 28, 2022

  • 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:

// receive an incoming call
this.device.on('incoming', (call: Call) => {
  // save call
  this._activeCall = call;

  // listen to call events
  this._activeCall.on('disconnect', () => console.log('call got disconnected'));
  this._activeCall.on('accept', () => console.log('call got answered'));
});

// pickup the call
this._activeCall.accept();

// right the way hung up before the call got time to connect (before pstream->answer event)
this._activeCall.disconnect();

// incoming sound keeps playing forever

Expected behavior:

The incoming sound should be stopped after a call disconnection

Actual behavior:

The incoming sound keeps playing forever

Software versions:

  • Browser(s): Version 108.0.5359.124 (Official Build) (x86_64)
  • Operating System: 12.5.1 Mac

Solution

I've debugged the situation and I found the following issue:

In the device class, the SDK only stops the incoming sound in the following situation:

But none of these events is sent in the case I described above.

The only event emitted is "disconnect" because the call got disconnected just after attempting to connect.

To resolve the issue, it's as simple as calling this._maybeStopIncomingSound(); at the end of the disconnect event

I would like to hear your thoughts about this, to know if you are also able to reproduce it and if I should pull up a PR for it.

@kamalbennani kamalbennani added the bug Something isn't working label Dec 28, 2022
@mhuynh5757
Copy link
Collaborator

Hey @kamalbennani, thanks for filing this issue and providing a solution. We'll add it as soon as we can, I've filed an internal ticket to keep track of this.

@kamalbennani
Copy link
Contributor Author

Hi @mhuynh5757 thank you for your quick response 🙇
Let me know if you want me to pull up a PR.
In all cases, I applied the patch to our current app and it's working perfectly fine.

@mhuynh5757
Copy link
Collaborator

Hey @kamalbennani, PRs are always welcome. Once the fix is done, our team will run through the usual regression testing before we can release. Thanks for the community contributions, we genuinely appreciate it.

@kamalbennani
Copy link
Contributor Author

Hi @mhuynh5757 I've opened a PR for this. I'd like to have your thoughts on it.
Thanks.

@charliesantos
Copy link
Collaborator

should be fixed on 2.3.1

@bradleyy1012
Copy link

Is it possible that this bug has resurfaced after the latest update on chrome?

@charliesantos
Copy link
Collaborator

@bradleyy1012 we're not seeing this with the latest update on chrome. Do you have repro steps?

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

4 participants