Add optional call limit

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2005-05-18 01:49:13 +00:00
parent 9f9fcca6c0
commit 38b7f7b4a4
7 changed files with 64 additions and 3 deletions

View File

@@ -87,6 +87,7 @@ int option_timestamp = 0;
int option_overrideconfig = 0;
int option_reconnect = 0;
int option_transcode_slin = 1;
int option_maxcalls = 0;
int fully_booted = 0;
char record_cache_dir[AST_CACHE_DIR_LEN] = AST_TMP_DIR;
char debug_filename[AST_FILENAME_MAX] = "";
@@ -1658,6 +1659,11 @@ static void ast_readconfig(void) {
/* Build transcode paths via SLINEAR, instead of directly */
} else if (!strcasecmp(v->name, "transcode_via_sln")) {
option_transcode_slin = ast_true(v->value);
} else if (!strcasecmp(v->name, "maxcalls")) {
if ((sscanf(v->value, "%d", &option_maxcalls) != 1) ||
(option_maxcalls < 0)) {
option_maxcalls = 0;
}
}
v = v->next;
}
@@ -1711,7 +1717,7 @@ int main(int argc, char *argv[])
}
*/
/* Check for options */
while((c=getopt(argc, argv, "tThfdvVqprRgcinx:U:G:C:")) != -1) {
while((c=getopt(argc, argv, "tThfdvVqprRgcinx:U:G:C:M:")) != -1) {
switch(c) {
case 'd':
option_debug++;
@@ -1743,6 +1749,10 @@ int main(int argc, char *argv[])
option_verbose++;
option_nofork++;
break;
case 'M':
if ((sscanf(optarg, "%d", &option_maxcalls) != 1) || (option_maxcalls < 0))
option_maxcalls = 0;
break;
case 'q':
option_quiet++;
break;