static int DoRecord(string to, string file) { // Example cmd line: call [email protected] OpalMessageRef command = new OpalMessageRef(); OpalMessageRef response; Console.WriteLine("Calling {0}", to); command.SetMessageType(Opal_API.OpalMessageType.OpalCmdSetUpCall); OpalParamSetUpCallRef m_callSetUp = command.GetCallSetUp(); m_callSetUp.PartyB = to; if ((response = MySendCommand(command, "Could not make call")) == null) { return(0); } currentCallToken = response.GetCallSetUp().CallToken; Console.WriteLine("Recording {0}", file); command.SetMessageType(Opal_API.OpalMessageType.OpalCmdStartRecording); OpalParamRecordingRef m_recording = command.GetRecording(); m_recording.CallToken = currentCallToken; m_recording.File = file; m_recording.Channels = 2; if ((response = MySendCommand(command, "Could not start recording")) == null) { return(0); } return(1); }