aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-01-16 07:22:34 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-01-16 07:22:34 +0000
commit39a13656f91bd578b34e1296245d6ccc16d466b3 (patch)
tree491b782ab3c93aeceee57cd36ccd6060b4767bec /channels
parent19ee484e4490b4aff857471955d42831a261e49e (diff)
Avoid duplicate 200 OK
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4809 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_sip.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index d6f367e06..338e79b88 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -8002,13 +8002,14 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
found++;
}
- if (found)
+ if (found){
transmit_response(p, "200 OK", req);
- else {
+ ast_set_flag(p, SIP_NEEDDESTROY);
+ } else {
transmit_response(p, "403 Forbidden", req);
ast_set_flag(p, SIP_NEEDDESTROY);
}
-
+ return 0;
} else
p->subscribed = 1;
if (p->subscribed)
@@ -8022,14 +8023,14 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
p->lastinvite = seqno;
if (p && !ast_test_flag(p, SIP_NEEDDESTROY)) {
if (!(p->expiry = atoi(get_header(req, "Expires")))) {
- transmit_response(p, "200 OK", req);
- ast_set_flag(p, SIP_NEEDDESTROY);
- return 0;
+ transmit_response(p, "200 OK", req);
+ ast_set_flag(p, SIP_NEEDDESTROY);
+ return 0;
}
/* The next line can be removed if the SNOM200 Expires bug is fixed */
if (p->subscribed == 1) {
- if (p->expiry>max_expiry)
- p->expiry = max_expiry;
+ if (p->expiry>max_expiry)
+ p->expiry = max_expiry;
}
transmit_response(p, "200 OK", req);
sip_scheddestroy(p, (p->expiry+10)*1000);