aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk.c
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-19 07:01:40 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-19 07:01:40 +0000
commit82835dcbcdbbb24a6b6a9bb469b1d74b3adb9c31 (patch)
tree06d9c8f6dbc59f314c049c003fe5a22122c69424 /main/asterisk.c
parent7116d4562d1d3be51df596ea3ec10a2bd53c7ee5 (diff)
Add option for starting remote Asterisk by naming the actual runtime socket instead of pointing
to configuration file with -C Reported by: sobomax Patches: asterisk.c.diff.trunk uploaded by sobomax (license 359) doc changes by committer (closes issue #11598) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@93854 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index c8c32d4f7..4e2966383 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -2398,6 +2398,7 @@ static int show_cli_help(void) {
printf(" of output to the CLI\n");
printf(" -v Increase verbosity (multiple v's = more verbose)\n");
printf(" -x <cmd> Execute command <cmd> (only valid with -r)\n");
+ printf(" -s <socket> Connect to Asterisk via socket <socket> (only valid with -r)\n");
printf("\n");
return 0;
}
@@ -2670,6 +2671,7 @@ int main(int argc, char *argv[])
int isroot = 1;
char *buf;
const char *runuser = NULL, *rungroup = NULL;
+ char *remotesock = NULL;
/* Remember original args for restart */
if (argc > sizeof(_argv) / sizeof(_argv[0]) - 1) {
@@ -2700,7 +2702,7 @@ int main(int argc, char *argv[])
if (getenv("HOME"))
snprintf(filename, sizeof(filename), "%s/.asterisk_history", getenv("HOME"));
/* Check for options */
- while ((c = getopt(argc, argv, "mtThfFdvVqprRgciInx:U:G:C:L:M:e:")) != -1) {
+ while ((c = getopt(argc, argv, "mtThfFdvVqprRgciInx:U:G:C:L:M:e:s:")) != -1) {
switch (c) {
#if defined(HAVE_SYSINFO)
case 'e':
@@ -2789,6 +2791,9 @@ int main(int argc, char *argv[])
case 'G':
rungroup = optarg;
break;
+ case 's':
+ remotesock = optarg;
+ break;
case '?':
exit(1);
}
@@ -2821,6 +2826,9 @@ int main(int argc, char *argv[])
ast_verbose("[ Reading Master Configuration ]\n");
ast_readconfig();
+ if (ast_opt_remote && remotesock != NULL)
+ ast_copy_string((char *) ast_config_AST_SOCKET, remotesock, sizeof(ast_config_AST_SOCKET));
+
if (!ast_language_is_prefix && !ast_opt_remote)
ast_log(LOG_WARNING, "The 'languageprefix' option in asterisk.conf is deprecated; in a future release it will be removed, and your sound files will need to be organized in the 'new style' language layout.\n");