From c88e03113f29661eeef908e6829e39ceb11b7e6e Mon Sep 17 00:00:00 2001
From: BJ Weschke <bweschke@btwtech.com>
Date: Sat, 4 Mar 2006 11:51:45 +0000
Subject: [PATCH] Merged revisions 11778 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r11778 | bweschke | 2006-03-04 06:45:37 -0500 (Sat, 04 Mar 2006) | 3 lines

 Substitute variables in the post_process string (if it exists) before those variables could possibly disappear (channel hangup) #6462


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@11779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 apps/app_mixmonitor.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/apps/app_mixmonitor.c b/apps/app_mixmonitor.c
index 52f1d0a8aa..69246192eb 100644
--- a/apps/app_mixmonitor.c
+++ b/apps/app_mixmonitor.c
@@ -217,6 +217,17 @@ static void *mixmonitor_thread(void *obj)
 	if (option_verbose > 1)
 		ast_verbose(VERBOSE_PREFIX_2 "Begin MixMonitor Recording %s\n", name);
 	
+	if (mixmonitor->post_process) {
+		char *p;
+
+		for (p = mixmonitor->post_process; *p ; p++) {
+			if (*p == '^' && *(p+1) == '{') {
+				*p = '$';
+			}
+		}
+		pbx_substitute_variables_helper(mixmonitor->chan, mixmonitor->post_process, post_process, sizeof(post_process) - 1);
+	}
+
 	while (1) {
 		struct ast_frame *next;
 		int write;
@@ -251,17 +262,6 @@ static void *mixmonitor_thread(void *obj)
 		ast_mutex_unlock(&spy.lock);
 	}
 	
-	if (mixmonitor->post_process) {
-		char *p;
-
-		for (p = mixmonitor->post_process; *p ; p++) {
-			if (*p == '^' && *(p+1) == '{') {
-				*p = '$';
-			}
-		}
-		pbx_substitute_variables_helper(mixmonitor->chan, mixmonitor->post_process, post_process, sizeof(post_process) - 1);
-	}
-
 	stopmon(mixmonitor->chan, &spy);
 
 	if (option_verbose > 1)
-- 
GitLab