linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] Auto record feature


From: Bryant Bunderson
Subject: [Linphone-developers] Auto record feature
Date: Fri, 19 Sep 2014 20:39:36 +0000

I added an auto-record option when starting Linphone from the command line. This is in my build only. I haven’t pushed anything. I had to modify only a few lines of code but it seems to work well enough. This is just an FYI if some of you want a simple auto-record feature like I did.

The only changes are to the file gtk/main.c as follows:

Add a new boolean to hold the state of the new command line option.
static gboolean auto_record = 0;

Add the new command line option “—auto-record”.
{
   .long_name = "auto-record",
   .short_name = '\0',
   .arg = G_OPTION_ARG_NONE,
   .arg_data = (gpointer) & auto_record,
   .description = N_("if set automatically record incoming calls")
},

Modify the function to start recording incoming calls. I suppose that you would do something similar if you wanted to record outbound calls.
static void accept_incoming_call(LinphoneCall *call){
LinphoneCore *lc=linphone_gtk_get_core();
LinphoneCallParams *params=linphone_core_create_default_call_parameters(lc);
gchar *record_file=linphone_gtk_get_record_path(linphone_call_get_remote_address(call),FALSE);
linphone_call_params_set_record_file(params,record_file);
linphone_core_accept_call_with_params(lc,call,params);
+ if (auto_record) {
+ ms_message("-------auto recording call-------");
+ linphone_call_start_recording(call);
+ }
linphone_call_params_destroy(params);
}

So that’s all that’s needed. Here is an example of what the command line looks like:
/opt/local/bin/linphone --auto-answer --auto-record --config='/Users/bryantbunderson/.linphone-user0006' &

While this feature allows auto-recording is isn’t really complete until the incall_view.c file is modified to properly show the recording state. The UI doesn’t get updated to show the filename and the button isn’t displayed as pressed when the auto-record starts as it is when the Record button is used in the UI.

Thank you to Guillaume BIENKOWSKI for getting me started with this.

Bryant

reply via email to

[Prev in Thread] Current Thread [Next in Thread]