mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 13:12:03 +00:00
FS-3764 --resolve
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
* Cesar Cepeda <cesar@auronix.com>
|
||||
* Massimo Cetra <devel@navynet.it>
|
||||
* Rupa Schomaker <rupa@rupa.com>
|
||||
* Joseph Sullivan <jossulli@amazon.com>
|
||||
*
|
||||
*
|
||||
* mod_commands.c -- Misc. Command Module
|
||||
@@ -1792,7 +1793,7 @@ SWITCH_STANDARD_API(status_function)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#define CTL_SYNTAX "[send_sighup|hupall|pause|resume|shutdown [cancel|elegant|asap|now|restart]|sps|sync_clock|sync_clock_when_idle|reclaim_mem|max_sessions|min_dtmf_duration [num]|max_dtmf_duration [num]|default_dtmf_duration [num]|min_idle_cpu|loglevel [level]|debug_level [level]]"
|
||||
#define CTL_SYNTAX "[send_sighup|hupall|pause [inbound|outbound]|resume [inbound|outbound]|shutdown [cancel|elegant|asap|now|restart]|sps|sync_clock|sync_clock_when_idle|reclaim_mem|max_sessions|min_dtmf_duration [num]|max_dtmf_duration [num]|default_dtmf_duration [num]|min_idle_cpu|loglevel [level]|debug_level [level]]"
|
||||
SWITCH_STANDARD_API(ctl_function)
|
||||
{
|
||||
int argc;
|
||||
@@ -1815,16 +1816,32 @@ SWITCH_STANDARD_API(ctl_function)
|
||||
switch_core_session_ctl(SCSC_FLUSH_DB_HANDLES, NULL);
|
||||
stream->write_function(stream, "+OK\n");
|
||||
} else if (!strcasecmp(argv[0], "pause")) {
|
||||
switch_session_ctl_t command = SCSC_PAUSE_ALL;
|
||||
arg = 1;
|
||||
switch_core_session_ctl(SCSC_PAUSE_INBOUND, &arg);
|
||||
if (argv[1]) {
|
||||
if (!strcasecmp(argv[1], "inbound")) {
|
||||
command = SCSC_PAUSE_INBOUND;
|
||||
} else if (!strcasecmp(argv[1], "outbound")) {
|
||||
command = SCSC_PAUSE_OUTBOUND;
|
||||
}
|
||||
}
|
||||
switch_core_session_ctl(command, &arg);
|
||||
stream->write_function(stream, "+OK\n");
|
||||
} else if (!strcasecmp(argv[0], "send_sighup")) {
|
||||
arg = 1;
|
||||
switch_core_session_ctl(SCSC_SEND_SIGHUP, &arg);
|
||||
stream->write_function(stream, "+OK\n");
|
||||
} else if (!strcasecmp(argv[0], "resume")) {
|
||||
switch_session_ctl_t command = SCSC_PAUSE_ALL;
|
||||
arg = 0;
|
||||
switch_core_session_ctl(SCSC_PAUSE_INBOUND, &arg);
|
||||
if (argv[1]) {
|
||||
if (!strcasecmp(argv[1], "inbound")) {
|
||||
command = SCSC_PAUSE_INBOUND;
|
||||
} else if (!strcasecmp(argv[1], "outbound")) {
|
||||
command = SCSC_PAUSE_OUTBOUND;
|
||||
}
|
||||
}
|
||||
switch_core_session_ctl(command, &arg);
|
||||
stream->write_function(stream, "+OK\n");
|
||||
} else if (!strcasecmp(argv[0], "calibrate_clock")) {
|
||||
switch_core_session_ctl(SCSC_CALIBRATE_CLOCK, NULL);
|
||||
@@ -1855,7 +1872,15 @@ SWITCH_STANDARD_API(ctl_function)
|
||||
switch_core_session_ctl(SCSC_SAVE_HISTORY, NULL);
|
||||
stream->write_function(stream, "+OK\n");
|
||||
} else if (!strcasecmp(argv[0], "pause_check")) {
|
||||
switch_core_session_ctl(SCSC_PAUSE_CHECK, &arg);
|
||||
switch_session_ctl_t command = SCSC_PAUSE_CHECK;
|
||||
if (argv[1]) {
|
||||
if (!strcasecmp(argv[1], "inbound")) {
|
||||
command = SCSC_PAUSE_INBOUND_CHECK;
|
||||
} else if (!strcasecmp(argv[1], "outbound")) {
|
||||
command = SCSC_PAUSE_OUTBOUND_CHECK;
|
||||
}
|
||||
}
|
||||
switch_core_session_ctl(command, &arg);
|
||||
stream->write_function(stream, arg ? "true" : "false");
|
||||
} else if (!strcasecmp(argv[0], "ready_check")) {
|
||||
switch_core_session_ctl(SCSC_READY_CHECK, &arg);
|
||||
@@ -5431,13 +5456,19 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
|
||||
switch_console_set_complete("add fsctl max_sessions");
|
||||
switch_console_set_complete("add fsctl min_dtmf_duration");
|
||||
switch_console_set_complete("add fsctl pause");
|
||||
switch_console_set_complete("add fsctl pause inbound");
|
||||
switch_console_set_complete("add fsctl pause outbound");
|
||||
switch_console_set_complete("add fsctl reclaim_mem");
|
||||
switch_console_set_complete("add fsctl resume");
|
||||
switch_console_set_complete("add fsctl resume inbound");
|
||||
switch_console_set_complete("add fsctl resume outbound");
|
||||
switch_console_set_complete("add fsctl calibrate_clock");
|
||||
switch_console_set_complete("add fsctl crash");
|
||||
switch_console_set_complete("add fsctl verbose_events");
|
||||
switch_console_set_complete("add fsctl save_history");
|
||||
switch_console_set_complete("add fsctl pause_check");
|
||||
switch_console_set_complete("add fsctl pause_check inbound");
|
||||
switch_console_set_complete("add fsctl pause_check outbound");
|
||||
switch_console_set_complete("add fsctl ready_check");
|
||||
switch_console_set_complete("add fsctl shutdown_check");
|
||||
switch_console_set_complete("add fsctl shutdown");
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
* Norman Brandinger
|
||||
* Raymond Chandler <intralanman@gmail.com>
|
||||
* Nathan Patrick <npatrick at corp.sonic.net>
|
||||
* Joseph Sullivan <jossulli@amazon.com>
|
||||
*
|
||||
*
|
||||
* sofia.c -- SOFIA SIP Endpoint (sofia code)
|
||||
@@ -936,7 +937,7 @@ static void our_sofia_event_callback(nua_event_t event,
|
||||
uint32_t sess_count = switch_core_session_count();
|
||||
uint32_t sess_max = switch_core_session_limit(0);
|
||||
|
||||
if (sess_count >= sess_max || !sofia_test_pflag(profile, PFLAG_RUNNING) || !switch_core_ready()) {
|
||||
if (sess_count >= sess_max || !sofia_test_pflag(profile, PFLAG_RUNNING) || !switch_core_ready_inbound()) {
|
||||
nua_respond(nh, 503, "Maximum Calls In Progress", SIPTAG_RETRY_AFTER_STR("300"), TAG_END());
|
||||
|
||||
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "No more sessions allowed at this time.\n");
|
||||
@@ -8351,7 +8352,7 @@ void sofia_handle_sip_i_options(int status,
|
||||
uint32_t sess_max = switch_core_session_limit(0);
|
||||
|
||||
if (sofia_test_pflag(profile, PFLAG_OPTIONS_RESPOND_503_ON_BUSY) &&
|
||||
(sess_count >= sess_max || !sofia_test_pflag(profile, PFLAG_RUNNING) || !switch_core_ready())) {
|
||||
(sess_count >= sess_max || !sofia_test_pflag(profile, PFLAG_RUNNING) || !switch_core_ready_inbound())) {
|
||||
nua_respond(nh, 503, "Maximum Calls In Progress", NUTAG_WITH_THIS_MSG(de->data->e_msg), SIPTAG_RETRY_AFTER_STR("300"), TAG_END());
|
||||
} else {
|
||||
nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS_MSG(de->data->e_msg), TAG_END());
|
||||
|
||||
Reference in New Issue
Block a user