diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 65518dc0d3..dd29136dca 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -1721,6 +1721,14 @@ SWITCH_STANDARD_API(lan_addr_function) return SWITCH_STATUS_SUCCESS; } +#include "switch_private.h" +#ifndef WIN32 +#ifdef HAVE_SETRLIMIT +#include +#endif +#endif + + SWITCH_STANDARD_API(status_function) { uint8_t html = 0; @@ -1728,6 +1736,11 @@ SWITCH_STANDARD_API(status_function) char *http = NULL; int sps = 0, last_sps = 0; const char *var; +#ifdef HAVE_SETRLIMIT + struct rlimit rlp; +#endif + + switch_core_measure_time(switch_core_uptime(), &duration); @@ -1764,6 +1777,14 @@ SWITCH_STANDARD_API(status_function) stream->write_function(stream, "%d session(s) max\n", switch_core_session_limit(0)); stream->write_function(stream, "min idle cpu %0.2f/%0.2f\n", switch_core_min_idle_cpu(-1.0), switch_core_idle_cpu()); +#ifdef HAVE_SETRLIMIT + memset(&rlp, 0, sizeof(rlp)); + getrlimit(RLIMIT_STACK, &rlp); + + stream->write_function(stream, "Current Stack Size/Max %ldK/%ldK\n", rlp.rlim_cur / 1024, rlp.rlim_max / 1024); +#endif + + if (html) { stream->write_function(stream, "\n"); } diff --git a/src/mod/applications/mod_spandsp/mod_spandsp.c b/src/mod/applications/mod_spandsp/mod_spandsp.c index 25a180ef84..f79bea68ac 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp.c @@ -403,7 +403,7 @@ SWITCH_STANDARD_API(start_send_tdd_api) } - if (!(psession = switch_core_session_locate(cmd))) { + if (!(psession = switch_core_session_locate(puuid))) { stream->write_function(stream, "-ERR Cannot locate session\n"); goto end; } @@ -736,6 +736,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_spandsp_init) SWITCH_ADD_API(api_interface, "uuid_send_tdd", "send tdd data to a uuid", start_send_tdd_api, " "); + switch_console_set_complete("add uuid_send_tdd ::console::list_uuid"); + if ((switch_event_bind(modname, SWITCH_EVENT_RELOADXML, NULL, event_handler, NULL) != SWITCH_STATUS_SUCCESS)) { diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c b/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c index b01a4638a3..a3439ed612 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c @@ -120,8 +120,9 @@ static void put_text_msg(void *user_data, const uint8_t *msg, int len) switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", "mod_spandsp"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", "tdd"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "subject", "TDD MESSAGE"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "TDD-Data", (char *)msg); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Unique-ID", switch_core_session_get_uuid(pvt->session)); - switch_event_add_body(event, "%s", (char *)msg); + switch_event_add_body(event, "%s\n\n", (char *)msg); if (switch_core_session_get_partner(pvt->session, &other_session) == SWITCH_STATUS_SUCCESS) { diff --git a/src/switch.c b/src/switch.c index 3903a15604..30a6f1e7e1 100644 --- a/src/switch.c +++ b/src/switch.c @@ -793,12 +793,11 @@ int main(int argc, char *argv[]) memset(&rlp, 0, sizeof(rlp)); getrlimit(RLIMIT_STACK, &rlp); - if (rlp.rlim_max > SWITCH_THREAD_STACKSIZE) { + if (rlp.rlim_cur != SWITCH_THREAD_STACKSIZE) { char buf[1024] = ""; int i = 0; - - fprintf(stderr, "Error: stacksize %d is too large: run ulimit -s %d from your shell before starting the application.\nauto-adjusting stack size for optimal performance...\n", - (int) (rlp.rlim_max / 1024), SWITCH_THREAD_STACKSIZE / 1024); + fprintf(stderr, "Error: stacksize %d is not optimal: run ulimit -s %d from your shell before starting the application.\nauto-adjusting stack size for optimal performance...\n", + (int) (rlp.rlim_cur / 1024), SWITCH_THREAD_STACKSIZE / 1024); memset(&rlp, 0, sizeof(rlp)); rlp.rlim_cur = SWITCH_THREAD_STACKSIZE;