[asterisk-commits] oej: branch oej/teapot-1.8 r414676 - in /team/oej/teapot-1.8: ./ channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 28 03:11:11 CDT 2014


Author: oej
Date: Wed May 28 03:11:06 2014
New Revision: 414676

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=414676
Log:
Reset, resolve and serve a nice cup of tea

Modified:
    team/oej/teapot-1.8/   (props changed)
    team/oej/teapot-1.8/channels/chan_sip.c

Propchange: team/oej/teapot-1.8/
------------------------------------------------------------------------------
    automerge = Is-there-life-off-net?

Propchange: team/oej/teapot-1.8/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed May 28 03:11:06 2014
@@ -1,1 +1,1 @@
-/branches/1.8:1-414612
+/branches/1.8:1-414675

Modified: team/oej/teapot-1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/channels/chan_sip.c?view=diff&rev=414676&r1=414675&r2=414676
==============================================================================
--- team/oej/teapot-1.8/channels/chan_sip.c (original)
+++ team/oej/teapot-1.8/channels/chan_sip.c Wed May 28 03:11:06 2014
@@ -6838,6 +6838,11 @@
 		start_rtcp_events(p, sched);
 		/* If we've agreed on CN for this channel, try activating silence detection and suppression on it */
 		activate_silence_detection(p);
+		/* RFC says the session timer starts counting on 200,
+		 * not on INVITE. */
+		if (p->stimer->st_active == TRUE) {
+			start_session_timer(p);
+		}
 	}
 	sip_pvt_unlock(p);
 	return res;
@@ -24221,12 +24226,8 @@
 		ast_party_redirecting_free(&redirecting);
 	}
 
-	if (p->stimer->st_active == TRUE) {
-		if (reinvite == 0) {
-			start_session_timer(p);
-		} else {
-			restart_session_timer(p);
-		}
+	if (reinvite && p->stimer->st_active == TRUE) {
+		restart_session_timer(p);
 	}
 
 	if (!req->ignore && p)
@@ -25244,7 +25245,9 @@
 	}
 
 	stop_media_flows(p); /* Immediately stop RTP, VRTP and UDPTL as applicable */
-	stop_session_timer(p); /* Stop Session-Timer */
+	if (p->stimer) {
+		stop_session_timer(p); /* Stop Session-Timer */
+	}
 
 	if (!ast_strlen_zero(get_header(req, "Also"))) {
 		ast_log(LOG_NOTICE, "Client '%s' using deprecated BYE/Also transfer method.  Ask vendor to support REFER instead\n",
@@ -27280,11 +27283,6 @@
 /*! \brief Session-Timers: Restart session timer */
 static void restart_session_timer(struct sip_pvt *p)
 {
-	if (!p->stimer) {
-		ast_log(LOG_WARNING, "Null stimer in restart_session_timer - %s\n", p->callid);
-		return;
-	}
-
 	if (p->stimer->st_active == TRUE) {
 		ast_debug(2, "Session timer stopped: %d - %s\n", p->stimer->st_schedid, p->callid);
 		AST_SCHED_DEL_UNREF(sched, p->stimer->st_schedid,
@@ -27297,11 +27295,6 @@
 /*! \brief Session-Timers: Stop session timer */
 static void stop_session_timer(struct sip_pvt *p)
 {
-	if (!p->stimer) {
-		ast_log(LOG_WARNING, "Null stimer in stop_session_timer - %s\n", p->callid);
-		return;
-	}
-
 	if (p->stimer->st_active == TRUE) {
 		p->stimer->st_active = FALSE;
 		ast_debug(2, "Session timer stopped: %d - %s\n", p->stimer->st_schedid, p->callid);
@@ -27315,11 +27308,6 @@
 static void start_session_timer(struct sip_pvt *p)
 {
 	unsigned int timeout_ms;
-
-	if (!p->stimer) {
-		ast_log(LOG_WARNING, "Null stimer in start_session_timer - %s\n", p->callid);
-		return;
-	}
 
 	if (p->stimer->st_schedid > -1) {
 		/* in the event a timer is already going, stop it */
@@ -27410,7 +27398,11 @@
 		/* An error occurred.  Stop session timer processing */
 		if (p->stimer) {
 			ast_debug(2, "Session timer stopped: %d - %s\n", p->stimer->st_schedid, p->callid);
+			/* Don't pass go, don't collect $200.. we are the scheduled
+			 * callback. We can rip ourself out here. */
 			p->stimer->st_schedid = -1;
+			/* Calling stop_session_timer is nice for consistent debug
+			 * logs. */
 			stop_session_timer(p);
 		}
 




More information about the asterisk-commits mailing list