Merge branch 'master' of ssh://git.freeswitch.org:222/freeswitch

This commit is contained in:
Michael S Collins 2012-07-02 12:00:20 -07:00
commit 0db52e6e55
4 changed files with 29 additions and 6 deletions

View File

@ -1721,6 +1721,14 @@ SWITCH_STANDARD_API(lan_addr_function)
return SWITCH_STATUS_SUCCESS;
}
#include "switch_private.h"
#ifndef WIN32
#ifdef HAVE_SETRLIMIT
#include <sys/resource.h>
#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, "</b>\n");
}

View File

@ -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, "<uuid> <text>");
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)) {

View File

@ -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) {

View File

@ -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;