From 28a58f5436d5556d83433ba2818457af31ae7330 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 30 Jul 2013 19:37:17 +0500 Subject: [PATCH] add -certs command line switch --- src/switch.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/switch.c b/src/switch.c index 6ae8e584db..8624682bc5 100644 --- a/src/switch.c +++ b/src/switch.c @@ -461,6 +461,7 @@ static const char usage[] = "\t-scripts [scriptsdir] -- alternate directory for scripts\n" "\t-temp [directory] -- alternate directory for temporary files\n" "\t-grammar [directory] -- alternate directory for grammar files\n" + "\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-sounds [directory] -- alternate directory for sound files\n"; @@ -944,6 +945,21 @@ int main(int argc, char *argv[]) strcpy(SWITCH_GLOBAL_dirs.grammar_dir, local_argv[x]); } + else if (!strcmp(local_argv[x], "-certs")) { + x++; + if (switch_strlen_zero(local_argv[x]) || is_option(local_argv[x])) { + fprintf(stderr, "When using -certs you must specify a grammar directory\n"); + return 255; + } + + SWITCH_GLOBAL_dirs.certs_dir = (char *) malloc(strlen(local_argv[x]) + 1); + if (!SWITCH_GLOBAL_dirs.certs_dir) { + fprintf(stderr, "Allocation error\n"); + return 255; + } + strcpy(SWITCH_GLOBAL_dirs.certs_dir, local_argv[x]); + } + else if (!strcmp(local_argv[x], "-sounds")) { x++; if (switch_strlen_zero(local_argv[x]) || is_option(local_argv[x])) {