public void MakeCallAndRecord(string uri, string filename, bool startRecordInstantly) { if (LinphoneCore.IsNonZero()) { var callParams = CreateCallParameters(); if (!string.IsNullOrWhiteSpace(filename)) { CallModule.linphone_call_params_set_record_file(callParams, filename); } IntPtr call = CallModule.linphone_core_invite_with_params(LinphoneCore, uri, callParams); if (call.IsZero()) { #if (DEBUG) ErrorEvent?.Invoke(null, "Can't call!"); #endif return; } CallModule.linphone_call_ref(call); if (startRecordInstantly) { GenericModules.linphone_call_start_recording(call); } } }
public void ReceiveCallAndRecord(LinphoneCall linphoneCall, string filename, bool startRecordInstantly = true) { if (linphoneCall.IsExist() && LinphoneCore.IsNonZero()) { CallModule.linphone_call_ref(linphoneCall.LinphoneCallPtr); IntPtr callParams = CreateCallParameters(); CallModule.linphone_call_params_set_record_file(callParams, filename); CallModule.linphone_core_accept_call_with_params(LinphoneCore, linphoneCall.LinphoneCallPtr, callParams); if (startRecordInstantly) { GenericModules.linphone_call_start_recording(linphoneCall.LinphoneCallPtr); } } }