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] TJS instaed of CallSid #265

Open
3 tasks
joao-carneiro-twistag opened this issue May 9, 2024 · 8 comments
Open
3 tasks

[BUG] TJS instaed of CallSid #265

joao-carneiro-twistag opened this issue May 9, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@joao-carneiro-twistag
Copy link

  • [ X ] 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.
  • [ X ] I reviewed the Common Issues and open GitHub issues and verified that this report represents a potentially new issue.
  • [ X ] I verified that the Quickstart application works in my environment.
  • [ X ] 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:

version: 2.10.2
This issue occurs sporadically and is challenging to reproduce consistently.
However, I've observed that the TJS is generated instead of a valid callSid.
This seems to be related to the function generateTempCallSid in your repository.

Expected behavior:

Twilio should consistently return a valid callSid whenever a call is made.

Actual behavior:

In approximately 1 out of every 1000 calls, Twilio does not return a valid callSid. Instead, it provides a TJS.
I have extensive logs and reports available that can provide further insights into this issue upon request.

Software versions:

  • [ X ] Browser(s): Chrome, Firefox, Edge
  • Operating System: Windows
  • twilio.js: 2.10.2
  • Third-party libraries (e.g., Angular, React, etc.):
@joao-carneiro-twistag joao-carneiro-twistag added the bug Something isn't working label May 9, 2024
@joao-carneiro-twistag joao-carneiro-twistag changed the title [BUG] [BUG] TJS instaed of CallSid May 9, 2024
@joao-carneiro-twistag
Copy link
Author

joao-carneiro-twistag commented May 9, 2024

An example log:

[TwilioVoice][EventPublisher] Publishing insights {"endpointName":"EndpointEvents","event":{"group":"ice-gathering-state","level":"DEBUG","name":"complete","payload":{"aggressive_nomination":false,"browser_extension":false,"dscp":true,"ice_restart_enabled":true,"platform":"WebRTC","sdk_version":"2.10.2","temp_call_sid":"TJSd65c394c-f3f8-4032-8a8d-a625dfb75736","direction":"OUTGOING","region":"EU_FRANKFURT"},"payload_type":"application/json","private":false,"publisher":"twilio-js-sdk","timestamp":"2024-05-09T13:48:54.905Z","publisher_metadata":{"app_name":"XXXXXX","app_version":"0.2.106"}},"host":"XXXXXX"}

Also found this in your sdk..
image

@charliesantos
Copy link
Collaborator

A a tempCallSid is used for outbound calls while the call is still trying to connect to Twilio. As soon as the call is established, usually after the ringing event, the real callsid will be returned by Twilio backend and it will be used. What you're seeing is normal.

@joao-carneiro-twistag
Copy link
Author

I appreciate your answer. Yes, that makes sense, but,
I've encountered an issue on the client side of my application where, in some cases, long-duration calls lasting over 100 seconds do not result in receiving an original CallSid. This seems to occur particularly when calls are not answered.
So i end up with a lot of "lost" calls

@charliesantos
Copy link
Collaborator

Thanks @joao-carneiro-twistag . I took a look at the example tempCallSid above, TJSd65c394c-f3f8-4032-8a8d-a625dfb75736, it generated a real callSid CA76eaadfa0e73505d9e70b690e3049ad2. Where are you trying to read the real callsid from?

@joao-carneiro-twistag
Copy link
Author

Thanks for your help @charliesantos ! I'm always reading it from parameters.CallSid

@charliesantos
Copy link
Collaborator

In that log you provided, the call is still trying to connect, so a real callsid is not available if you try to read it. For SDK outgoing calls, try reading it after the call.on('ringing') event or call.on('accept'). For SDK incoming calls, the real callSid is always available.

@joao-carneiro-twistag
Copy link
Author

joao-carneiro-twistag commented May 10, 2024

yes its an outgoing call and i'm reading it only after the event 'ringing', i'm afraid it could be due to internet issues, the client might lose the connection between the proccess

or.. i might be elsewhere trying to access the callSid before that event occurs, i'll take a look and come back, thank you for your time!

@charliesantos
Copy link
Collaborator

charliesantos commented May 10, 2024

We can also take a look more if you can reproduce the issue and provide the whole debug logs.

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