Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to record only a part of a call #3875

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions pjsip-apps/src/pjsua/pjsua_app_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ static void keystroke_help()
puts("| dq Dump curr. call quality | cd Disconnect port | dc Dump config |");
puts("| | V Adjust audio Volume | f Save config |");
puts("| S Send arbitrary REQUEST | Cp Codec priorities | |");
puts("| | ct Start recording | |");
puts("| | cp Stop recording | |");
puts("+-----------------------------------------------------------------------------+");
#if PJSUA_HAS_VIDEO
puts("| Video: \"vid help\" for more info |");
Expand Down Expand Up @@ -1714,6 +1716,29 @@ static void ui_conf_connect(char menuin[])
}
}

static void ui_conf_recorder_create()
{
pj_status_t status;

if (app_config.rec_file.slen) {
status = pjsua_recorder_create(&app_config.rec_file, 0, NULL, 0, 0,
&app_config.rec_id);
}
if (status != PJ_SUCCESS) {
puts("Error to create recorder");
return;
}
app_config.rec_port = pjsua_recorder_get_conf_port(app_config.rec_id);
puts("Recorder was created");
}

static void ui_conf_recorder_destroy()
{
pjsua_recorder_destroy(app_config.rec_id);
app_config.rec_port = PJSUA_INVALID_ID;
puts("Recorder was destroyed");
}

static void ui_adjust_volume()
{
char buf[128];
Expand Down Expand Up @@ -2048,6 +2073,12 @@ void legacy_main(void)
case 'd':
ui_conf_connect(menuin);
break;
case 't':
ui_conf_recorder_create();
break;
case 'p':
ui_conf_recorder_destroy();
break;
}
break;

Expand Down
Loading