Merged revisions 122869 via svnmerge from
authorJoshua Colp <jcolp@digium.com>
Mon, 16 Jun 2008 12:09:54 +0000 (12:09 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 16 Jun 2008 12:09:54 +0000 (12:09 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r122869 | file | 2008-06-16 09:08:28 -0300 (Mon, 16 Jun 2008) | 6 lines

Don't send a BYE on a dialog that is already gone during a REFER.
(closes issue #12865)
Reported by: flefoll
Patches:
      chan_sip.c.br14.121495.patch-ALREADYGONE uploaded by flefoll (license 244)

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122870 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 81ea9e9..3bb56dc 100644 (file)
@@ -3132,7 +3132,7 @@ static int __sip_autodestruct(const void *data)
        if (p->owner) {
                ast_log(LOG_WARNING, "Autodestruct on dialog '%s' with owner in place (Method: %s)\n", p->callid, sip_methods[p->method].text);
                ast_queue_hangup_with_cause(p->owner, AST_CAUSE_PROTOCOL_ERROR);
        if (p->owner) {
                ast_log(LOG_WARNING, "Autodestruct on dialog '%s' with owner in place (Method: %s)\n", p->callid, sip_methods[p->method].text);
                ast_queue_hangup_with_cause(p->owner, AST_CAUSE_PROTOCOL_ERROR);
-       } else if (p->refer) {
+       } else if (p->refer && !p->alreadygone) {
                ast_debug(3, "Finally hanging up channel after transfer: %s\n", p->callid);
                transmit_request_with_auth(p, SIP_BYE, 0, XMIT_RELIABLE, 1);
                append_history(p, "ReferBYE", "Sending BYE on transferer call leg %s", p->callid);
                ast_debug(3, "Finally hanging up channel after transfer: %s\n", p->callid);
                transmit_request_with_auth(p, SIP_BYE, 0, XMIT_RELIABLE, 1);
                append_history(p, "ReferBYE", "Sending BYE on transferer call leg %s", p->callid);