diff options
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 1b6d4e3e7..88e558046 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -12184,6 +12184,21 @@ static enum check_auth_result register_verify(struct sip_pvt *p, struct sockaddr ast_string_field_set(p, exten, name); build_contact(p); + if (req->ignore) { + /* Expires is a special case, where we only want to load the peer if this isn't a deregistration attempt */ + const char *expires = get_header(req, "Expires"); + int expire = atoi(expires); + + if (ast_strlen_zero(expires)) { /* No expires header; look in Contact */ + if ((expires = strcasestr(get_header(req, "Contact"), ";expires="))) { + expire = atoi(expires + 9); + } + } + if (!ast_strlen_zero(expires) && expire == 0) { + transmit_response_with_date(p, "200 OK", req); + return 0; + } + } peer = find_peer(name, NULL, TRUE, FINDPEERS, FALSE, 0); if (!(peer && ast_apply_ha(peer->ha, sin))) { /* Peer fails ACL check */ |