Commit 6f283ef3 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

call service: synchronize state change

Change-Id: I50426174a6441aa53cb042890ae42233bdc73d8a
parent 17d34dc8
......@@ -453,11 +453,14 @@ public class CallService {
}
public void removeCallForId(String callId) {
synchronized (currentCalls) {
currentCalls.remove(callId);
currentConferences.remove(callId);
}
}
private SipCall addCall(String accountId, String callId, String from, SipCall.Direction direction) {
synchronized (currentCalls) {
SipCall call = currentCalls.get(callId);
if (call == null) {
Account account = mAccountService.getAccount(accountId);
......@@ -471,6 +474,7 @@ public class CallService {
}
return call;
}
}
private Conference addConference(SipCall call) {
String confId = call.getConfId();
......@@ -537,6 +541,7 @@ public class CallService {
void callStateChanged(String callId, String newState, int detailCode) {
Log.d(TAG, "call state changed: " + callId + ", " + newState + ", " + detailCode);
try {
synchronized (currentCalls) {
SipCall call = parseCallState(callId, newState);
if (call != null) {
callSubject.onNext(call);
......@@ -546,6 +551,7 @@ public class CallService {
updateConnectionCount();
}
}
}
} catch (Exception e) {
Log.w(TAG, "Exception during state change: ", e);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment