[svn-commits] mmichelson: branch 1.4 r181768 - /branches/1.4/channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Mar 12 13:29:57 CDT 2009


Author: mmichelson
Date: Thu Mar 12 13:29:48 2009
New Revision: 181768

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=181768
Log:
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


Modified:
    branches/1.4/channels/chan_sip.c

Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.4/channels/chan_sip.c?view=diff&rev=181768&r1=181767&r2=181768
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Thu Mar 12 13:29:48 2009
@@ -15427,7 +15427,7 @@
 	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) && !ast_test_flag(req, SIP_PKT_IGNORE) && !p->owner) 
+	if (p->pendinginvite && !ast_test_flag(&p->flags[0], SIP_OUTGOING) && !ast_test_flag(req, SIP_PKT_IGNORE)) 
 		transmit_response_reliable(p, "487 Request Terminated", &p->initreq);
 
 	__sip_pretend_ack(p);




More information about the svn-commits mailing list