[svn-commits] mmichelson: branch group/CCSS r229959 - /team/group/CCSS/channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Nov 13 10:58:46 CST 2009


Author: mmichelson
Date: Fri Nov 13 10:58:42 2009
New Revision: 229959

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=229959
Log:
Some initial work towards SIP EPA stuff.

Also fixed a compile issue due to a variable whose
name I forgot to change.


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=229959&r1=229958&r2=229959
==============================================================================
--- team/group/CCSS/channels/chan_sip.c (original)
+++ team/group/CCSS/channels/chan_sip.c Fri Nov 13 10:58:42 2009
@@ -1649,6 +1649,49 @@
 	enum referstatus status;			/*!< REFER status */
 };
 
+const int EPA_MAX_BUCKETS = 37;
+
+struct sip_epa_callbacks {
+	/*XXX STUB */
+};
+
+static int cc_epa_hash_fn(const void *obj, const int flags)
+{
+	/*XXX STUB */
+	return 0;
+}
+
+static int cc_epa_cmp_fn(void *obj, void *arg, int flags)
+{
+	/*XXX STUB*/
+	return 0;
+}
+
+static struct event_publication_agent {
+	enum subscriptiontype event;
+	const char *name;
+	struct ao2_container *entries;
+	struct sip_epa_callbacks *callbacks;
+	ao2_hash_fn *hash_fn;
+	ao2_callback_fn *cmp_fn;
+} event_publication_agents [] = {
+	{.event = CALL_COMPLETION, .name = "call-completion",
+	 .hash_fn = cc_epa_hash_fn, .cmp_fn = cc_epa_cmp_fn,},
+};
+
+static int initialize_epas(void)
+{
+	int i, res = 0;
+	for (i = 0; i < ARRAY_LEN(event_publication_agents); i++) {
+		if (!((event_publication_agents[i].entries) = ao2_container_alloc(EPA_MAX_BUCKETS, 
+				event_publication_agents[i].hash_fn, 
+				event_publication_agents[i].cmp_fn))) {
+			res = -1;
+		}
+	}
+	return res;
+}
+
 /*!
  * Used to create new entity IDs by ESCs.
  */
@@ -22673,7 +22716,7 @@
 	auth_result = check_user(p, req, SIP_PUBLISH, uri, XMIT_RELIABLE, sin);
 	if (auth_result == AUTH_CHALLENGE_SENT) {
 		return 0;
-	} else if (res < 0) {
+	} else if (auth_result < 0) {
 		if (auth_result == AUTH_FAKE_AUTH) {
 			ast_log(LOG_NOTICE, "Sending fake auth rejection for device %s\n", get_header(req, "From"));
 			transmit_fake_auth_response(p, SIP_INVITE, req, XMIT_RELIABLE);
@@ -27427,6 +27470,7 @@
 	sip_send_all_registers();
 	sip_send_all_mwi_subscriptions();
 	initialize_escs();
+	initialize_epas();
 
 	/* And start the monitor for the first time */
 	restart_monitor();




More information about the svn-commits mailing list