diff --git a/channels/h323/ast_h323.cxx b/channels/h323/ast_h323.cxx
index e98592d7d052019a3ce846391d9326cae4e0dda7..c068389f8cab61b2a29e2525f6fc895bfc53c17b 100644
--- a/channels/h323/ast_h323.cxx
+++ b/channels/h323/ast_h323.cxx
@@ -2257,6 +2257,7 @@ void h323_end_point_create(void)
 {
 	channelsOpen = 0;
 	logstream = new PAsteriskLog();
+	PTrace::SetStream(logstream); 
 	endPoint = new MyH323EndPoint();
 }
 
@@ -2672,6 +2673,7 @@ void h323_end_process(void)
 	close(_timerChangePipe[1]);
 #endif
 	if (logstream) {
+		PTrace::SetStream(NULL);
 		delete logstream;
 		logstream = NULL;
 	}