Revision
15880
Author
anthm
Date
2009-12-10 15:53:23 -0600 (Thu, 10 Dec 2009)

Log Message

small regression from yesterday now that there are 2 queues only dec the flag that actually was in use

Modified Paths

Diff

Modified: freeswitch/trunk/src/switch_ivr.c (15879 => 15880)


--- freeswitch/trunk/src/switch_ivr.c	2009-12-10 21:41:44 UTC (rev 15879)
+++ freeswitch/trunk/src/switch_ivr.c	2009-12-10 21:53:23 UTC (rev 15880)
@@ -463,6 +463,7 @@
 	char *event_lock = switch_event_get_header(event, "event-lock");
 	char *event_lock_pri = switch_event_get_header(event, "event-lock-pri");
 	switch_status_t status = SWITCH_STATUS_FALSE;
+	int el = 0, elp = 0;
 
 	if (zstr(cmd)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Command!\n");
@@ -475,10 +476,12 @@
 
 	if (switch_true(event_lock)) {
 		switch_channel_set_flag_recursive(channel, CF_EVENT_LOCK);
+		el = 1;
 	}
 
 	if (switch_true(event_lock_pri)) {
 		switch_channel_set_flag_recursive(channel, CF_EVENT_LOCK_PRI);
+		elp = 1;
 	}
 
 	if (lead_frames) {
@@ -609,10 +612,17 @@
 	status = SWITCH_STATUS_SUCCESS;
 
   done:
+
 	switch_channel_clear_flag_recursive(channel, CF_EVENT_PARSE);
-	switch_channel_clear_flag_recursive(channel, CF_EVENT_LOCK);
-	switch_channel_clear_flag_recursive(channel, CF_EVENT_LOCK_PRI);
 
+	if (el) {
+		switch_channel_clear_flag_recursive(channel, CF_EVENT_LOCK);
+	}
+
+	if (elp) {
+		switch_channel_clear_flag_recursive(channel, CF_EVENT_LOCK_PRI);
+	}
+
 	return status;
 }