use of org.pjsip.pjsua2.pjsip_inv_state in project vialer-android by VoIPGRID.
the class SipCall method onCallState.
/**
* Translate the callback to the interface, which is currently implemented by the SipService.
*
* @param onCallStateParam parameters containing the state of an active call.
*/
@Override
public void onCallState(OnCallStateParam onCallStateParam) {
try {
// Check to see if we can get CallInfo with this callback.
CallInfo info = getInfo();
pjsip_inv_state callState = info.getState();
mRemoteLogger.e("CallState changed!");
mRemoteLogger.e(callState.toString());
if (callState == pjsip_inv_state.PJSIP_INV_STATE_CALLING) {
// We are handling a outgoing call.
mOutgoingCall = true;
onCallStartRingback();
} else if (callState == pjsip_inv_state.PJSIP_INV_STATE_CONFIRMED) {
// Call has been setup, stop ringback.
onCallStopRingback();
onCallConnected();
} else if (callState == pjsip_inv_state.PJSIP_INV_STATE_DISCONNECTED) {
if (mIpChangeInProgress && mCurrentCallState.equals(SipConstants.CALL_INCOMING_RINGING)) {
mRemoteLogger.d("Network switch during ringing phase.");
}
onCallStopRingback();
onCallDisconnected();
delete();
}
} catch (Exception e) {
e.printStackTrace();
this.onCallInvalidState(e);
}
}
Aggregations