diff --git a/src/mod/endpoints/mod_portaudio/mod_portaudio.c b/src/mod/endpoints/mod_portaudio/mod_portaudio.c index 824511c6be..1eefd74dc8 100644 --- a/src/mod/endpoints/mod_portaudio/mod_portaudio.c +++ b/src/mod/endpoints/mod_portaudio/mod_portaudio.c @@ -800,7 +800,7 @@ static switch_status_t place_call(char *dest, switch_stream_handle_t *stream) switch_status_t status = SWITCH_STATUS_FALSE; if (!dest) { - strncpy(out, "Usage: pacall <exten>", outlen - 1); + stream->write_function(stream, "Usage: pacall <exten>"); return SWITCH_STATUS_FALSE; } @@ -957,7 +957,7 @@ static switch_status_t call_info(char *callid, switch_stream_handle_t *stream) print_info(tech_pvt, stream); } } else if (callid && (tech_pvt = switch_core_hash_find(globals.call_hash, callid)) != 0) { - print_info(tech_pvt, out, outlen); + print_info(tech_pvt, stream); } else { stream->write_function(stream, "NO SUCH CALL"); } diff --git a/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c b/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c index c4d6cea030..c0d2a63d5b 100644 --- a/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c +++ b/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c @@ -222,7 +222,8 @@ static int on_msg(void *user_data, ikspak * pak) { char *cmd = iks_find_cdata(pak->x, "body"); char *arg = NULL; - char retbuf[1024] = ""; + switch_stream_handle_t stream = {0}; + char retbuf[2048] = ""; char *p; if ((p = strchr(cmd, '\r')) != 0) { @@ -235,7 +236,10 @@ static int on_msg(void *user_data, ikspak * pak) *arg++ = '\0'; } - switch_api_execute(cmd, arg, retbuf, sizeof(retbuf)); + stream.data = retbuf; + stream.end = stream.data; + stream.data_size = sizeof(retbuf); + switch_api_execute(cmd, arg, &stream); return 0; }