|
|
@ -29,7 +29,7 @@ |
|
|
|
|
|
|
|
|
int ktable = 0; |
|
|
int ktable = 0; |
|
|
int num_threads = 8; |
|
|
int num_threads = 8; |
|
|
const char *output_storage = "file"; |
|
|
|
|
|
|
|
|
enum output_storage_enum output_storage = OUTPUT_STORAGE_FILE; |
|
|
const char *spool_dir = "/var/spool/rtpengine"; |
|
|
const char *spool_dir = "/var/spool/rtpengine"; |
|
|
const char *output_dir = "/var/lib/rtpengine-recording"; |
|
|
const char *output_dir = "/var/lib/rtpengine-recording"; |
|
|
static const char *output_format = "wav"; |
|
|
static const char *output_format = "wav"; |
|
|
@ -135,11 +135,13 @@ static void cleanup(void) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void options(int *argc, char ***argv) { |
|
|
static void options(int *argc, char ***argv) { |
|
|
|
|
|
const char *os_str; |
|
|
|
|
|
|
|
|
GOptionEntry e[] = { |
|
|
GOptionEntry e[] = { |
|
|
{ "table", 't', 0, G_OPTION_ARG_INT, &ktable, "Kernel table rtpengine uses", "INT" }, |
|
|
{ "table", 't', 0, G_OPTION_ARG_INT, &ktable, "Kernel table rtpengine uses", "INT" }, |
|
|
{ "spool-dir", 0, 0, G_OPTION_ARG_STRING, &spool_dir, "Directory containing rtpengine metadata files", "PATH" }, |
|
|
{ "spool-dir", 0, 0, G_OPTION_ARG_STRING, &spool_dir, "Directory containing rtpengine metadata files", "PATH" }, |
|
|
{ "num-threads", 0, 0, G_OPTION_ARG_INT, &num_threads, "Number of worker threads", "INT" }, |
|
|
{ "num-threads", 0, 0, G_OPTION_ARG_INT, &num_threads, "Number of worker threads", "INT" }, |
|
|
{ "output-storage", 0, 0, G_OPTION_ARG_STRING, &output_storage,"Where to store audio streams", "file|db|both" }, |
|
|
|
|
|
|
|
|
{ "output-storage", 0, 0, G_OPTION_ARG_STRING, &os_str, "Where to store audio streams", "file|db|both" }, |
|
|
{ "output-dir", 0, 0, G_OPTION_ARG_STRING, &output_dir, "Where to write media files to", "PATH" }, |
|
|
{ "output-dir", 0, 0, G_OPTION_ARG_STRING, &output_dir, "Where to write media files to", "PATH" }, |
|
|
{ "output-format", 0, 0, G_OPTION_ARG_STRING, &output_format, "Write audio files of this type", "wav|mp3|none" }, |
|
|
{ "output-format", 0, 0, G_OPTION_ARG_STRING, &output_format, "Write audio files of this type", "wav|mp3|none" }, |
|
|
{ "resample-to", 0, 0, G_OPTION_ARG_INT, &resample_audio,"Resample all output audio", "INT" }, |
|
|
{ "resample-to", 0, 0, G_OPTION_ARG_INT, &resample_audio,"Resample all output audio", "INT" }, |
|
|
@ -168,6 +170,15 @@ static void options(int *argc, char ***argv) { |
|
|
} |
|
|
} |
|
|
} else if (!output_mixed && !output_single) |
|
|
} else if (!output_mixed && !output_single) |
|
|
output_mixed = output_single = 1; |
|
|
output_mixed = output_single = 1; |
|
|
|
|
|
|
|
|
|
|
|
if (!strcmp(os_str, "file")) |
|
|
|
|
|
output_storage = OUTPUT_STORAGE_FILE; |
|
|
|
|
|
else if (!strcmp(os_str, "db")) |
|
|
|
|
|
output_storage = OUTPUT_STORAGE_DB; |
|
|
|
|
|
else if (!strcmp(os_str, "both")) |
|
|
|
|
|
output_storage = OUTPUT_STORAGE_BOTH; |
|
|
|
|
|
else |
|
|
|
|
|
die("Invalid 'output-storage' option"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|