[asterisk-commits] russell: branch russell/sla_updates r56276 - /team/russell/sla_updates/apps/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Feb 22 15:11:22 MST 2007


Author: russell
Date: Thu Feb 22 16:11:21 2007
New Revision: 56276

URL: http://svn.digium.com/view/asterisk?view=rev&rev=56276
Log:
fix another silly deadlock and add another place where ringing trunks need to
be reprocessed

Modified:
    team/russell/sla_updates/apps/app_meetme.c

Modified: team/russell/sla_updates/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/russell/sla_updates/apps/app_meetme.c?view=diff&rev=56276&r1=56275&r2=56276
==============================================================================
--- team/russell/sla_updates/apps/app_meetme.c (original)
+++ team/russell/sla_updates/apps/app_meetme.c Thu Feb 22 16:11:21 2007
@@ -1186,7 +1186,7 @@
 }
 
 static void sla_queue_event_full(enum sla_event_type type, 
-	struct sla_trunk_ref *trunk_ref, struct sla_station *station)
+	struct sla_trunk_ref *trunk_ref, struct sla_station *station, int lock)
 {
 	struct sla_event *event;
 
@@ -1196,6 +1196,11 @@
 	event->type = type;
 	event->trunk_ref = trunk_ref;
 	event->station = station;
+
+	if (!lock) {
+		AST_LIST_INSERT_TAIL(&sla.event_q, event, entry);
+		return;
+	}
 
 	ast_mutex_lock(&sla.lock);
 	AST_LIST_INSERT_TAIL(&sla.event_q, event, entry);
@@ -1203,9 +1208,14 @@
 	ast_mutex_unlock(&sla.lock);
 }
 
+static void sla_queue_event_nolock(enum sla_event_type type)
+{
+	sla_queue_event_full(type, NULL, NULL, 0);
+}
+
 static void sla_queue_event(enum sla_event_type type)
 {
-	sla_queue_event_full(type, NULL, NULL);
+	sla_queue_event_full(type, NULL, NULL, 1);
 }
 
 /*! \brief Queue a SLA event from the conference */
@@ -1239,7 +1249,7 @@
 		return;
 	}
 
-	sla_queue_event_full(type, trunk_ref, station);
+	sla_queue_event_full(type, trunk_ref, station, 1);
 }
 
 /* Decrement reference counts, as incremented by find_conf() */
@@ -3488,7 +3498,7 @@
 
 	/* queue reprocessing of ringing trunks */
 	if (change_made)
-		sla_queue_event(SLA_EVENT_RINGING_TRUNK);
+		sla_queue_event_nolock(SLA_EVENT_RINGING_TRUNK);
 
 	if (timeout == UINT_MAX)
 		return 0;
@@ -3865,6 +3875,7 @@
 	if (ringing_trunk) {
 		free(ringing_trunk);
 		pbx_builtin_setvar_helper(chan, "SLATRUNK_STATUS", "UNANSWERED");
+		sla_queue_event(SLA_EVENT_RINGING_TRUNK);
 	}
 
 	return 0;



More information about the asterisk-commits mailing list