aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-24 18:26:50 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-24 18:26:50 +0000
commitf7111173898045b29c6a290d724bd9545f91f8ff (patch)
tree11b87d7ffc187d73cf0ec7cb9f77476b0787ea86
parenta39611a6f1fd3395c29d0bec30b50424d5bdf5f7 (diff)
Only send a BYE when hanging up a channel that is up.
For cases where Asterisk sends an INVITE and receives a non 2XX final response, Asterisk would follow the INVITE transaction by immediately sending a BYE, which was unnecessary. (closes issue #14575) Reported by: chris-mac git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@208587 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 890904908..52f4708fd 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -3726,7 +3726,9 @@ static int sip_hangup(struct ast_channel *ast)
if (p->vrtp)
videoqos = ast_rtp_get_quality(p->vrtp, NULL);
/* Send a hangup */
- transmit_request_with_auth(p, SIP_BYE, 0, XMIT_RELIABLE, 1);
+ if (oldowner->_state == AST_STATE_UP) {
+ transmit_request_with_auth(p, SIP_BYE, 0, XMIT_RELIABLE, 1);
+ }
/* Get RTCP quality before end of call */
if (!ast_test_flag(&p->flags[0], SIP_NO_HISTORY)) {