twilio / video-quickstart-android

Twilio Video Quickstart for Android
MIT License
213 stars 160 forks source link

Error TwilioConversations [Signaling] #19

Closed ernestojr closed 8 years ago

ernestojr commented 8 years ago

Hi all, I have a problem when call ends, and finish() to current actiity of conversation, app blows me, but does not show me any error, and often appears me this error: E/TwilioConversations: [Signaling]:RESIP::TRANSPORT: Got TLS read ret=0 error=6 error:00000006:invalid library (0):OPENSSL_internal:public key routines If someone could help me because I have a lot of time with this problem.

ykhodosh commented 8 years ago

Hi,

I would like to ask you a few questions to better understand the problem:

1) What is the version of Twilio Conversations SDK for Android you are using? 2) If I understand correctly your application crashes at the end of the call. What are the exact circumstances when the crash happens? Can you describe the sequence of the calls you make? Does it happen when you end the call or when you terminate the app? Do you wait for any callbacks when you terminate the call or do you terminate the app immediately? Do you recreate an instance of TwilioConversationsClient immediately after destroying the first one? 3) Are you using any third party libraries in your app, such as OpenSSL or POCO? 4) Can you enable debug logging in the TwilioConversationsClient and provide full log of the scenario?

ernestojr commented 8 years ago

Hello, the answers are in order: 1) Q: What is the version of Twilio Conversations SDK for Android you are using? A: com.twilio:conversations-android:0.12.2

2) Q: If I understand correctly your application crashes at the end of the call. What are the exact circumstances when the crash happens? Can you describe the sequence of the calls you make? Does it happen when you end the call or when you terminate the app? Do you wait for any callbacks when you terminate the call or do you terminate the app immediately? Do you recreate an instance of TwilioConversationsClient immediately after destroying the first one? A: Brief explanation of the behavior: I have a service in charge of establishing the connection with Twilio, the token is obtained from the Web service and then we establish the connection with Twilio:

this.mAccessManager = new AccessManager(contextService, accessToken, new AccessManager.Listener() {
            @Override
            public void onTokenExpired(AccessManager accessManager) {
                Log.d(TAG, "Services onAccessManagerTokenExpire.");
                requestNewToken(context, new MyCallback() {
                    @Override
                    public void onSuccess(Object o) {
                        connectToTwilio(context, callback);
                    }
                    @Override
                    public void onError(Exception e) {
                        Log.e(TAG, e.toString());
                        retryRequestNewToken(context, this);
                    }
                });
            }
            @Override
            public void onTokenUpdated(AccessManager accessManager) {
                Log.d(TAG, "Services onTokenUpdated.");
                if(TwilioConversationsClient.isInitialized()) {
                    conversationsClient = TwilioConversationsClient
                            .create(accessManager, TWilioServices.this); // Conversation Listener
                    conversationsClient.listen();
                }
            }
            @Override
            public void onError(AccessManager accessManager, String s) {
                Log.e(TAG, "Services AccessManager onError: " + s);
                release();
            }
        });
// Release method
public void release(){
    Log.d(TAG, "Services release");
    if(TwilioConversationsClient.isInitialized()) {
        if(conversationsClient != null)
            conversationsClient.unlisten();
        if(accessManager != null)
            accessManager.dispose();
    }
    TwilioConversationsClient.destroy();
    accessManager = null;
    conversationsClient = null;
    if(eventListener != null) eventListener.onRelease();
}

This is what happens after the call ends: TwilioToken is requested -> The connection with Twilio is made -> waits for a call -> new call -> call ended -> release() -> starts again. The service remains active always. It is the service that starts the conversation activity, for an incoming or outgoing call. In the case of the conversation activity, it connects to the service and establishes the UI of the outgoing or incoming call. When the call finishes, a finish() is executed on the activity, and the app returns to the previous activity. It is here where the issue occurs. Most of the times the app crashes and doesn't notify which is the error, not in the conversation activity, nor in the service, as this remains normally in "onStartListeningForInvites" as if the error never happened. It is important to note that when this error happens, the next activity on stack (after the conversation activity finishes) closes. 3) Q: Are you using any third party libraries in your app, such as OpenSSL or POCO? A: None of the previous, but I use several third party libraries. Firebase, Fabric.io, OneSignal, among others needed by the application. 4) Q: Can you enable debug logging in the TwilioConversationsClient and provide full log of the scenario? A: I don't know what do you mean, can you explain please?

ykhodosh commented 8 years ago

I would like to further clarify the last transition you described -- release() -> starts again. Does it mean that right after you destroy TwilioConversationsClient you create a new one and bring it to the listening state?

As for the debug part, you can set log level of TwilioConversationsClient right after you create it (or even before for that matter) using setLogLevel method. It would look something like:

if(TwilioConversationsClient.isInitialized()) {
    TwilioConversationsClient.setLogLevel(LogLevel.DEBUG); // you can also do TRACE
    conversationsClient = TwilioConversationsClient
                            .create(accessManager, TWilioServices.this); // Conversation Listener
    conversationsClient.listen();
}

After you do that, run your app again to reproduce the problem and copy Android log output (from adb logcat or the debug console of your IDE) into your comment.

ernestojr commented 8 years ago

Hi! Q: Does it mean that right after you destroy TwilioConversationsClient you create a new one and bring it to the listening state? A: After destroying TwilioConversationsClient (release method), I proceed to request a new token to my web server,and then I create another AccessManager object and a TwilioConversationsClient that will wait for a new call. Regarding the adb logcat case, I had this line: TwilioConversationsClient.setLogLevel(LogLevel.ERROR); Now I changed ERROR for TRACE and it throwed this:

09-13 09:38:12.540 19720-3288/com.pkg.app D/TwilioConversationsClientInternal: onStateDidChange UNREGISTERING
09-13 09:38:12.550 19720-3289/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::DUM: shutdown: dialogSets=1
09-13 09:38:12.550 19720-19720/com.pkg.app D/TwilioConversationsClient: Destroying Core
09-13 09:38:12.550 19720-19720/com.pkg.app I/TwilioConversations: [Core]:Twilio RTC Core SDK: destroying ...
09-13 09:38:12.650 19720-19720/com.pkg.app I/TwilioConversations: [Core]:Finished shutdown of SIP Stack.
09-13 09:38:13.540 19720-3287/com.pkg.app I/TwilioConversations: [Core]:Removed video track ...
09-13 09:38:13.540 19720-3287/com.pkg.app I/TwilioConversations: [Core]:Removing stream.
09-13 09:38:13.540 19720-3287/com.pkg.app I/TwilioConversations: [Core]:Closing MediaContext ...
09-13 09:38:13.540 19720-3287/com.pkg.app I/TwilioConversations: [Core]:Done closing media context
09-13 09:38:13.540 19720-3287/com.pkg.app I/TwilioConversations: [Core]:Session: Stopped. Performing the final notification ...
09-13 09:38:13.540 19720-3287/com.pkg.app I/TwilioConversations: [Core]:Session: Can't renegotiate; no media changes
09-13 09:38:16.290 3662-3662/com.pkg.app I/TwilioConversations: [Core]:Twilio RTC Core SDK: initializing ...
09-13 09:38:16.310 3662-3662/com.pkg.app I/TwilioConversations: [Signaling]:RESIP:DNS: local hostname does not contain a domain part localhost
09-13 09:38:16.310 3662-3662/com.pkg.app I/TwilioConversations: [Core]:Done!
09-13 09:38:17.970 3662-3741/com.pkg.app D/TwilioConversationsClientInternal: onStateDidChange REGISTERING
09-13 09:38:17.970 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:17.970 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::TRANSPORT: Connection::Connection: new connection created to who: [ V4 0.0.0.0:0 UNKNOWN_TRANSPORT target domain=unspecified mFlowKey=0 ]
09-13 09:38:17.970 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::TRANSPORT: Creating TLS transport for domain  interface= port=0
09-13 09:38:17.980 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::TRANSPORT: Connection::Connection: new connection created to who: [ V4 54.172.60.94:5061 TLS target domain=54.172.60.94 mFlowKey=79 ]
09-13 09:38:17.980 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::TRANSPORT: Creating TLS connection for domain  [ V4 54.172.60.94:5061 TLS target domain=54.172.60.94 mFlowKey=0 ] on 79
09-13 09:38:17.980 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
// -- This is repeated 1065 times
09-13 09:38:18.090 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:18.090 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::TRANSPORT: TLS handshake starting (client mode)
09-13 09:38:18.090 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::TRANSPORT: TLS connected
09-13 09:38:18.090 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
// -- This is repeated 6692 times
09-13 09:38:18.470 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:18.470 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::DUM: Got: SipResp: 200 tid=89cac0dbc7006aec cseq=1 OPTIONS / 1 from(wire)
09-13 09:38:18.470 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Adding X-Twilio-AccessToken ...
09-13 09:38:18.470 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:18.620 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:18.620 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:18.620 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::DUM: Got: SipResp: 302 tid=1c1372ae8a56f0f4 cseq=1 REGISTER contact=54.172.60.34:5060 / 1 from(wire)
09-13 09:38:18.620 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::TRANSPORT: Connection::Connection: new connection created to who: [ V4 54.172.60.34:5061 TLS target domain=54.172.60.34 mFlowKey=82 ]
09-13 09:38:18.620 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::TRANSPORT: Creating TLS connection for domain  [ V4 54.172.60.34:5061 TLS target domain=54.172.60.34 mFlowKey=0 ] on 82
09-13 09:38:18.620 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:18.910 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::TRANSPORT: TLS handshake starting (client mode)
09-13 09:38:18.910 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::TRANSPORT: TLS connected
09-13 09:38:18.910 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:20.060 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:20.060 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:20.060 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:20.370 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::TRANSPORT: TLS connected
09-13 09:38:20.370 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::TRANSPORT: TLS sessions set up with TLSv1 TLSv1/SSLv3 AES256-SHA 
09-13 09:38:20.370 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::SIP: subjectAltName of TLS session cert contains DNS <*.endpoint.twilio.com>
09-13 09:38:20.370 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::TRANSPORT: TLS handshake done for peer *.endpoint.twilio.com
09-13 09:38:20.370 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:20.370 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:20.670 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:20.670 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:20.670 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::DUM: Got: SipResp: 200 tid=2d06c7a6acd06944 cseq=1 OPTIONS / 1 from(wire)
09-13 09:38:20.680 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Adding X-Twilio-AccessToken ...
09-13 09:38:20.680 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:21.030 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:21.100 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:21.100 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::DUM: Got: SipResp: 200 tid=ba2eb88c3f386ecb cseq=1 REGISTER contact=57b277ffe445a61000aeeb5a@127.0.0.1:54818 / 1 from(wire)
09-13 09:38:21.100 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::SIP: SipMessage::getContents: got content type (application/rtc-auth-info+json) that is not known, returning as opaque application/octet-stream
09-13 09:38:21.100 3662-3741/com.pkg.app D/TwilioConversationsClientInternal: onStateDidChange REGISTERED
09-13 09:38:21.100 3662-3741/com.pkg.app D/TwilioConversationsClientInternal: onRegistrationDidComplete
09-13 09:38:21.100 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:48.650 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:49.980 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:50.480 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:50.630 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:51.100 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:51.100 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:51.220 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:51.270 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:38:52.680 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:39:21.130 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::TRANSACTION: Stats message 
09-13 09:39:21.130 3662-3743/com.pkg.app W/TwilioConversations: [Signaling]:RESIP::STATS: RESIP:TRANSACTION
                                                                                 TU summary: 0 TRANSPORT 0 TRANSACTION 0 CLIENTTX 0 SERVERTX 0 TIMERS 0
                                                                                 Transaction summary: reqi 0 reqo 4 rspi 4 rspo 0
                                                                                 Details: INVi 0/S0/F0 INVo 0/S0/F0 ACKi 0 ACKo 0 BYEi 0/S0/F0 BYEo 0/S0/F0 CANi 0/S0/F0 CANo 0/S0/F0 MSGi 0/S0/F0 MSGo 0/S0/F0 OPTi 0/S0/F0 OPTo 2/S2/F0 REGi 0/S0/F0 REGo 2/S1/F1 PUBi 0/S0/F0 PUBo 0/S0/F0 SUBi 0/S0/F0 SUBo 0/S0/F0 NOTi 0/S0/F0 NOTo 0/S0/F0 REFi 0/S0/F0 REFo 0/S0/F0 INFi 0/S0/F0 INFo 0/S0/F0 PRAi 0/S0/F0 PRAo 0/S0/F0 SERi 0/S0/F0 SERo 0/S0/F0 UPDi 0/S0/F0 UPDo 0/S0/F0
                                                                                 Retransmissions: INVx 0 finx 0 nonx 0 BYEx 0 CANx 0 MSGx 0 OPTx 0 REGx 0 PUBx 0 SUBx 0 NOTx 0 REFx 0 INFx 0 PRAx 0 SERx 0 UPDx 0
09-13 09:39:21.130 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:39:21.130 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:39:21.240 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:39:21.240 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:39:51.160 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:39:51.160 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:39:51.280 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:39:51.280 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:40:21.170 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::TRANSACTION: Stats message 
09-13 09:40:21.170 3662-3743/com.pkg.app W/TwilioConversations: [Signaling]:RESIP::STATS: RESIP:TRANSACTION
                                                                                 TU summary: 0 TRANSPORT 0 TRANSACTION 0 CLIENTTX 0 SERVERTX 0 TIMERS 0
                                                                                 Transaction summary: reqi 0 reqo 4 rspi 4 rspo 0
                                                                                 Details: INVi 0/S0/F0 INVo 0/S0/F0 ACKi 0 ACKo 0 BYEi 0/S0/F0 BYEo 0/S0/F0 CANi 0/S0/F0 CANo 0/S0/F0 MSGi 0/S0/F0 MSGo 0/S0/F0 OPTi 0/S0/F0 OPTo 2/S2/F0 REGi 0/S0/F0 REGo 2/S1/F1 PUBi 0/S0/F0 PUBo 0/S0/F0 SUBi 0/S0/F0 SUBo 0/S0/F0 NOTi 0/S0/F0 NOTo 0/S0/F0 REFi 0/S0/F0 REFo 0/S0/F0 INFi 0/S0/F0 INFo 0/S0/F0 PRAi 0/S0/F0 PRAo 0/S0/F0 SERi 0/S0/F0 SERo 0/S0/F0 UPDi 0/S0/F0 UPDo 0/S0/F0
                                                                                 Retransmissions: INVx 0 finx 0 nonx 0 BYEx 0 CANx 0 MSGx 0 OPTx 0 REGx 0 PUBx 0 SUBx 0 NOTx 0 REFx 0 INFx 0 PRAx 0 SERx 0 UPDx 0
09-13 09:40:21.170 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:40:21.170 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:40:21.290 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:40:21.290 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:40:23.600 3662-3743/com.pkg.app E/TwilioConversations: [Signaling]:RESIP::TRANSPORT: Got TLS read ret=0 error=6 error:00000006:invalid library (0):OPENSSL_internal:public key routines
09-13 09:40:23.600 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:40:23.600 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::TRANSACTION: Sending ConnectionTerminated [ V4 54.172.60.94:5061 TLS target domain=54.172.60.94 mFlowKey=79 ] to TUs
09-13 09:40:23.600 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:40:23.600 3662-3743/com.pkg.app W/TwilioConversations: [Core]:Connection terminated: ConnectionTerminated [ V4 54.172.60.94:5061 TLS target domain=54.172.60.94 mFlowKey=79 ]
09-13 09:40:51.190 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:40:51.190 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:40:51.550 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:40:51.550 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:41:21.220 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::TRANSACTION: Stats message 
09-13 09:41:21.220 3662-3743/com.pkg.app W/TwilioConversations: [Signaling]:RESIP::STATS: RESIP:TRANSACTION
                                                                                 TU summary: 0 TRANSPORT 0 TRANSACTION 0 CLIENTTX 0 SERVERTX 0 TIMERS 0
                                                                                 Transaction summary: reqi 0 reqo 4 rspi 4 rspo 0
                                                                                 Details: INVi 0/S0/F0 INVo 0/S0/F0 ACKi 0 ACKo 0 BYEi 0/S0/F0 BYEo 0/S0/F0 CANi 0/S0/F0 CANo 0/S0/F0 MSGi 0/S0/F0 MSGo 0/S0/F0 OPTi 0/S0/F0 OPTo 2/S2/F0 REGi 0/S0/F0 REGo 2/S1/F1 PUBi 0/S0/F0 PUBo 0/S0/F0 SUBi 0/S0/F0 SUBo 0/S0/F0 NOTi 0/S0/F0 NOTo 0/S0/F0 REFi 0/S0/F0 REFo 0/S0/F0 INFi 0/S0/F0 INFo 0/S0/F0 PRAi 0/S0/F0 PRAo 0/S0/F0 SERi 0/S0/F0 SERo 0/S0/F0 UPDi 0/S0/F0 UPDo 0/S0/F0
                                                                                 Retransmissions: INVx 0 finx 0 nonx 0 BYEx 0 CANx 0 MSGx 0 OPTx 0 REGx 0 PUBx 0 SUBx 0 NOTx 0 REFx 0 INFx 0 PRAx 0 SERx 0 UPDx 0
09-13 09:41:21.220 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:41:21.230 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:41:21.350 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:41:21.350 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:41:51.260 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:41:51.260 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:41:51.380 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:41:51.380 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:42:21.280 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::TRANSACTION: Stats message 
09-13 09:42:21.290 3662-3743/com.pkg.app W/TwilioConversations: [Signaling]:RESIP::STATS: RESIP:TRANSACTION
                                                                                 TU summary: 0 TRANSPORT 0 TRANSACTION 0 CLIENTTX 0 SERVERTX 0 TIMERS 0
                                                                                 Transaction summary: reqi 0 reqo 4 rspi 4 rspo 0
                                                                                 Details: INVi 0/S0/F0 INVo 0/S0/F0 ACKi 0 ACKo 0 BYEi 0/S0/F0 BYEo 0/S0/F0 CANi 0/S0/F0 CANo 0/S0/F0 MSGi 0/S0/F0 MSGo 0/S0/F0 OPTi 0/S0/F0 OPTo 2/S2/F0 REGi 0/S0/F0 REGo 2/S1/F1 PUBi 0/S0/F0 PUBo 0/S0/F0 SUBi 0/S0/F0 SUBo 0/S0/F0 NOTi 0/S0/F0 NOTo 0/S0/F0 REFi 0/S0/F0 REFo 0/S0/F0 INFi 0/S0/F0 INFo 0/S0/F0 PRAi 0/S0/F0 PRAo 0/S0/F0 SERi 0/S0/F0 SERo 0/S0/F0 UPDi 0/S0/F0 UPDo 0/S0/F0
                                                                                 Retransmissions: INVx 0 finx 0 nonx 0 BYEx 0 CANx 0 MSGx 0 OPTx 0 REGx 0 PUBx 0 SUBx 0 NOTx 0 REFx 0 INFx 0 PRAx 0 SERx 0 UPDx 0
09-13 09:42:21.330 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:42:21.330 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:42:21.670 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:42:21.670 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:42:51.360 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:42:51.370 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:42:51.620 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:42:51.620 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:43:21.390 3662-3743/com.pkg.app I/TwilioConversations: [Signaling]:RESIP::TRANSACTION: Stats message 
09-13 09:43:21.390 3662-3743/com.pkg.app W/TwilioConversations: [Signaling]:RESIP::STATS: RESIP:TRANSACTION
                                                                                 TU summary: 0 TRANSPORT 0 TRANSACTION 0 CLIENTTX 0 SERVERTX 0 TIMERS 0
                                                                                 Transaction summary: reqi 0 reqo 4 rspi 4 rspo 0
                                                                                 Details: INVi 0/S0/F0 INVo 0/S0/F0 ACKi 0 ACKo 0 BYEi 0/S0/F0 BYEo 0/S0/F0 CANi 0/S0/F0 CANo 0/S0/F0 MSGi 0/S0/F0 MSGo 0/S0/F0 OPTi 0/S0/F0 OPTo 2/S2/F0 REGi 0/S0/F0 REGo 2/S1/F1 PUBi 0/S0/F0 PUBo 0/S0/F0 SUBi 0/S0/F0 SUBo 0/S0/F0 NOTi 0/S0/F0 NOTo 0/S0/F0 REFi 0/S0/F0 REFo 0/S0/F0 INFi 0/S0/F0 INFo 0/S0/F0 PRAi 0/S0/F0 PRAo 0/S0/F0 SERi 0/S0/F0 SERo 0/S0/F0 UPDi 0/S0/F0 UPDo 0/S0/F0
                                                                                 Retransmissions: INVx 0 finx 0 nonx 0 BYEx 0 CANx 0 MSGx 0 OPTx 0 REGx 0 PUBx 0 SUBx 0 NOTx 0 REFx 0 INFx 0 PRAx 0 SERx 0 UPDx 0
09-13 09:43:21.390 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:43:21.390 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:43:21.520 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.
09-13 09:43:21.530 3662-3743/com.pkg.app I/TwilioConversations: [Core]:Process background accounts.

This log is filtered by TwilioConversations. During the first execution I made several calls, until the error occured. It happened when mobile 1 cancelled the call at the same time mobile 2 answered it. This logcat out is the Mobile 2. I hope you find this useful and thanks for answering!

ykhodosh commented 8 years ago

Ok, so with regard to the error you see in the log file I don't think it's a real problem. During its interactions with Twilio infrastructure Twilio Conversations SDK opens several connections and some of them do get closed after a while. This is what you observed in the log -- a transient connection being closed. Perhaps we should not report it as an error. However, this is not going to cause any problems.

Now back to the original problem. There is a known issue with Twilio Conversations SDK that may cause errors and even crashes in the exact scenario you described -- you destroy one instance of TwilioConversationClient and immediately create another one. This has to do with global state and native resources being cleaned up, which may take some time. In order to fix it I suggest the following:

I hope this helps.

ernestojr commented 8 years ago

Hello again, after a week of testing with your recommendation, I observed: We have two devices D1 and D2 for the following cases outside the normal behavior of a call:

These cases cause the application to break and shows no errors by the logcat. I am currently using Fabric.io and this also fails to detect the errors. Patches give me better performance:

I hope after this contribution, I indicate that I can do to solve in a more efiente these problems. Greetings!

idelgado commented 8 years ago

@ernestojr I encourage you to try our developer preview https://github.com/twilio/video-quickstart-android/tree/rooms. Unlike the conversations library, this new library does not rely on invites to signal the start of a conversation. Instead users can join named rooms. And you can signal the name of the room using your own signaling channel(GCM, Firebase, etc.).

We will be deprecating conversations in favor of this new library that will go into public beta in the coming weeks. The invite model never worked well on mobile due to how backgrounding works on Android & iOS so we are moving to this model to provide a better user and developer experience.