[svn-commits] mnicholson: branch 1.6.2 r211951 - in /branches/1.6.2: ./ channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Aug 12 17:38:42 CDT 2009


Author: mnicholson
Date: Wed Aug 12 17:38:37 2009
New Revision: 211951

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=211951
Log:
Merged revisions 211876 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r211876 | mnicholson | 2009-08-12 14:53:14 -0500 (Wed, 12 Aug 2009) | 11 lines
  
  Make asterisk handle 423 Interval Too Short messages better.
  
  This change uses separate values for the acceptable minimum expiry provided by the 423 error and the expiry value stored in the configuration file.  Previously, the value pulled from the configuration file would be overwritten.
  
  (closes issue #14366)
  Reported by: Nick_Lewis
  Patches:
        sip-expiry-fix1.diff uploaded by mnicholson (license 96)
        chan_sip.c-reqexpiry.patch uploaded by Nick (license 657)
  Tested by: mnicholson
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/channels/chan_sip.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.2/channels/chan_sip.c?view=diff&rev=211951&r1=211950&r2=211951
==============================================================================
--- branches/1.6.2/channels/chan_sip.c (original)
+++ branches/1.6.2/channels/chan_sip.c Wed Aug 12 17:38:37 2009
@@ -1926,7 +1926,8 @@
 	enum sip_transport transport;	/*!< Transport for this registration UDP, TCP or TLS */
 	int portno;			/*!<  Optional port override */
 	int expire;			/*!< Sched ID of expiration */
-	int expiry;			/*!< Value to use for the Expires header */
+	int configured_expiry;		/*!< Configured value to use for the Expires header */
+	int expiry;			/*!< Negotiated value used for the Expires header */
 	int regattempts;		/*!< Number of attempts (since the last success) */
 	int timeout; 			/*!< sched id of sip_reg_timeout */
 	int refresh;			/*!< How often to refresh */
@@ -7172,7 +7173,8 @@
 	}
 	reg->transport = transport;
 	reg->expire = -1;
-	reg->expiry = (expire ? atoi(expire) : default_expiry);
+	reg->configured_expiry = (expire ? atoi(expire) : default_expiry);
+	reg->expiry = reg->configured_expiry;
 	reg->timeout =  -1;
 	reg->refresh = reg->expiry;
 	reg->portno = portnum;
@@ -10848,6 +10850,7 @@
 		ast_log(LOG_NOTICE, "   -- Re-registration for  %s@%s\n", r->username, r->hostname);
 
 	r->expire = -1;
+	r->expiry = r->configured_expiry;
 	__sip_do_register(r);
 	registry_unref(r, "unref the re-register scheduled event");
 	return 0;
@@ -17458,7 +17461,7 @@
 		}
 		if (r->expiry > max_expiry) {
 			ast_log(LOG_WARNING, "Required expiration time from %s@%s is too high, giving up\n", p->registry->username, p->registry->hostname);
-			r->expiry = default_expiry;
+			r->expiry = r->configured_expiry;
 			r->regstate = REG_STATE_REJECTED;
 		} else {
 			r->regstate = REG_STATE_UNREGISTERED;




More information about the svn-commits mailing list