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

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Nov 24 17:00:22 CST 2009


Author: mmichelson
Date: Tue Nov 24 17:00:20 2009
New Revision: 231181

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=231181
Log:
Place comments in CC EPA callbacks.

Since there is no CC implementation in place in chan_sip
yet, I can't place code in the stubs. However, since I have
a good idea how the code will function at a high level, I
can comment about how the code will work.


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=231181&r1=231180&r2=231181
==============================================================================
--- team/group/CCSS/channels/chan_sip.c (original)
+++ team/group/CCSS/channels/chan_sip.c Tue Nov 24 17:00:20 2009
@@ -1771,14 +1771,8 @@
 	return 0;
 }
 
-static void cc_handle_ok(struct sip_pvt *pvt, struct sip_request *req, struct sip_epa_entry *epa_entry)
-{
-	/* XXX STUB */
-}
-static void cc_handle_error(struct sip_pvt *pvt, const int resp, struct sip_request *req, struct sip_epa_entry *epa_entry)
-{
-	/* XXX STUB */
-}
+static void cc_handle_ok(struct sip_pvt *pvt, struct sip_request *req, struct sip_epa_entry *epa_entry);
+static void cc_handle_error(struct sip_pvt *pvt, const int resp, struct sip_request *req, struct sip_epa_entry *epa_entry);
 
 static const struct epa_static_data cc_epa_static_data  = {
 	.event = CALL_COMPLETION,
@@ -18944,6 +18938,35 @@
 	if ((p->authtries == MAX_AUTHTRIES) || do_proxy_auth(p, req, resp, SIP_UPDATE, 1)) {
 		ast_log(LOG_NOTICE, "Failed to authenticate on UPDATE to '%s'\n", get_header(&p->initreq, "From"));
 	}
+}
+
+static void cc_handle_ok(struct sip_pvt *pvt, struct sip_request *req, struct sip_epa_entry *epa_entry)
+{
+	/* XXX STUB 
+	 *
+	 * Really, this function doesn't need to do anything. The CC core calls its suspend callback
+	 * and does not await any sort of response from the monitor. It is assumed that all went well.
+	 */
+}
+
+static void cc_handle_error(struct sip_pvt *pvt, const int resp, struct sip_request *req, struct sip_epa_entry *epa_entry)
+{
+	/* XXX STUB
+	 *
+	 * Here, things can be a bit interesting. Most error responses will result in our calling
+	 * ast_cc_monitor_failed, however, there are some exceptions.
+	 *
+	 * For instance, if we get a 423 Interval Too Brief response, we'll try sending another
+	 * PUBLISH with a larger Expires time. Of course, anyone who claims that 3600 seconds is
+	 * too brief is a jerk with no shoes.
+	 *
+	 * That's the only erroneous response I can think of that will not warrant a call to
+	 * ast_cc_monitor failed. Of course, 401 and 407 are both handled by the function that
+	 * calls this one, so we don't have to special case those.
+	 *
+	 * Once we've determined that we are going to call ast_cc_monitor_failed, we can get
+	 * the core ID of the CC transaction from the epa_entry->instance_data.
+	 */
 }
 
 static void handle_response_publish(struct sip_pvt *p, int resp, const char *rest, struct sip_request *req, int seqno)




More information about the svn-commits mailing list