How to Record a Call

Top  Previous  Next

AstaSIP SDK does not provide a file based API for call recording . However you can record calls easily using media callbacks provided by the SDK.

 

For the Delphi version there are events

 

OnAudioMixedData

OnAudioTXData

OnAudioRXData

OnMediaOpenTX

OnMediaOpenRX

OnMediaCloseTX

OnMediaCloseRX.

 

For other AstaSIP SDK versions you should use implement these events using the helper DLL.

 

Please see the template project Asta_DSPLibrary from the SDK distribution.

 

The flow of events for recording a call follows:

 

OnMediaOpenRX and OnMediaOpenTX events are fired playing  starts to the speaker and microphone capturing has been triggered

 

 

You can create the corresponding files in the handlers or append rows to a database or send a notification to a remote host – it all depends on what your goal is.

 

The OnAudioTXData event is fired when audio data is captured from the microphone. You can easily write this data to a file or a database.

 

 

The OnAudioRXData event is fired when the audio data starts to play to the speaker. Just store it to file or database.

 

OnAudioMixedData event is fired when a new portion of mixed audio is available. The sources for this audio data is audio stream from the microphone and audio stream to the speaker. You can write this data to any stream based storage.  Usually you need to handle this event to record calls.

 

The last 3 events are called regularly – as new data is captured from the microphone and received to be played.

 

The last two events are :OnMediaCloseRX and OnMediaCloseTX.

 

They are called when the SDK stops capturing from the microphone and playing data to the speaker.

 

You should to close the corresponding files or DB in handlers.

 

Please don’t forget to load helper library using the SetDSPLibrary() method.

 

Good luck recording!