aboutsummaryrefslogtreecommitdiffstats
path: root/asterisk.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-18 01:49:13 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-18 01:49:13 +0000
commite2c8bb9c440289d09415aa7464bdfa921b91f426 (patch)
treed354c66fada464fed80154e7002ee445c4d36d52 /asterisk.c
parent6c8c36cb1296babe111fc188cf94358137df932d (diff)
Add optional call limit
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5712 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'asterisk.c')
-rwxr-xr-xasterisk.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/asterisk.c b/asterisk.c
index f42193fe3..308519ba2 100755
--- a/asterisk.c
+++ b/asterisk.c
@@ -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;