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, "