Skip to content

Commit

Permalink
Fixed RestComm#419: Olympus sporadically crashes when connectivity is…
Browse files Browse the repository at this point in the history
… reestablished via Wifi. Fixed RestComm#418: If peer answers a BYE with SERVER_INTERNAL_ERROR the call is left hanging
  • Loading branch information
Antonis Tsakiridis committed Oct 3, 2016
1 parent cd7f61d commit 8d98b15
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Examples/restcomm-olympus/app/olympus-version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Wed Sep 28 12:34:58 EEST 2016
VERSION_CODE=1510
#Mon Oct 03 12:40:16 EEST 2016
VERSION_CODE=1511
4 changes: 2 additions & 2 deletions restcomm.android.sdk/restcomm-android-sdk-version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Wed Sep 28 12:34:59 EEST 2016
VERSION_CODE=1542
#Mon Oct 03 12:40:17 EEST 2016
VERSION_CODE=1543
16 changes: 8 additions & 8 deletions restcomm.android.sdk/restcomm.android.sdk.iml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
Expand All @@ -80,6 +72,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotations" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public enum ErrorCodes {
ERROR_CONNECTION_COULD_NOT_CONNECT,
ERROR_CONNECTION_PEER_NOT_FOUND,
ERROR_CONNECTION_SERVICE_UNAVAILABLE,
ERROR_CONNECTION_SERVICE_INTERNAL_ERROR,
ERROR_CONNECTION_PARSE_CUSTOM_SIP_HEADERS,
ERROR_CONNECTION_ACCEPT_FAILED,
ERROR_CONNECTION_ACCEPT_WRONG_STATE,
Expand Down Expand Up @@ -162,6 +163,9 @@ else if (errorCode == ErrorCodes.ERROR_CONNECTION_PEER_NOT_FOUND) {
else if (errorCode == ErrorCodes.ERROR_CONNECTION_SERVICE_UNAVAILABLE) {
return "Failed to initiate connection; service is unavailable";
}
else if (errorCode == ErrorCodes.ERROR_CONNECTION_SERVICE_INTERNAL_ERROR) {
return "Failed to initiate connection; service internal error";
}
else if (errorCode == ErrorCodes.ERROR_CONNECTION_PARSE_CUSTOM_SIP_HEADERS) {
return "Failed to initiate connection; error parsing custom SIP headers";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,12 @@ public void onCallErrorEvent(String jobId, RCClient.ErrorCodes errorCode, String
// only disconnect signaling facilities if we are not already disconnecting
signalingClient.disconnect(jobId, null);
}
else {
// an error has occured while we are disconnecting. Since the normal disconnect flow is being interrupted, we need to tell notification
// facilities that forground service notification needs to stop.
device.onNotificationCallDisconnected(this);
}

disconnectWebrtc();

if (RCDevice.state == RCDevice.DeviceState.BUSY) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1543,7 +1543,9 @@ private void sendQoSNoConnectionIntent(String user, String message)
void removeConnection(String jobId)
{
RCLogger.i(TAG, "removeConnection(): id: " + jobId + ", total connections before removal: " + connections.size());
connections.remove(jobId);
if (connections.containsKey(jobId)) {
connections.remove(jobId);
}
}

private void onAudioManagerChangedState()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,18 @@ else if (response.getStatusCode() == Response.REQUEST_TERMINATED) {
// we are done with this call, let's remove job
jainSipClient.jainSipJobManager.remove(jainSipJob.jobId);
}
else {
RCLogger.e(TAG, "processResponse(): unhandled SIP response: " + response.getStatusCode());
}
else if (response.getStatusCode() == Response.SERVER_INTERNAL_ERROR) {
if (method.equals(Request.BYE)) {
listener.onCallErrorEvent(jainSipJob.jobId, RCClient.ErrorCodes.ERROR_CONNECTION_SERVICE_INTERNAL_ERROR,
RCClient.errorText(RCClient.ErrorCodes.ERROR_CONNECTION_SERVICE_INTERNAL_ERROR));
// we are done with this call, let's remove job
jainSipClient.jainSipJobManager.remove(jainSipJob.jobId);
}
}
else {
RCLogger.e(TAG, "processResponse(): unhandled SIP response: " + response.getStatusCode());
}
/*
else if (response.getStatusCode() == Response.REQUEST_TERMINATED) {
// INVITE was terminated by Cancel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public enum FsmEvents {
* to go through. For example job of type TYPE_OPEN needs to start the signaling stack, bind to networking facilities, register, authorize and finally
* notify the App. These steps are reflected in the states member variable and initialized when the job is constructed.
*
* Once the FSM is initialized we can then call JainSipFsm.process() that will do the actual FSM processing based on current state (i.e. states variable) and the event (i.e. FrmEvents)
* Once the FSM is initialized we can then call JainSipFsm.process() that will do the actual FSM processing based on current state (i.e. states variable) and the event (i.e. FsmEvents)
* passed by the caller (check JainSipFsm.process())
*
* It's important to avoid calling any methods within JainSipFsm.process() that inside them call JainSipFsm.process(), cause that would probably cause corruption
Expand Down Expand Up @@ -666,6 +666,7 @@ else if (type == Type.TYPE_START_NETWORKING) {
catch (JainSipException e) {
e.printStackTrace();
jainSipClient.listener.onClientErrorReply(jobId, RCDeviceListener.RCConnectivityStatus.RCConnectivityStatusNone, e.errorCode, e.errorText);
jainSipJobManager.remove(jobId);
}
}
else if (states[index].equals(FsmStates.AUTH)) {
Expand All @@ -678,6 +679,7 @@ else if (states[index].equals(FsmStates.AUTH)) {
catch (JainSipException e) {
e.printStackTrace();
jainSipClient.listener.onClientErrorReply(jobId, RCDeviceListener.RCConnectivityStatus.RCConnectivityStatusNone, e.errorCode, e.errorText);
jainSipJobManager.remove(jobId);
}
}
else {
Expand Down

0 comments on commit 8d98b15

Please sign in to comment.