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

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Dec 28 15:33:43 CST 2009


Author: mmichelson
Date: Mon Dec 28 15:33:41 2009
New Revision: 236712

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=236712
Log:
First part of handling CC NOTIFY requests.


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=236712&r1=236711&r2=236712
==============================================================================
--- team/group/CCSS/channels/chan_sip.c (original)
+++ team/group/CCSS/channels/chan_sip.c Mon Dec 28 15:33:41 2009
@@ -3647,6 +3647,12 @@
 	return ao2_find(sip_monitor_instances, &finder, OBJ_POINTER);
 }
 
+static int find_sip_monitor_instance_by_subscription_pvt(void *obj, void *arg, int flags)
+{
+	struct sip_monitor_instance *monitor_instance = obj;
+	return monitor_instance->subscription_pvt == arg ? CMP_MATCH | CMP_STOP : 0;
+}
+
 static int sip_cc_monitor_init(struct ast_cc_monitor *monitor, const int core_id);
 static int sip_cc_monitor_request_cc(struct ast_cc_monitor *monitor, const int core_id, struct ast_cc_monitor_link *parent_link);
 static int sip_cc_monitor_suspend(struct ast_cc_monitor *monitor, const int core_id);
@@ -21275,6 +21281,28 @@
 	return NULL;
 }
 
+static int handle_cc_notify(struct sip_pvt *pvt, struct sip_request *req)
+{
+	/* Let's map this out
+	 *
+	 * We need to find the appropriate sip_monitor_instance. Unfortunately, we don't have
+	 * a core_id. We'll have to do a bit of an ao2_callback using the sip_pvt in order
+	 * to do this correctly.
+	 *
+	 * After finding the sip_monitor_instance, we can then check the body to find whether
+	 * the status is "queued" or "ready" and act accordingly
+	 */
+	struct sip_monitor_instance *monitor_instance = ao2_callback(sip_monitor_instances, 0,
+			find_sip_monitor_instance_by_subscription_pvt, pvt);
+
+	if (!monitor_instance) {
+		return -1;
+	}
+	
+	/* XXX STUB */
+	return 0;
+}
+
 /*! \brief Handle incoming notifications */
 static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int seqno, const char *e)
 {
@@ -21437,6 +21465,8 @@
 		 /* Used by Sipura/Linksys for NAT pinhole,
 		  * just confirm that we recieved the packet. */
 		transmit_response(p, "200 OK", req);
+	} else if (!strcmp(event, "call-completion")) {
+		res = handle_cc_notify(p, req);
 	} else {
 		/* We don't understand this event. */
 		transmit_response(p, "489 Bad event", req);




More information about the svn-commits mailing list