[Freeswitch-svn] [commit] r5812 - in freeswitch/trunk/src: . include mod/applications/mod_commands
Freeswitch SVN
anthm at freeswitch.org
Fri Oct 5 09:42:12 EDT 2007
Author: anthm
Date: Fri Oct 5 09:42:11 2007
New Revision: 5812
Modified:
freeswitch/trunk/src/include/switch_types.h
freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
freeswitch/trunk/src/switch_core.c
Log:
add max_sessions fsctl command
Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h (original)
+++ freeswitch/trunk/src/include/switch_types.h Fri Oct 5 09:42:11 2007
@@ -1009,7 +1009,8 @@
SCSC_LOGLEVEL,
SCSC_SPS,
SCSC_LAST_SPS,
- SCSC_RECLAIM
+ SCSC_RECLAIM,
+ SCSC_MAX_SESSIONS
} switch_session_ctl_t;
typedef struct apr_pool_t switch_memory_pool_t;
Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c Fri Oct 5 09:42:11 2007
@@ -121,6 +121,12 @@
switch_core_session_ctl(SCSC_SHUTDOWN, &arg);
} else if (!strcasecmp(argv[0], "reclaim_mem")) {
switch_core_session_ctl(SCSC_RECLAIM, &arg);
+ } else if (!strcasecmp(argv[0], "max_sessions")) {
+ if (argc > 1) {
+ arg = atoi(argv[1]);
+ }
+ switch_core_session_ctl(SCSC_MAX_SESSIONS, &arg);
+ stream->write_function(stream, "max sessions: %d\n", arg);
} else if (!strcasecmp(argv[0], "loglevel")) {
if (argc > 1) {
if (*argv[1] > 47 && *argv[1] < 58) {
Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c (original)
+++ freeswitch/trunk/src/switch_core.c Fri Oct 5 09:42:11 2007
@@ -657,6 +657,9 @@
}
*val = runtime.hard_log_level;
break;
+ case SCSC_MAX_SESSIONS:
+ *val = switch_core_session_limit(*val);
+ break;
case SCSC_LAST_SPS:
*val = runtime.sps_last;
break;
More information about the Freeswitch-svn
mailing list