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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 22 15:17:00 CST 2009


Author: mmichelson
Date: Tue Dec 22 15:16:58 2009
New Revision: 236143

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=236143
Log:
Fill in some information in sip CC monitor callbacks.


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=236143&r1=236142&r2=236143
==============================================================================
--- team/group/CCSS/channels/chan_sip.c (original)
+++ team/group/CCSS/channels/chan_sip.c Tue Dec 22 15:16:58 2009
@@ -3561,6 +3561,24 @@
 	ast_free(agent_pvt);
 }
 
+/* SIP CC monitors are a bit different from generic monitors. For a generic monitor, we can
+ * have a single device state subscription for the device. It's then up to the core to determine
+ * which agent to service when the device becomes available. With SIP, there are separate dialogs
+ * for each CC transaction being handled. The result is that if two CC requests are made to
+ * the same physical device, there will be a single ast_cc_monitor allocated. However there will
+ * be two SIP dialogs to keep up with for the two CC requests. The result of this is that whereas
+ * generic monitoring is very device-oriented, SIP monitoring is actually very call-oriented.
+ */
+
+struct sip_monitor_instance {
+	struct ast_cc_monitor *monitor;
+	int core_id;
+	struct sip_pvt *subscription_pvt;
+	struct sip_pvt *publish_pvt;
+	char subscribe_uri[SIPBUFSIZE];
+	char notify_uri[SIPBUFSIZE];
+};
+
 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);
@@ -3584,48 +3602,70 @@
 
 static int sip_cc_monitor_init(struct ast_cc_monitor *monitor, const int core_id)
 {
+	/* We don't really need to do anything here.
+	 */
+	return 0;
+}
+
+static int sip_cc_monitor_request_cc(struct ast_cc_monitor *monitor, const int core_id, struct ast_cc_monitor_link *parent_link)
+{
 	/* XXX STUB */
+	/* Find the appropriate sip_monitor_instance based on the given core_id.
+	 * Allocate the sip_monitor_instance subscription_pvt
+	 * Send a SUBSCRIBE to the subscribe_uri
+	 * Start the available timer using information from the parent link. 
+	 */
 	return 0;
 }
 
-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)
 {
 	/* XXX STUB */
+	/* Find the appropriate sip_monitor_instance based on the given core_id.
+	 * Allocate teh sip_monitor_instance publish_pvt
+	 * Send a PUBLISH to the notify_uri with PIDF state "closed"
+	 */
 	return 0;
 }
 
-static int sip_cc_monitor_suspend(struct ast_cc_monitor *monitor, const int core_id)
+static int sip_cc_monitor_status_response(struct ast_cc_monitor *monitor, const int core_id, enum ast_device_state devstate)
 {
 	/* XXX STUB */
+	/* This will never be called because the SIP monitor will never make a status request to
+	 * begin with
+	 */
 	return 0;
 }
 
-static int sip_cc_monitor_status_response(struct ast_cc_monitor *monitor, const int core_id, enum ast_device_state devstate)
+static int sip_cc_monitor_unsuspend(struct ast_cc_monitor *monitor, const int core_id)
 {
 	/* XXX STUB */
+	/* Find the appropriate sip_monitor_instance based on the given core_id.
+	 * assert that the publish_pvt is non-NULL
+	 * Send a PUBLISH to the notify_uri with PIDF state "open"
+	 */
 	return 0;
 }
 
-static int sip_cc_monitor_unsuspend(struct ast_cc_monitor *monitor, const int core_id)
+static int sip_cc_monitor_cancel_available_timer(struct ast_cc_monitor *monitor, const int core_id, int *sched_id)
 {
 	/* XXX STUB */
+	/* AST_SCHED_DEL using the given sched_id. */
 	return 0;
 }
 
-static int sip_cc_monitor_cancel_available_timer(struct ast_cc_monitor *monitor, const int core_id, int *sched_id)
+static void sip_cc_monitor_destructor(void *monitor)
 {
 	/* XXX STUB */
-	return 0;
-}
-
-static void sip_cc_monitor_destructor(void *monitor)
+	/* Nothing to do here. */
+}
+
+static void sip_cc_monitor_instance_destructor(const int core_id)
 {
 	/* XXX STUB */
-}
-
-static void sip_cc_monitor_instance_destructor(const int core_id)
-{
-	/* XXX STUB */
+	/* unref the subscription_pvt and publish_pvt if they exist. unlink the
+	 * sip_monitor_instance from the container.
+	 */
 }
 
 




More information about the asterisk-commits mailing list