@Override public void acceptCall() throws CallStateException { synchronized (SipPhone.class) { if ((mRingingCall.getState() == Call.State.INCOMING) || (mRingingCall.getState() == Call.State.WAITING)) { if (DBG) log("acceptCall: accepting"); // Always unmute when answering a new call mRingingCall.setMute(false); mRingingCall.acceptCall(); } else { if (DBG) { log("acceptCall:" + " throw CallStateException(\"phone not ringing\")"); } throw new CallStateException("phone not ringing"); } } }
private Connection dialInternal(String dialString) throws CallStateException { if (DBG) log("dialInternal: dialString=" + (VDBG ? dialString : "xxxxxx")); clearDisconnected(); if (!canDial()) { throw new CallStateException("dialInternal: cannot dial in current state"); } if (mForegroundCall.getState() == SipCall.State.ACTIVE) { switchHoldingAndActive(); } if (mForegroundCall.getState() != SipCall.State.IDLE) { // we should have failed in !canDial() above before we get here throw new CallStateException("cannot dial in current state"); } mForegroundCall.setMute(false); try { Connection c = mForegroundCall.dial(dialString); return c; } catch (SipException e) { loge("dialInternal: ", e); throw new CallStateException("dial error: " + e); } }
@Override public void setMute(boolean muted) { synchronized (SipPhone.class) { mForegroundCall.setMute(muted); } }