Pararth
Pararth

Reputation: 8134

Android M : VoIP, JAINSIP, SipStack; inconsistent SipProvider Exception when creating a listening point with tls enabled

UPDATE 5:
Gist of what is happening: The tcp listening point is created under stack initialisation. For that, we cannot use an existing object, in our case.
So what i do is check if the mTcp is not null, and if it is then the listening point is deleted and function proceeds with stack init but the !=null is always skipped and then the consequent exception...
Note: Using a random port number every time does not work for creating the listening point does not work in Android whereas the same works for iOS.

UPDATE 4:
Started facing this in Xiaomi Mi 4:
SipProvider Exception is android.javax.sip.InvalidArgumentException: bind failed: EADDRINUSE (Address already in use)

UPDATE 3:
There seems to be a pattern for exceptions to alternate. But the immediate 2nd attempt is successful in that too;
1. 1st time createListeningPoint() is called -> Exception 2 or 1
2. 2nd attempt after that -> success
3. After that, when 1. happens -> Exception 1 or 2
4. 2nd attempt -> success . . .

UPDATE 2:

Exceptions 1 and 2 seem to reproduce without any pattern but 2nd attempt is successful after Exception 2, where as when it is Exception 1- it sticks for a while and repeatedly gives the same exception.


UPDATE 1:

1. The SipProvider exception occurs only ONCE after the sip stack is destroyed. The 2nd attempt to register/initialise stack or create the listening point is always successful.

2. Another Nexus 5 device running on Android M does not have the same behaviour; everything works as expected.

3. Now the same issue occurs in Motorola Nexus 6 Android M also. Not sure if it is due to an update of one of the apps or the o.s. No success on 2nd attempts either in this.


The following behaviour has been inconsistent, random. I do not have the precise steps to reproduce it.
This happens
only on Nexus 5 after the Android M ota update,

I am using JainSip in a *VoIP app.
Scenario: when the **createListeningPoint
is called with tls enabled;

listeningPoint = mSipStack.createListeningPoint("stringIp",intPortNumber,
                    "stringTls");

These are the exceptions that occur randomly

Exception 1:

SipProvider Exception is java.lang.IllegalArgumentException:   
cipherSuite TLS_DH_anon_WITH_AES_128_CBC_SHA is not supported.  

Exception 2:

SipProvider Exception is android.javax.sip.InvalidArgumentException:  
bind failed: EADDRINUSE (Address already in use)  

For Sip Stack jar(s), i am using:
Maven android jain sip and have tried jenkins jsip

Note these:
1. The same code works as expected in other devices and o.s. versions below/before Android 6.0 (API 23).
2. Code worked as expected in Android M preview sdk loaded into Motorola Nexus 6
3. Have not tested it on multiple devices with Android M yet, not even multiple Nexus 5 (s). I'l post an update when i do that.

I searched for the issue, could not find much, tried using setEnabledCipherSuites for Exception 1 -not sure how to implement it- and ensuring that listening point is null/destroyed when the stack deregisters, for Exception 2.

The question is has anybody experienced the same or know what is happening, how to solve that (?)

Upvotes: 2

Views: 497

Answers (1)

Adrian Chifor
Adrian Chifor

Reputation: 66

I fixed it by commenting out
"TLS_DH_anon_WITH_AES_128_CBC_SHA",
"SSL_DH_anon_WITH_3DES_EDE_CBC_SHA"

in the 'cipherSuites' String[] in SipStackImpl.java

The two are no longer supported from Android 6

Upvotes: 1

Related Questions