提交 7ed7f539 authored 作者: Anthony Minessale's avatar Anthony Minessale

add optional format string after myevent

上级 ef2f87de
......@@ -1883,11 +1883,30 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
char *uuid;
if ((uuid = cmd + 9)) {
char *fmt;
strip_cr(uuid);
if ((fmt = strchr(uuid, ' '))) {
*fmt++ = '\0';
}
if (!(listener->session = switch_core_session_locate(uuid))) {
switch_snprintf(reply, reply_len, "-ERR invalid uuid");
goto done;
if (fmt) {
switch_snprintf(reply, reply_len, "-ERR invalid uuid");
goto done;
} else {
fmt = uuid;
}
}
if ((fmt = strchr(uuid, ' '))) {
if (!strcasecmp(fmt, "xml")) {
listener->format = EVENT_FORMAT_XML;
} else if (!strcasecmp(fmt, "plain")) {
listener->format = EVENT_FORMAT_PLAIN;
} else if (!strcasecmp(fmt, "json")) {
listener->format = EVENT_FORMAT_JSON;
}
}
switch_set_flag_locked(listener, LFLAG_SESSION);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论