@@ -3351,7 +3351,7 @@ static int show_cli_help(void)
3351
3351
printf (" -L <load> Limit the maximum load average before rejecting new calls\n" );
3352
3352
printf (" -M <value> Limit the maximum number of calls to the specified value\n" );
3353
3353
printf (" -m Mute debugging and console output on the console\n" );
3354
- printf (" -n Disable console colorization\n" );
3354
+ printf (" -n Disable console colorization. Can be used only at startup. \n" );
3355
3355
printf (" -p Run as pseudo-realtime thread\n" );
3356
3356
printf (" -q Quiet mode (suppress output)\n" );
3357
3357
printf (" -r Connect to Asterisk on this machine\n" );
@@ -3360,7 +3360,7 @@ static int show_cli_help(void)
3360
3360
printf (" -t Record soundfiles in /var/tmp and move them where they\n" );
3361
3361
printf (" belong after they are done\n" );
3362
3362
printf (" -T Display the time in [Mmm dd hh:mm:ss] format for each line\n" );
3363
- printf (" of output to the CLI\n" );
3363
+ printf (" of output to the CLI. Cannot be used with remote console mode.\n \n" );
3364
3364
printf (" -v Increase verbosity (multiple v's = more verbose)\n" );
3365
3365
printf (" -x <cmd> Execute command <cmd> (implies -r)\n" );
3366
3366
printf (" -X Enable use of #exec in asterisk.conf\n" );
@@ -3716,6 +3716,55 @@ int main(int argc, char *argv[])
3716
3716
}
3717
3717
}
3718
3718
3719
+ if (ast_opt_remote ) {
3720
+ int didwarn = 0 ;
3721
+ optind = 1 ;
3722
+
3723
+ /* Not all options can be used with remote console. Warn if they're used. */
3724
+ while ((c = getopt (argc , argv , getopt_settings )) != -1 ) {
3725
+ switch (c ) {
3726
+ /* okay to run with remote console */
3727
+ case 'B' : /* force black background */
3728
+ case 'd' : /* debug */
3729
+ case 'h' : /* help */
3730
+ case 'I' : /* obsolete timing option: warning already thrown if used */
3731
+ case 'L' : /* max load */
3732
+ case 'M' : /* max calls */
3733
+ case 'R' : /* reconnect */
3734
+ case 'r' : /* remote */
3735
+ case 's' : /* set socket path */
3736
+ case 'V' : /* version */
3737
+ case 'v' : /* verbose */
3738
+ case 'W' : /* white background */
3739
+ case 'x' : /* remote execute */
3740
+ case '?' : /* ? */
3741
+ break ;
3742
+ /* can only be run when Asterisk is starting */
3743
+ case 'X' : /* enables #exec for asterisk.conf only. */
3744
+ case 'C' : /* set config path */
3745
+ case 'c' : /* foreground console */
3746
+ case 'e' : /* minimum memory free */
3747
+ case 'F' : /* always fork */
3748
+ case 'f' : /* no fork */
3749
+ case 'G' : /* run group */
3750
+ case 'g' : /* dump core */
3751
+ case 'i' : /* init keys */
3752
+ case 'm' : /* mute */
3753
+ case 'n' : /* no color */
3754
+ case 'p' : /* high priority */
3755
+ case 'q' : /* quiet */
3756
+ case 'T' : /* timestamp */
3757
+ case 't' : /* cache record files */
3758
+ case 'U' : /* run user */
3759
+ fprintf (stderr , "'%c' option is not compatible with remote console mode and has no effect.\n" , c );
3760
+ didwarn = 1 ;
3761
+ }
3762
+ }
3763
+ if (didwarn ) {
3764
+ fprintf (stderr , "\n" ); /* if any warnings print out, make them stand out */
3765
+ }
3766
+ }
3767
+
3719
3768
/* For remote connections, change the name of the remote connection.
3720
3769
* We do this for the benefit of init scripts (which need to know if/when
3721
3770
* the main asterisk process has died yet). */
0 commit comments