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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Nov 13 15:34:48 CST 2009


Author: mmichelson
Date: Fri Nov 13 15:34:45 2009
New Revision: 230142

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=230142
Log:
* Remove cc_epa_init and add a comment to create_epa_entry explaining why
* Add get_epa function


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=230142&r1=230141&r2=230142
==============================================================================
--- team/group/CCSS/channels/chan_sip.c (original)
+++ team/group/CCSS/channels/chan_sip.c Fri Nov 13 15:34:45 2009
@@ -1717,12 +1717,6 @@
 	return cc_entry1->core_id == cc_entry2->core_id ? CMP_MATCH | CMP_STOP : 0;
 }
 
-static int cc_epa_init(struct sip_epa_entry *epa_entry, struct sip_request *req)
-{
-	/* XXX STUB */
-	return 0;
-}
-
 static struct event_publication_agent {
 	enum subscriptiontype event;
 	const char *name;
@@ -1738,24 +1732,31 @@
 static struct sip_epa_entry *create_epa_entry(struct event_publication_agent *epa, struct sip_request *req)
 {
 	struct sip_epa_entry *epa_entry;
-	int res;
 
 	if (!(epa_entry = ao2_alloc(sizeof(*epa_entry), NULL))) {
 		return NULL;
 	}
 
 	epa_entry->event = epa->name;
-
-	switch (epa->event) {
-	case CALL_COMPLETION:
-		res = cc_epa_init(epa_entry, req);
-		break;
-	default:
-		break;
-	}
+	
+	/* We don't do any event-package-specific setup here because the necessary input
+	 * will not be present. It's up to the caller of create_epa_entry to initialize whatever
+	 * event-specific data they need. Note that this differs from the ESC, which is able
+	 * to get whatever it needs based on the content of the incoming SIP request.
+	 */
 
 	ao2_link(epa->entries, epa_entry);
 	return epa_entry;
+}
+
+static struct event_publication_agent *get_epa(const char * const event_package) {
+	int i;
+	for (i = 0; i < ARRAY_LEN(event_publication_agents); i++) {
+		if (!strcasecmp(event_package, event_publication_agents[i].name)) {
+			return &event_publication_agents[i];
+		}
+	}
+	return NULL;
 }
 
 static int initialize_epas(void)




More information about the asterisk-commits mailing list