public void onConnectivityChanged(boolean connected) throws SipException { mSipGroup.onConnectivityChanged(); if (connected) { resetGroup(mLocalIp); if (mOpenedToReceiveCalls) openToReceiveCalls(); } else { // close mSipGroup but remember mOpenedToReceiveCalls if (DEBUG) Log.d( TAG, " close auto reg temporarily: " + getUri() + ": " + mIncomingCallPendingIntent); mSipGroup.close(); mAutoRegistration.stop(); } }
public void openToReceiveCalls() throws SipException { mOpenedToReceiveCalls = true; if (mConnected) { mSipGroup.openToReceiveCalls(this); mAutoRegistration.start(mSipGroup); } if (DEBUG) Log.d(TAG, " openToReceiveCalls: " + getUri() + ": " + mIncomingCallPendingIntent); }
private void resetGroup(String localIp) throws SipException { try { mSipGroup.reset(localIp); } catch (IOException e) { // network disconnected Log.w(TAG, "resetGroup(): network disconnected?"); if (localIp != null) { resetGroup(null); // reset w/o local IP } else { // recursive Log.wtf(TAG, "impossible!"); throw new RuntimeException("resetGroup"); } } }
public void start(SipSessionGroup group) { if (!mRunning) { mRunning = true; mBackoff = 1; mSession = (SipSessionGroup.SipSessionImpl) group.createSession(this); // return right away if no active network connection. if (mSession == null) return; // start unregistration to clear up old registration at server // TODO: when rfc5626 is deployed, use reg-id and sip.instance // in registration to avoid adding duplicate entries to server mMyWakeLock.acquire(mSession); mSession.unregister(); TAG = "SipAutoReg:" + mSession.getLocalProfile().getUriString(); } }
private String getUri() { return mSipGroup.getLocalProfileUri(); }
public ISipSession createSession(ISipSessionListener listener) { return mSipGroup.createSession(listener); }
public void close() { mOpenedToReceiveCalls = false; mSipGroup.close(); mAutoRegistration.stop(); if (DEBUG) Log.d(TAG, " close: " + getUri() + ": " + mIncomingCallPendingIntent); }
// TODO: remove this method once SipWakeupTimer can better handle variety // of timeout values void setWakeupTimer(SipWakeupTimer timer) { mSipGroup.setWakeupTimer(timer); }
public boolean containsSession(String callId) { return mSipGroup.containsSession(callId); }
public SipProfile getLocalProfile() { return mSipGroup.getLocalProfile(); }