mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
add --auto-answer CLI option
This patch: - add --auto-answer CLI argument option - bind it to a new Manager atomic bool - force a answerCall to be called if an incoming call is created and if the autoAnswer bool is true Note: this option is not intended to be use with a client. Use at your own risk. Change-Id: I7c3edbbaea5462b2dfda9ec68dd9e41667f00aca Tuleap: #425
This commit is contained in:
@ -57,6 +57,7 @@ print_usage()
|
||||
"-c, --console \t- Log in console (instead of syslog)" << std::endl <<
|
||||
"-d, --debug \t- Debug mode (more verbose)" << std::endl <<
|
||||
"-p, --persistent \t- Stay alive after client quits" << std::endl <<
|
||||
"--auto-answer \t- Force automatic answer to incoming calls" << std::endl <<
|
||||
"-h, --help \t- Print help" << std::endl;
|
||||
}
|
||||
|
||||
@ -66,21 +67,23 @@ print_usage()
|
||||
static bool
|
||||
parse_args(int argc, char *argv[], bool& persistent)
|
||||
{
|
||||
static const struct option long_options[] = {
|
||||
int consoleFlag = false;
|
||||
int debugFlag = false;
|
||||
int helpFlag = false;
|
||||
int versionFlag = false;
|
||||
int autoAnswer = false;
|
||||
|
||||
const struct option long_options[] = {
|
||||
/* These options set a flag. */
|
||||
{"debug", no_argument, NULL, 'd'},
|
||||
{"console", no_argument, NULL, 'c'},
|
||||
{"persistent", no_argument, NULL, 'p'},
|
||||
{"help", no_argument, NULL, 'h'},
|
||||
{"version", no_argument, NULL, 'v'},
|
||||
{"auto-answer", no_argument, &autoAnswer, true},
|
||||
{0, 0, 0, 0} /* Sentinel */
|
||||
};
|
||||
|
||||
int consoleFlag = false;
|
||||
int debugFlag = false;
|
||||
int helpFlag = false;
|
||||
int versionFlag = false;
|
||||
|
||||
while (true) {
|
||||
/* getopt_long stores the option index here. */
|
||||
int option_index = 0;
|
||||
@ -134,6 +137,9 @@ parse_args(int argc, char *argv[], bool& persistent)
|
||||
if (debugFlag)
|
||||
ringFlags |= DRing::DRING_FLAG_DEBUG;
|
||||
|
||||
if (autoAnswer)
|
||||
ringFlags |= DRing::DRING_FLAG_AUTOANSWER;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user