diff --git a/include/asterisk/core_unreal.h b/include/asterisk/core_unreal.h
index a28d39d..4249db3 100644
--- a/include/asterisk/core_unreal.h
+++ b/include/asterisk/core_unreal.h
@@ -98,6 +98,7 @@ struct ast_unreal_pvt {
 	/*! Base name of the unreal channels.  exten@context or other name. */
 	char name[AST_MAX_EXTENSION + AST_MAX_CONTEXT + 2];
 	struct ast_stream_topology *reqtopology;    /*!< Requested stream topology */
+	struct ast_stream_topology *oldtopology[2]; /*!< Stored topologies for both local pairs */
 };
 
 #define AST_UNREAL_IS_OUTBOUND(a, b) ((a) == (b)->chan ? 1 : 0)
diff --git a/main/core_unreal.c b/main/core_unreal.c
index bff1c3e..818e638 100644
--- a/main/core_unreal.c
+++ b/main/core_unreal.c
@@ -41,6 +41,7 @@
 #include "asterisk/bridge.h"
 #include "asterisk/core_unreal.h"
 #include "asterisk/stream.h"
+#include "asterisk/core_local.h"
 
 static unsigned int name_sequence = 0;
 
@@ -623,6 +624,8 @@ int ast_unreal_indicate(struct ast_channel *ast, int condition, const void *data
 {
 	struct ast_unreal_pvt *p = ast_channel_tech_pvt(ast);
 	int res = 0;
+	struct ast_channel *local_peer;
+	const struct ast_control_t38_parameters *parameters;
 
 	if (!p) {
 		return -1;
@@ -677,6 +680,65 @@ int ast_unreal_indicate(struct ast_channel *ast, int condition, const void *data
 			res = unreal_colp_stream_topology_request_change(p, ast, data);
 		}
 		break;
+       case AST_CONTROL_T38_PARAMETERS:
+		parameters = data;
+		local_peer = ast_local_get_peer(ast);
+		if (parameters->request_response == AST_T38_NEGOTIATED) {
+			struct ast_stream *stream;
+			struct ast_stream_topology *new_topology;
+
+			stream = ast_stream_alloc("local_fax", AST_MEDIA_TYPE_IMAGE);
+			if (!stream) {
+				ast_log(LOG_ERROR, "Failed to allocate memory for stream.\n");
+				res = -1;
+				ast_channel_unref(local_peer);
+				break;
+			}
+			new_topology = ast_stream_topology_alloc();
+			if (!new_topology) {
+				ast_log(LOG_ERROR, "Failed to allocate memory for stream topology.\n");
+				res = -1;
+				ast_channel_unref(local_peer);
+				break;
+			}
+			ast_stream_topology_append_stream(new_topology, stream);
+
+			/* Lock both parts of the local channel so we can store their topologies and replace them with
+			 * one that has a stream with type IMAGE. We can just hold the reference on the unreal_pvt
+			 * structure and bump it, then steal the ref later when we are restoring the topology. */
+			ao2_lock(ast);
+			ao2_lock(local_peer);
+
+			p->oldtopology[0] = ao2_bump(ast_channel_get_stream_topology(ast));
+			p->oldtopology[1] = ao2_bump(ast_channel_get_stream_topology(local_peer));
+
+			/* Bump the ref for new_topology, since it will be used by both local pairs. This way, when
+			 * we are restoring the stream topologies and ast_channel_set_stream_topology is called for
+			 * both local pairs, the topology will be correctly unref'd.
+			 */
+			ao2_ref(new_topology, +1);
+
+			ast_channel_set_stream_topology(ast, new_topology);
+			ast_channel_set_stream_topology(local_peer, new_topology);
+
+			ao2_unlock(local_peer);
+			ao2_unlock(ast);
+		} else if (parameters->request_response == AST_T38_TERMINATED) {
+			/* Lock both parts of the local channel so we can restore their topologies to the original.
+			 * The topology should be on the unreal_pvt structure, with a ref that we can steal. */
+			ao2_lock(ast);
+			ao2_lock(local_peer);
+
+			ast_channel_set_stream_topology(ast, p->oldtopology[0]);
+			ast_channel_set_stream_topology(local_peer, p->oldtopology[1]);
+
+			p->oldtopology[0] = NULL;
+			p->oldtopology[1] = NULL;
+
+			ao2_unlock(local_peer);
+			ao2_unlock(ast);
+		}
+		ast_channel_unref(local_peer);
 	default:
 		res = unreal_queue_indicate(p, ast, condition, data, datalen);
 		break;
@@ -1012,6 +1074,8 @@ void ast_unreal_destructor(void *vdoomed)
 	doomed->reqcap = NULL;
 	ast_stream_topology_free(doomed->reqtopology);
 	doomed->reqtopology = NULL;
+	ao2_cleanup(doomed->oldtopology[0]);
+	ao2_cleanup(doomed->oldtopology[1]);
 }
 
 struct ast_unreal_pvt *ast_unreal_alloc(size_t size, ao2_destructor_fn destructor, struct ast_format_cap *cap)
