mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-08 08:51:50 +00:00
make limit work with neg count like limit_hash
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14920 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
14e4f0497d
commit
89e6324c17
@ -65,7 +65,6 @@ typedef struct {
|
|||||||
switch_hash_t *hash;
|
switch_hash_t *hash;
|
||||||
} limit_hash_private_t;
|
} limit_hash_private_t;
|
||||||
|
|
||||||
|
|
||||||
static char limit_sql[] =
|
static char limit_sql[] =
|
||||||
"CREATE TABLE limit_data (\n"
|
"CREATE TABLE limit_data (\n"
|
||||||
" hostname VARCHAR(255),\n"
|
" hostname VARCHAR(255),\n"
|
||||||
@ -1172,8 +1171,11 @@ SWITCH_STANDARD_APP(limit_hash_function)
|
|||||||
realm = argv[0];
|
realm = argv[0];
|
||||||
id = argv[1];
|
id = argv[1];
|
||||||
|
|
||||||
/* If max is omitted, only act as a counter and skip maximum checks */
|
/* If max is omitted or negative, only act as a counter and skip maximum checks */
|
||||||
if (argc > 2) {
|
if (argc > 2) {
|
||||||
|
if (argv[2][0] == '-') {
|
||||||
|
max = -1;
|
||||||
|
} else {
|
||||||
char *szinterval = NULL;
|
char *szinterval = NULL;
|
||||||
if ((szinterval = strchr(argv[2], '/')))
|
if ((szinterval = strchr(argv[2], '/')))
|
||||||
{
|
{
|
||||||
@ -1187,6 +1189,7 @@ SWITCH_STANDARD_APP(limit_hash_function)
|
|||||||
max = 0;
|
max = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (argc > 3) {
|
if (argc > 3) {
|
||||||
xfer_exten = argv[3];
|
xfer_exten = argv[3];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user