aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-12 18:32:38 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-12 18:32:38 +0000
commit08b69edd9a0735ed756d80115eb660cde4e3a866 (patch)
tree1a5e7f99ee1ec8933e9cc07463f5571e4aa37cc0
parent4fcf0a326c6e1d1b06f9df9fc5ae39655c224ba3 (diff)
Merged revisions 181769 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r181769 | mmichelson | 2009-03-12 13:30:58 -0500 (Thu, 12 Mar 2009) | 28 lines Merged revisions 181768 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r181768 | mmichelson | 2009-03-12 13:29:48 -0500 (Thu, 12 Mar 2009) | 22 lines Properly send a 487 on an INVITE we have not responded to if we receive a BYE. If we receive an INVITE from an endpoint and then later receive a BYE from that same endpoint before we have sent a final response for the INVITE, then we need to respond to the INVITE with a 487. There was logic in the code prior to this commit which seemed to exist solely to handle this situation, but there was one condition in an if statement which was incorrect. The only way we would send a 487 was if the sip_pvt had no owner channel. This made no sense since we created the owner channel when we received the INVITE, meaning that the majority of the time we would never send the 487. The 487 being sent should not rely on whether we have created a channel. Its delivery should be dependent on the current state of the initial INVITE transaction. With this commit, that logic is now correctly in place. (closes issue #14149) Reported by: legranjl Patches: 14149.patch uploaded by mmichelson (license 60) Tested by: legranjl ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@181770 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 5021ccd58..ae5b17271 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -18130,8 +18130,9 @@ static int handle_request_bye(struct sip_pvt *p, struct sip_request *req)
struct ast_channel *bridged_to;
/* If we have an INCOMING invite that we haven't answered, terminate that transaction */
- if (p->pendinginvite && !ast_test_flag(&p->flags[0], SIP_OUTGOING) && !req->ignore && !p->owner)
+ if (p->pendinginvite && !ast_test_flag(&p->flags[0], SIP_OUTGOING) && !req->ignore) {
transmit_response_reliable(p, "487 Request Terminated", &p->initreq);
+ }
__sip_pretend_ack(p);