]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
don't send a 200 ACK before a 404 on invalid subscriptions (Bug #5198)
authorJosh Roberson <josh@asteriasgi.com>
Tue, 13 Sep 2005 01:38:00 +0000 (01:38 +0000)
committerJosh Roberson <josh@asteriasgi.com>
Tue, 13 Sep 2005 01:38:00 +0000 (01:38 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6565 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 769e67ebdc67a2af623131ddd670f607f29e3a32..9040def6fb9fd88f208fe20418f9a67b55b2cb2c 100755 (executable)
@@ -10213,7 +10213,6 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
                }
                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);
-               transmit_response(p, "200 OK", req);
                if (p->autokillid > -1)
                        sip_cancel_destroy(p);  /* Remove subscription expiry for renewals */
                sip_scheddestroy(p, (p->expiry + 10) * 1000);   /* Set timer for destruction of call at expiration */
@@ -10224,6 +10223,7 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
                        ast_set_flag(p, SIP_NEEDDESTROY);       
                        return 0;
                } else {
+                       transmit_response(p, "200 OK", req);
                        transmit_state_notify(p, firststate, 1, 1);     /* Send first notification */
                        append_history(p, "Subscribestatus", ast_extension_state2str(firststate));
                }