aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-12 22:39:55 +0000
committermnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-12 22:39:55 +0000
commit15f4e1405ba559f18668b1025e5623f4d6af8287 (patch)
treed4e6602071e1994241d136d6e50555b077351e15
parentf9b0c9a3c4f1ca7fc27624e17a7711db1c5910d5 (diff)
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 ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@211952 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 0959e20dd..df0e55255 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1550,7 +1550,8 @@ struct sip_registry {
enum sip_transport transport;
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 */
@@ -6447,7 +6448,8 @@ static int sip_register(const char *value, int lineno)
}
reg->transport = transport;
reg->expire = -1;
- reg->expiry = default_expiry;
+ reg->configured_expiry = default_expiry;
+ reg->expiry = reg->configured_expiry;
reg->timeout = -1;
reg->refresh = default_expiry;
reg->portno = portnum;
@@ -9705,6 +9707,7 @@ static int sip_reregister(const void *data)
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);
return 0;
@@ -15818,7 +15821,7 @@ static int handle_response_register(struct sip_pvt *p, int resp, char *rest, str
}
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;