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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Nov 24 17:25:57 CST 2009


Author: mmichelson
Date: Tue Nov 24 17:25:55 2009
New Revision: 231182

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=231182
Log:
Similar to the EPA callbacks, comment at a high level what to
do in the ESC callbacks for CC.

In doing so, I realized that the remove callback is unnecessary.


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=231182&r1=231181&r2=231182
==============================================================================
--- team/group/CCSS/channels/chan_sip.c (original)
+++ team/group/CCSS/channels/chan_sip.c Tue Nov 24 17:25:55 2009
@@ -1938,29 +1938,12 @@
 	const esc_publish_callback remove_handler;
 };
 
-/* These function are stubbed out for now since I'm focusing solely on PUBLISH support for now. When I go back and actually
- * implement the CC ESC, I'll fill these out with for-real logic :)
- */
-static int cc_esc_publish_initial_handler(struct sip_pvt *pvt, struct sip_request *req, struct event_state_compositor *esc, struct sip_esc_entry *esc_entry)
-{
-	/*XXX STUB */
-	return 0;
-}
-static int cc_esc_publish_modify_handler(struct sip_pvt *pvt, struct sip_request *req, struct event_state_compositor *esc, struct sip_esc_entry *esc_entry)
-{
-	/*XXX STUB */
-	return 0;
-}
-static int cc_esc_publish_remove_handler(struct sip_pvt *pvt, struct sip_request *req, struct event_state_compositor *esc, struct sip_esc_entry *esc_entry)
-{
-	/*XXX STUB */
-	return 0;
-}
+static int cc_esc_publish_initial_handler(struct sip_pvt *pvt, struct sip_request *req, struct event_state_compositor *esc, struct sip_esc_entry *esc_entry);
+static int cc_esc_publish_modify_handler(struct sip_pvt *pvt, struct sip_request *req, struct event_state_compositor *esc, struct sip_esc_entry *esc_entry);
 
 static const struct sip_esc_publish_callbacks cc_esc_publish_callbacks = {
 	.initial_handler = cc_esc_publish_initial_handler,
 	.modify_handler = cc_esc_publish_modify_handler,
-	.remove_handler = cc_esc_publish_remove_handler,
 };
 
 /*!
@@ -22876,6 +22859,21 @@
 	return SIP_PUBLISH_UNKNOWN;
 }
 
+static int cc_esc_publish_initial_handler(struct sip_pvt *pvt, struct sip_request *req, struct event_state_compositor *esc, struct sip_esc_entry *esc_entry)
+{
+	/*XXX STUB
+	 * An initial CC PUBLISH should be state "closed" but it is worth
+	 * checking the body of the request anyway just to be safe. Assuming
+	 * that the state is "closed" the appropriate action to take is to
+	 * call ast_cc_caller_busy. The CC core ID can be retrieved from the
+	 * event_specific_data of the esc_entry.
+	 *
+	 * If the initial state is "open" then we'll just store the state
+	 * and not take any specific action with regards to the CC core.
+	 */
+	return 0;
+}
+
 static int handle_sip_publish_initial(struct sip_pvt *p, struct sip_request *req, struct event_state_compositor *esc, const int expires)
 {
 	struct sip_esc_entry *esc_entry = create_esc_entry(esc, req, expires);
@@ -22924,6 +22922,21 @@
 
 	ao2_ref(esc_entry, -1);
 	return res;
+}
+
+static int cc_esc_publish_modify_handler(struct sip_pvt *pvt, struct sip_request *req, struct event_state_compositor *esc, struct sip_esc_entry *esc_entry)
+{
+	/*XXX STUB
+	 * 9 times out of 10, a modify PUBLISH will be changing the state from closed to open.
+	 * Of course it is very possible for either state to be present.
+	 *
+	 * If the modify is setting the state to closed, then we will call ast_cc_caller_busy.
+	 *
+	 * If the modify is setting the state to open, then we will call ast_cc_caller_available.
+	 *
+	 * Simple as that.
+	 */
+	return 0;
 }
 
 static int handle_sip_publish_modify(struct sip_pvt *p, struct sip_request *req, struct event_state_compositor *esc, const char * const etag, const int expires)




More information about the asterisk-commits mailing list