From e119e0dad4a34e566ccbc17b0b5a5043fb75586b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 1 May 2007 01:26:30 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5051 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_console.h | 2 +- src/mod/endpoints/mod_alsa/mod_alsa.c | 10 ++++++++-- src/mod/endpoints/mod_portaudio/mod_portaudio.c | 9 +++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/include/switch_console.h b/src/include/switch_console.h index 0c81dc4577..156b9d83af 100644 --- a/src/include/switch_console.h +++ b/src/include/switch_console.h @@ -43,7 +43,7 @@ SWITCH_BEGIN_EXTERN_C #define SWITCH_CMD_CHUNK_LEN 1024 -#define SWITCH_STANDARD_STREAM(s) if ((s.data = malloc(SWITCH_CMD_CHUNK_LEN))) { \ +#define SWITCH_STANDARD_STREAM(s) memset(&s, 0, sizeof(s)); if ((s.data = malloc(SWITCH_CMD_CHUNK_LEN))) { \ memset(s.data, 0, SWITCH_CMD_CHUNK_LEN); \ s.end = s.data;\ s.data_size = SWITCH_CMD_CHUNK_LEN;\ diff --git a/src/mod/endpoints/mod_alsa/mod_alsa.c b/src/mod/endpoints/mod_alsa/mod_alsa.c index 537a22b412..87e0bf658e 100644 --- a/src/mod/endpoints/mod_alsa/mod_alsa.c +++ b/src/mod/endpoints/mod_alsa/mod_alsa.c @@ -1526,6 +1526,12 @@ static switch_status_t pa_cmd(char *cmd, switch_core_session_t *isession, switch int lead = 1, devval = 0; char *wcmd = NULL, *action = NULL; char cmd_buf[1024] = ""; + char *http = NULL; + + if (stream->event) { + http = switch_event_get_header(stream->event, "http-host"); + } + const char *usage_string = "USAGE:\n" "--------------------------------------------------------------------------------\n" @@ -1540,7 +1546,7 @@ static switch_status_t pa_cmd(char *cmd, switch_core_session_t *isession, switch "alsa flags [on|off] [ear] [mouth]\n" "--------------------------------------------------------------------------------\n"; - if (stream->event) { + if (http) { #if 0 switch_event_header_t *hp; stream->write_function(stream, "
");
@@ -1629,7 +1635,7 @@ static switch_status_t pa_cmd(char *cmd, switch_core_session_t *isession, switch
 
  done:
 
-	if (stream->event) {
+	if (http) {
 
 		stream->write_function(stream,
 							   "

\n" diff --git a/src/mod/endpoints/mod_portaudio/mod_portaudio.c b/src/mod/endpoints/mod_portaudio/mod_portaudio.c index 0c1e3d586b..0bf3e70d85 100644 --- a/src/mod/endpoints/mod_portaudio/mod_portaudio.c +++ b/src/mod/endpoints/mod_portaudio/mod_portaudio.c @@ -1722,6 +1722,7 @@ static switch_status_t pa_cmd(char *cmd, switch_core_session_t *isession, switch int lead = 1, devval = 0; char *wcmd = NULL, *action = NULL; char cmd_buf[1024] = ""; + char *http = NULL; const char *usage_string = "USAGE:\n" "--------------------------------------------------------------------------------\n" @@ -1739,8 +1740,12 @@ static switch_status_t pa_cmd(char *cmd, switch_core_session_t *isession, switch "pa outdev [#|\n" "pa ringdev [#|\n" "--------------------------------------------------------------------------------\n"; - if (stream->event) { + http = switch_event_get_header(stream->event, "http-host"); + } + + + if (http) { #if 0 switch_event_header_t *hp; stream->write_function(stream, "
");
@@ -1872,7 +1877,7 @@ static switch_status_t pa_cmd(char *cmd, switch_core_session_t *isession, switch
 
   done:
 
-	if (stream->event) {
+	if (http) {
 
 		stream->write_function(stream,
 							   "

\n"