mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 09:36:46 +00:00
add support for cache directory
make configs use specific directory variables instead of just base_dir so that one configuration can be used for fhs and legacy installations
This commit is contained in:
16
src/switch.c
16
src/switch.c
@@ -478,6 +478,7 @@ static const char usage[] =
|
||||
"\t-certs [directory] -- alternate directory for certificates\n"
|
||||
"\t-recordings [directory] -- alternate directory for recordings\n"
|
||||
"\t-storage [directory] -- alternate directory for voicemail storage\n"
|
||||
"\t-cache [directory] -- alternate directory for cache files\n"
|
||||
"\t-sounds [directory] -- alternate directory for sound files\n";
|
||||
|
||||
|
||||
@@ -929,6 +930,21 @@ int main(int argc, char *argv[])
|
||||
strcpy(SWITCH_GLOBAL_dirs.storage_dir, local_argv[x]);
|
||||
}
|
||||
|
||||
else if (!strcmp(local_argv[x], "-cache")) {
|
||||
x++;
|
||||
if (switch_strlen_zero(local_argv[x]) || is_option(local_argv[x])) {
|
||||
fprintf(stderr, "When using -cache you must specify a cache directory\n");
|
||||
return 255;
|
||||
}
|
||||
|
||||
SWITCH_GLOBAL_dirs.cache_dir = (char *) malloc(strlen(local_argv[x]) + 1);
|
||||
if (!SWITCH_GLOBAL_dirs.cache_dir) {
|
||||
fprintf(stderr, "Allocation error\n");
|
||||
return 255;
|
||||
}
|
||||
strcpy(SWITCH_GLOBAL_dirs.cache_dir, local_argv[x]);
|
||||
}
|
||||
|
||||
else if (!strcmp(local_argv[x], "-recordings")) {
|
||||
x++;
|
||||
if (switch_strlen_zero(local_argv[x]) || is_option(local_argv[x])) {
|
||||
|
Reference in New Issue
Block a user