diff options
author | Jenkins2 <jenkins2@gerrit.asterisk.org> | 2017-10-25 07:59:22 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-10-25 07:59:22 -0500 |
commit | aa1c969942e9e209790e3e2093308e287595bffe (patch) | |
tree | 8d5a7a63111a0fbc08f6988eb414fe6529321494 | |
parent | b78d63c45ea02b1466222c4631c6e5ecd48e2248 (diff) | |
parent | c75a7351bd882cb230843351dd4d3262402a3e26 (diff) |
Merge "chan_sip: Fix SUBSCRIBE with missing "Expires" header." into 15
-rw-r--r-- | channels/chan_sip.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 8833e7111..cdd78fd7e 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -28511,7 +28511,13 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req, p->lastinvite = seqno; } if (!p->needdestroy) { - p->expiry = atoi(sip_get_header(req, "Expires")); + const char *expires_str = sip_get_header(req, "Expires"); + + if (ast_strlen_zero(expires_str)) { + p->expiry = default_expiry; + } else { + p->expiry = atoi(expires_str); + } /* check if the requested expiry-time is within the approved limits from sip.conf */ if (p->expiry > max_subexpiry) { |