Loading voip/java/com/android/server/sip/SipHelper.java +4 −0 Original line number Diff line number Diff line Loading @@ -365,6 +365,10 @@ class SipHelper { Response response = mMessageFactory.createResponse( Response.BUSY_HERE, request); if (inviteTransaction == null) { inviteTransaction = getServerTransaction(event); } if (inviteTransaction.getState() != TransactionState.COMPLETED) { if (DEBUG) Log.d(TAG, "send BUSY HERE: " + response); inviteTransaction.sendResponse(response); Loading voip/java/com/android/server/sip/SipService.java +20 −1 Original line number Diff line number Diff line Loading @@ -430,6 +430,21 @@ public final class SipService extends ISipService.Stub { } } private synchronized boolean callingSelf(SipSessionGroupExt ringingGroup, SipSessionGroup.SipSessionImpl ringingSession) { String callId = ringingSession.getCallId(); for (SipSessionGroupExt group : mSipGroups.values()) { if ((group != ringingGroup) && group.containsSession(callId)) { if (DEBUG) Log.d(TAG, "call self: " + ringingSession.getLocalProfile().getUriString() + " -> " + group.getLocalProfile().getUriString()); return true; } } return false; } private class SipSessionGroupExt extends SipSessionAdapter { private SipSessionGroup mSipGroup; private PendingIntent mIncomingCallPendingIntent; Loading @@ -452,6 +467,10 @@ public final class SipService extends ISipService.Stub { return mSipGroup.getLocalProfile(); } public boolean containsSession(String callId) { return mSipGroup.containsSession(callId); } // network connectivity is tricky because network can be disconnected // at any instant so need to deal with exceptions carefully even when // you think you are connected Loading Loading @@ -551,7 +570,7 @@ public final class SipService extends ISipService.Stub { (SipSessionGroup.SipSessionImpl) s; synchronized (SipService.this) { try { if (!isRegistered()) { if (!isRegistered() || callingSelf(this, session)) { session.endCall(); return; } Loading voip/java/com/android/server/sip/SipSessionGroup.java +16 −0 Original line number Diff line number Diff line Loading @@ -231,6 +231,10 @@ class SipSessionGroup implements SipListener { } } synchronized boolean containsSession(String callId) { return mSessionMap.containsKey(callId); } private synchronized SipSessionImpl getSipSession(EventObject event) { String key = SipHelper.getCallId(event); SipSessionImpl session = mSessionMap.get(key); Loading Loading @@ -582,6 +586,7 @@ class SipSessionGroup implements SipListener { } private void processCommand(EventObject command) throws SipException { if (isLoggable(command)) Log.d(TAG, "process cmd: " + command); if (!process(command)) { onError(SipErrorCode.IN_PROGRESS, "cannot initiate a new transaction to execute: " Loading Loading @@ -1050,6 +1055,13 @@ class SipSessionGroup implements SipListener { mSipHelper.sendCancel(mClientTransaction); startSessionTimer(CANCEL_CALL_TIMER); return true; } else if (isRequestEvent(Request.INVITE, evt)) { // Call self? Send BUSY HERE so server may redirect the call to // voice mailbox. RequestEvent event = (RequestEvent) evt; mSipHelper.sendInviteBusyHere(event, event.getServerTransaction()); return true; } return false; } Loading Loading @@ -1351,6 +1363,10 @@ class SipSessionGroup implements SipListener { return DEBUG; } private static boolean isLoggable(EventObject evt) { return isLoggable(null, evt); } private static boolean isLoggable(SipSessionImpl s, EventObject evt) { if (!isLoggable(s)) return false; if (evt == null) return false; Loading Loading
voip/java/com/android/server/sip/SipHelper.java +4 −0 Original line number Diff line number Diff line Loading @@ -365,6 +365,10 @@ class SipHelper { Response response = mMessageFactory.createResponse( Response.BUSY_HERE, request); if (inviteTransaction == null) { inviteTransaction = getServerTransaction(event); } if (inviteTransaction.getState() != TransactionState.COMPLETED) { if (DEBUG) Log.d(TAG, "send BUSY HERE: " + response); inviteTransaction.sendResponse(response); Loading
voip/java/com/android/server/sip/SipService.java +20 −1 Original line number Diff line number Diff line Loading @@ -430,6 +430,21 @@ public final class SipService extends ISipService.Stub { } } private synchronized boolean callingSelf(SipSessionGroupExt ringingGroup, SipSessionGroup.SipSessionImpl ringingSession) { String callId = ringingSession.getCallId(); for (SipSessionGroupExt group : mSipGroups.values()) { if ((group != ringingGroup) && group.containsSession(callId)) { if (DEBUG) Log.d(TAG, "call self: " + ringingSession.getLocalProfile().getUriString() + " -> " + group.getLocalProfile().getUriString()); return true; } } return false; } private class SipSessionGroupExt extends SipSessionAdapter { private SipSessionGroup mSipGroup; private PendingIntent mIncomingCallPendingIntent; Loading @@ -452,6 +467,10 @@ public final class SipService extends ISipService.Stub { return mSipGroup.getLocalProfile(); } public boolean containsSession(String callId) { return mSipGroup.containsSession(callId); } // network connectivity is tricky because network can be disconnected // at any instant so need to deal with exceptions carefully even when // you think you are connected Loading Loading @@ -551,7 +570,7 @@ public final class SipService extends ISipService.Stub { (SipSessionGroup.SipSessionImpl) s; synchronized (SipService.this) { try { if (!isRegistered()) { if (!isRegistered() || callingSelf(this, session)) { session.endCall(); return; } Loading
voip/java/com/android/server/sip/SipSessionGroup.java +16 −0 Original line number Diff line number Diff line Loading @@ -231,6 +231,10 @@ class SipSessionGroup implements SipListener { } } synchronized boolean containsSession(String callId) { return mSessionMap.containsKey(callId); } private synchronized SipSessionImpl getSipSession(EventObject event) { String key = SipHelper.getCallId(event); SipSessionImpl session = mSessionMap.get(key); Loading Loading @@ -582,6 +586,7 @@ class SipSessionGroup implements SipListener { } private void processCommand(EventObject command) throws SipException { if (isLoggable(command)) Log.d(TAG, "process cmd: " + command); if (!process(command)) { onError(SipErrorCode.IN_PROGRESS, "cannot initiate a new transaction to execute: " Loading Loading @@ -1050,6 +1055,13 @@ class SipSessionGroup implements SipListener { mSipHelper.sendCancel(mClientTransaction); startSessionTimer(CANCEL_CALL_TIMER); return true; } else if (isRequestEvent(Request.INVITE, evt)) { // Call self? Send BUSY HERE so server may redirect the call to // voice mailbox. RequestEvent event = (RequestEvent) evt; mSipHelper.sendInviteBusyHere(event, event.getServerTransaction()); return true; } return false; } Loading Loading @@ -1351,6 +1363,10 @@ class SipSessionGroup implements SipListener { return DEBUG; } private static boolean isLoggable(EventObject evt) { return isLoggable(null, evt); } private static boolean isLoggable(SipSessionImpl s, EventObject evt) { if (!isLoggable(s)) return false; if (evt == null) return false; Loading