aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-04-15 20:34:28 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-04-15 20:34:28 +0000
commit9d39a834ea823f8fbea00fc5782e369bf74b454b (patch)
treeb294df4199b6c8830c13ea93cc9c156bd7cb3114
parent8ac8766f6561313991d9cc316c93f143a92ab74a (diff)
Merged revisions 257493 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r257493 | tilghman | 2010-04-15 15:30:15 -0500 (Thu, 15 Apr 2010) | 20 lines Merged revisions 257467 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r257467 | tilghman | 2010-04-15 15:24:50 -0500 (Thu, 15 Apr 2010) | 13 lines Don't recreate peer, when responding to a repeated deregistration attempt. When a reply to a deregistration is lost in transmit, the client retries the deregistration. Previously, this would cause a realtime/autocreate peer to be loaded back into memory, after it had already been correctly purged. Instead, we just want to resend the reply without loading the peer. (closes issue #16908) Reported by: kkm Patches: 20100412__issue16908.diff.txt uploaded by tilghman (license 14) Tested by: kkm ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@257507 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index e44be9f7d..8e37d98a6 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -11624,6 +11624,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, 1, 0, 0);
if (!(peer && ast_apply_ha(peer->ha, sin))) {
/* Peer fails ACL check */