[asterisk-commits] mmichelson: branch group/CCSS r229740 - /team/group/CCSS/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Nov 12 11:48:55 CST 2009


Author: mmichelson
Date: Thu Nov 12 11:48:51 2009
New Revision: 229740

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=229740
Log:
Fix some scheduler stuff with regards to SIP PUBLISH.


Modified:
    team/group/CCSS/channels/chan_sip.c

Modified: team/group/CCSS/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/channels/chan_sip.c?view=diff&rev=229740&r1=229739&r2=229740
==============================================================================
--- team/group/CCSS/channels/chan_sip.c (original)
+++ team/group/CCSS/channels/chan_sip.c Thu Nov 12 11:48:51 2009
@@ -1681,6 +1681,15 @@
 	 */
 	const char *device_name;
 	/*!
+	 * The event package for which this esc_entry
+	 * exists. Most of the time this isn't really
+	 * necessary since you'll have easy access to the
+	 * ESC which contains this entry. However, in
+	 * some circumstances, we won't have the ESC
+	 * available.
+	 */
+	const char *event;
+	/*!
 	 * The entity ID used when corresponding
 	 * with the EPA on the other side. As the
 	 * ESC, we generate an entity ID for each
@@ -1848,7 +1857,11 @@
 static int publish_expire(const void *data)
 {
 	struct sip_esc_entry *esc_entry = (struct sip_esc_entry *) data;
-	/* XXX Need to get the ESC and unlink the entry */
+	struct event_state_compositor *esc = get_esc(esc_entry->event);
+
+	ast_assert(esc != NULL);
+
+	ao2_unlink(esc->compositor, esc_entry);
 	ao2_ref(esc_entry, -1);
 	return 0;
 }
@@ -1863,7 +1876,7 @@
 		return NULL;
 	}
 
-	expires_ms = expires * 1000;
+	esc_entry->event = esc->name;
 
 	switch (esc->event) {
 	case CALL_COMPLETION:
@@ -1873,7 +1886,9 @@
 		break;
 	}
 
-	/* XXX Need to bump refcount here. Scheduler will have a reference */
+	expires_ms = expires * 1000;
+	/* Bump refcount for scheduler */
+	ao2_ref(esc_entry, +1);
 	esc_entry->sched_id = ast_sched_add(sched, expires_ms, publish_expire, esc_entry);
 
 	ao2_link(esc->compositor, esc_entry);




More information about the asterisk-commits mailing list