+/**
+ * Enable recording of the call (voice-only).
+ * This function must be used before the call parameters are assigned to the call.
+ * The call recording can be started and paused after the call is established with
+ * linphone_call_start_recording() and linphone_call_pause_recording().
+ * @param cp the call parameters
+ * @param path path and filename of the file where audio is written.
+**/
+void linphone_call_params_set_record_file(LinphoneCallParams *cp, const char *path){
+ if (cp->record_file){
+ ms_free(cp->record_file);
+ cp->record_file=NULL;
+ }
+ if (path) cp->record_file=ms_strdup(path);
+}
+
+/**
+ * Retrieves the path for the audio recoding of the call.
+**/
+const char *linphone_call_params_get_record_file(const LinphoneCallParams *cp){
+ return cp->record_file;
+}
+
+/**
+ * Start call recording.
+ * The output file where audio is recorded must be previously specified with linphone_call_params_set_record_file().
+**/
+void linphone_call_start_recording(LinphoneCall *call){
+ if (!call->params.record_file){
+ ms_error("linphone_call_start_recording(): no output file specified. Use linphone_call_params_set_record_file().");
+ return;
+ }
+ if (call->audiostream && !call->params.in_conference){
+ audio_stream_mixed_record_start(call->audiostream);
+ }
+ call->record_active=TRUE;
+}
+
+/**
+ * Stop call recording.
+**/
+void linphone_call_stop_recording(LinphoneCall *call){
+ if (call->audiostream && !call->params.in_conference){
+ audio_stream_mixed_record_stop(call->audiostream);
+ }
+ call->record_active=FALSE;
+}