SIP: longer timeout for making call, shorter for cancelling
http://b/3021865 Change-Id: I354ebcc00f1ac68e4b7b466745c36aeb314f9138
This commit is contained in:
@ -84,7 +84,7 @@ class SipSessionGroup implements SipListener {
|
|||||||
private static final String ANONYMOUS = "anonymous";
|
private static final String ANONYMOUS = "anonymous";
|
||||||
private static final String SERVER_ERROR_PREFIX = "Response: ";
|
private static final String SERVER_ERROR_PREFIX = "Response: ";
|
||||||
private static final int EXPIRY_TIME = 3600; // in seconds
|
private static final int EXPIRY_TIME = 3600; // in seconds
|
||||||
private static final int CANCEL_CALL_TIMER = 5; // in seconds
|
private static final int CANCEL_CALL_TIMER = 3; // in seconds
|
||||||
|
|
||||||
private static final EventObject DEREGISTER = new EventObject("Deregister");
|
private static final EventObject DEREGISTER = new EventObject("Deregister");
|
||||||
private static final EventObject END_CALL = new EventObject("End call");
|
private static final EventObject END_CALL = new EventObject("End call");
|
||||||
|
@ -74,7 +74,9 @@ import java.util.List;
|
|||||||
public class SipPhone extends SipPhoneBase {
|
public class SipPhone extends SipPhoneBase {
|
||||||
private static final String LOG_TAG = "SipPhone";
|
private static final String LOG_TAG = "SipPhone";
|
||||||
private static final boolean LOCAL_DEBUG = true;
|
private static final boolean LOCAL_DEBUG = true;
|
||||||
private static final int SESSION_TIMEOUT = 8; // in seconds
|
private static final int TIMEOUT_MAKE_CALL = 15; // in seconds
|
||||||
|
private static final int TIMEOUT_ANSWER_CALL = 8; // in seconds
|
||||||
|
private static final int TIMEOUT_HOLD_CALL = 15; // in seconds
|
||||||
|
|
||||||
// A call that is ringing or (call) waiting
|
// A call that is ringing or (call) waiting
|
||||||
private SipCall ringingCall = new SipCall();
|
private SipCall ringingCall = new SipCall();
|
||||||
@ -690,7 +692,7 @@ public class SipPhone extends SipPhoneBase {
|
|||||||
|
|
||||||
void acceptCall() throws CallStateException {
|
void acceptCall() throws CallStateException {
|
||||||
try {
|
try {
|
||||||
mSipAudioCall.answerCall(SESSION_TIMEOUT);
|
mSipAudioCall.answerCall(TIMEOUT_ANSWER_CALL);
|
||||||
} catch (SipException e) {
|
} catch (SipException e) {
|
||||||
throw new CallStateException("acceptCall(): " + e);
|
throw new CallStateException("acceptCall(): " + e);
|
||||||
}
|
}
|
||||||
@ -708,7 +710,7 @@ public class SipPhone extends SipPhoneBase {
|
|||||||
void dial() throws SipException {
|
void dial() throws SipException {
|
||||||
setState(Call.State.DIALING);
|
setState(Call.State.DIALING);
|
||||||
mSipAudioCall = mSipManager.makeAudioCall(mProfile, mPeer, null,
|
mSipAudioCall = mSipManager.makeAudioCall(mProfile, mPeer, null,
|
||||||
SESSION_TIMEOUT);
|
TIMEOUT_MAKE_CALL);
|
||||||
mSipAudioCall.setRingbackToneEnabled(false);
|
mSipAudioCall.setRingbackToneEnabled(false);
|
||||||
mSipAudioCall.setListener(mAdapter);
|
mSipAudioCall.setListener(mAdapter);
|
||||||
}
|
}
|
||||||
@ -716,7 +718,7 @@ public class SipPhone extends SipPhoneBase {
|
|||||||
void hold() throws CallStateException {
|
void hold() throws CallStateException {
|
||||||
setState(Call.State.HOLDING);
|
setState(Call.State.HOLDING);
|
||||||
try {
|
try {
|
||||||
mSipAudioCall.holdCall(SESSION_TIMEOUT);
|
mSipAudioCall.holdCall(TIMEOUT_HOLD_CALL);
|
||||||
} catch (SipException e) {
|
} catch (SipException e) {
|
||||||
throw new CallStateException("hold(): " + e);
|
throw new CallStateException("hold(): " + e);
|
||||||
}
|
}
|
||||||
@ -726,7 +728,7 @@ public class SipPhone extends SipPhoneBase {
|
|||||||
mSipAudioCall.setAudioGroup(audioGroup);
|
mSipAudioCall.setAudioGroup(audioGroup);
|
||||||
setState(Call.State.ACTIVE);
|
setState(Call.State.ACTIVE);
|
||||||
try {
|
try {
|
||||||
mSipAudioCall.continueCall(SESSION_TIMEOUT);
|
mSipAudioCall.continueCall(TIMEOUT_HOLD_CALL);
|
||||||
} catch (SipException e) {
|
} catch (SipException e) {
|
||||||
throw new CallStateException("unhold(): " + e);
|
throw new CallStateException("unhold(): " + e);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user