aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-25 12:01:07 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-25 12:01:07 +0000
commit7f1e332eb9428c4544371f5f8e5bda06de35fae6 (patch)
tree099fe6a4d37cb4ae29f9a6cc9cf9b42c7c304c3a
parent54aaae07e59e3af3d72fb9a5227c8b30163b62b2 (diff)
From now on, apply maxexpiry and minexpiry to all subscriptions. Thanks to fourcheeze in the IRC channel
for pointing this out. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@8642 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c13
-rw-r--r--configs/sip.conf.sample4
2 files changed, 8 insertions, 9 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index f2ed1f6ce..3468659ca 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -10888,13 +10888,12 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
if (p && !ast_test_flag(p, SIP_NEEDDESTROY)) {
p->expiry = atoi(get_header(req, "Expires"));
- /* The next 4 lines can be removed if the SNOM Expires bug is fixed */
- if (p->subscribed == DIALOG_INFO_XML) {
- if (p->expiry > max_expiry)
- p->expiry = max_expiry;
- if (p->expiry < min_expiry)
- p->expiry = min_expiry;
- }
+ /* check if the requested expiry-time is within the approved limits from sip.conf */
+ if (p->expiry > max_expiry)
+ p->expiry = max_expiry;
+ if (p->expiry < min_expiry)
+ p->expiry = min_expiry;
+
if (sipdebug || option_debug > 1)
ast_log(LOG_DEBUG, "Adding subscription for extension %s context %s for peer %s\n", p->exten, p->context, p->username);
if (p->autokillid > -1)
diff --git a/configs/sip.conf.sample b/configs/sip.conf.sample
index da63b4d5e..aff02f9ff 100644
--- a/configs/sip.conf.sample
+++ b/configs/sip.conf.sample
@@ -58,8 +58,8 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
; SIP compatibility (defaults to "no")
;tos=184 ; Set IP QoS to either a keyword or numeric val
;tos=lowdelay ; lowdelay,throughput,reliability,mincost,none
-;maxexpiry=3600 ; Max length of incoming registration we allow
-;minexpiry=60 ; Minimum length of registration (default 60)
+;maxexpiry=3600 ; Max length of incoming registrations/subscriptions we allow (seconds)
+;minexpiry=60 ; Minimum length of registrations/subscriptions (default 60)
;defaultexpiry=120 ; Default length of incoming/outoing registration
;notifymimetype=text/plain ; Allow overriding of mime type in MWI NOTIFY
;checkmwi=10 ; Default time between mailbox checks for peers