[svn-commits] irroot: trunk r322323 - in /trunk: ./ channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Jun 8 01:46:01 CDT 2011


Author: irroot
Date: Wed Jun  8 01:45:55 2011
New Revision: 322323

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=322323
Log:
Merged revisions 322322 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r322322 | irroot | 2011-06-08 08:18:38 +0200 (Wed, 08 Jun 2011) | 18 lines
  
    Make handle_request_publish do dialog expiration and destruction.
  
    This patch fixes handle_request_publish so that it does dialog expiration and destruction.
  
    Without this patch the incoming PUBLISH requests will get stuck in the dialog list.
    Restarting asterisk is the only way to remove them.
  
    Personal observation on one system the server hung up while looping through the channels
    rendering asterisk unusable and all sip phones unregisterd when they try reregister
    more requests are added.
  
    (closes issue #18898)
    Reported by: gareth
    Tested by: loloski, Chainsaw, wimpy, se, kuj, irroot
  
    Jira: https://issues.asterisk.org/jira/browse/ASTERISK-17915
    Review: https://reviewboard.asterisk.org/r/1253
........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=322323&r1=322322&r2=322323
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Wed Jun  8 01:45:55 2011
@@ -24092,11 +24092,13 @@
 
 	if (ast_strlen_zero(event)) {
 		transmit_response(p, "489 Bad Event", req);
+		pvt_set_needdestroy(p, "missing Event: header");
 		return -1;
 	}
 
 	if (!(esc = get_esc(event))) {
 		transmit_response(p, "489 Bad Event", req);
+		pvt_set_needdestroy(p, "unknown event package in publish");
 		return -1;
 	}
 
@@ -24121,6 +24123,15 @@
 	}
 
 	publish_type = determine_sip_publish_type(req, event, etag, expires_str, &expires_int);
+
+	if (expires_int > max_expiry) {
+		expires_int = max_expiry;
+	} else if (expires_int < min_expiry && expires_int > 0) {
+		transmit_response_with_minexpires(p, "423 Interval too small", req);
+		pvt_set_needdestroy(p, "Expires is less that the min expires allowed.");
+		return 0;
+	}
+	p->expiry = expires_int;
 
 	/* It is the responsibility of these handlers to formulate any response
 	 * sent for a PUBLISH
@@ -24145,6 +24156,11 @@
 		transmit_response(p, "400 Impossible Condition", req);
 		break;
 	}
+	if (!handler_result && p->expiry > 0) {
+		sip_scheddestroy(p, (p->expiry + 10) * 1000);
+	} else {
+		pvt_set_needdestroy(p, "forcing expiration");
+	}
 
 	return handler_result;
 }
@@ -24527,8 +24543,7 @@
 			ast_log(LOG_WARNING, "Received subscription for extension \"%s\" context \"%s\" "
 				"with Expire header less that 'minexpire' limit. Received \"Expire: %d\" min is %d\n",
 				p->exten, p->context, p->expiry, min_expiry);
-			p->expiry = min_expiry;
-			pvt_set_needdestroy(p, "Expires is less that the min expires allowed. ");
+			pvt_set_needdestroy(p, "Expires is less that the min expires allowed.");
 			return 0;
 		}
 




More information about the svn-commits mailing list