From f813ebe087b69ae97c1703f492d22266fb37f7a5 Mon Sep 17 00:00:00 2001 From: Brian West Date: Thu, 8 Jan 2009 17:36:32 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11099 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/applications/mod_conference/mod_conference.c | 7 +++++-- src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index ccff794d08..c7ba129aa7 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -3895,7 +3895,7 @@ SWITCH_STANDARD_API(conf_api_main) { char *lbuf = NULL; switch_status_t status = SWITCH_STATUS_SUCCESS; - char *http = NULL; + char *http = NULL, *type = NULL; int argc; char *argv[25] = { 0 }; @@ -3905,11 +3905,14 @@ SWITCH_STANDARD_API(conf_api_main) if (stream->param_event) { http = switch_event_get_header(stream->param_event, "http-host"); + type = switch_event_get_header(stream->param_event, "content-type"); } if (http) { /* Output must be to a web browser */ - stream->write_function(stream, "
\n");
+		if (type && !strcasecmp(type, "text/html")) {
+			stream->write_function(stream, "
\n");
+		}
 	}
 
 	if (!(lbuf = strdup(cmd))) {
diff --git a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
index 75eb176761..d2cfdd7de2 100644
--- a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
+++ b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
@@ -449,7 +449,7 @@ abyss_bool handler_hook(TSession * r)
 	char *fs_user = NULL, *fs_domain = NULL;
 	char *path_info = NULL;
 	abyss_bool ret = TRUE;
-	int html = 0, text = 0;
+	int html = 0, text = 0, xml = 0;
 
 	stream.data = r;
 	stream.write_function = http_stream_write;
@@ -467,6 +467,9 @@ abyss_bool handler_hook(TSession * r)
 	} else if ((command = strstr(r->requestInfo.uri, "/txtapi/"))) {
 		command += 8;
 		text++;
+	} else if ((command = strstr(r->requestInfo.uri, "/xmlapi/"))) {
+		command += 8;
+		xml++;
 	} else {
 		return FALSE;
 	}
@@ -529,6 +532,8 @@ abyss_bool handler_hook(TSession * r)
 			switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "Content-type", "text/html");
 		else if (text)
 			switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "Content-type", "text/plain");
+		else if (xml)
+			switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "Content-type", "text/xml");
 		if (fs_user)
 			switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "FreeSWITCH-User", fs_user);
 		if (fs_domain)