team-telnyx / telnyx-webrtc-android

Telnyx Android WebRTC SDK - Enable real-time communication with WebRTC and Telnyx
MIT License
13 stars 2 forks source link

[Bug] Unable to login on socket #208

Closed hpsolver closed 2 years ago

hpsolver commented 2 years ago

Bug Category

SDK Version implementation 'com.github.team-telnyx:telnyx-webrtc-android:v1.2.15-alpha'

Describe the bug Unable to login on socket . It toast error "Gateway registration failed"

Expected behaviour A clear and concise description of what you expected to happen.

To Reproduce Steps to reproduce the behaviour:

  1. Log on with credentials
  2. Socket error then returned

Android Device (please complete the following information):

Logs

image image image image image
Oliver-Zimmerman commented 2 years ago

Hi @hpsolver

Are you using the sample application or your own implementation?

hpsolver commented 2 years ago

own implementation

Oliver-Zimmerman commented 2 years ago

Okay, can you confirm if it is also happening on the sample app? We also have a new version of the SDK that will be released later today that adjusts how we handle connectivity that might resolve your issue. The PR is here: https://github.com/team-telnyx/telnyx-webrtc-android/pull/205

hpsolver commented 2 years ago

no it’s not happening in sample app

Oliver-Zimmerman commented 2 years ago

In that case would you be able to share snippets of your code relating to connect and log on? @hpsolver

hpsolver commented 2 years ago
image
hpsolver commented 2 years ago
fun doLoginWithCredentials(userName: String?, number: String?, fcmToken: String?, sipUserName: String, sipPassword: String) {
    val loginConfig = CredentialConfig(
            sipUserName,
            sipPassword,
            userName,
            number,
            fcmToken,
            null,
            R.raw.ringback_tone,
            LogLevel.ALL
    )
    telnyxClient?.credentialLogin(loginConfig)
}
Oliver-Zimmerman commented 2 years ago

Is initConnection or doLoginWithCredentials being called multiple times? You will receive UNREGED if a user logs in with your credentials again (only one user can be logged in at a time if you're using the SIP Connection username and password)

hpsolver commented 2 years ago

initConnection and doLoginWithCredentials called only once when app launched.But if i have 2 devices and in which i logged with same credentials then this issue can occurred ?

Oliver-Zimmerman commented 2 years ago

Yes, this would cause an issue. If you want to use the same connection multiple times, you need to create ephemeral credentials:

https://developers.telnyx.com/docs/v2/webrtc/quickstart#create-the-credential

You can create multiple of these with the same connection

Oliver-Zimmerman commented 2 years ago

@hpsolver did this solve your issue? Can I close?