public void PauseRecording(LinphoneCall linphoneCall) { if (linphoneCall.IsExist() && LinphoneCore.IsNonZero() && !string.IsNullOrWhiteSpace(linphoneCall.RecordFile)) { GenericModules.linphone_call_stop_recording(linphoneCall.LinphoneCallPtr); } }
private CallState GetNewCallState(IntPtr call, LinphoneCallState callState, ref CallType newCallType, ref string from, ref string to, bool recordEnable) { CallState newCallState; switch (callState) { case LinphoneCallState.LinphoneCallIncomingReceived: case LinphoneCallState.LinphoneCallIncomingEarlyMedia: newCallState = CallState.Loading; newCallType = CallType.Incoming; MarshalingExtensions.TryConvert(CallModule.linphone_call_get_remote_address_as_string(call), out from); to = Identity; break; case LinphoneCallState.LinphoneCallConnected: case LinphoneCallState.LinphoneCallResuming: case LinphoneCallState.LinphoneCallStreamsRunning: case LinphoneCallState.LinphoneCallPausedByRemote: case LinphoneCallState.LinphoneCallUpdatedByRemote: newCallState = CallState.Active; break; case LinphoneCallState.LinphoneCallPaused: case LinphoneCallState.LinphoneCallPausing: newCallState = CallState.Hold; break; case LinphoneCallState.LinphoneCallOutgoingInit: case LinphoneCallState.LinphoneCallOutgoingProgress: case LinphoneCallState.LinphoneCallOutgoingRinging: case LinphoneCallState.LinphoneCallOutgoingEarlyMedia: newCallState = CallState.Loading; newCallType = CallType.Outcoming; from = Identity; MarshalingExtensions.TryConvert(CallModule.linphone_call_get_remote_address_as_string(call), out to); break; case LinphoneCallState.LinphoneCallError: newCallState = CallState.Error; break; case LinphoneCallState.LinphoneCallReleased: case LinphoneCallState.LinphoneCallEnd: newCallState = CallState.Completed; if (recordEnable) { GenericModules.linphone_call_stop_recording(call); } break; default: throw new NotImplementedException("Sorry, that feature not implemented!"); break; } return(newCallState); }