support Administrator
Joined: January 26 2005 Location: United States Posts: 1666
|
Posted: January 28 2008 at 10:08am | IP Logged
|
|
|
Hi Thomas,
For .NET code, you have to create a PhoneLineRecord object for each phone line you want to record from. For example, the C# code to do this is:
Code:
VoipMediaEngine.TELEPHONY_RETURN_VALUE status;
// define a phone line record variable.
VoipMediaEngine.PhoneLineRecord PhoneLineRecord;
// create the phone line record object.
PhoneLineRecord = new VoipMediaEngine.PhoneLineRecord();
// call the StartPhoneLineRecording() proc to allow call recording to
// start when the next call is in the "in call" state. If a call is
// already "in call", then recording will start as soon as you call this.
status = PhoneLineRecord.StartPhoneLineRecording(
MediaEngine,
PhoneLine,
true, // RecordToFile
false, // RecordFileRaw
"c:\\0", // PhoneLineRecordDirectory
PhoneLineRecordCallbackProc,
MediaEngine
);
// do other stuff...
// call this whenever you want to complete call recording.
status = PhoneLineRecord.StopPhoneLineRecording(PhoneLine);
|
|
|
The callback used in the above code look something like the following:
Code:
// Phone line record callback. This proc always receives 20Ms of 8kHz PCM samples.
//
void PhoneLineRecordCallbackProc(VoipMediaEngine.PHONE_LINE_RECOR D_DATA PhoneLineRecordData)
{
MyMediaEngine MediaEngine;
// access the user defined parameter.
MediaEngine = (MyMediaEngine)PhoneLineRecordData.UserData;
// do other stuff…
}
|
|
|
For Vb.NET, the code is exactly the same logic.
Support
|