]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Fixed how Asterisk destroys a dialog on channel hangup before invite receives a response.
authorDavid Vossel <dvossel@digium.com>
Thu, 26 Aug 2010 15:22:28 +0000 (15:22 +0000)
committerDavid Vossel <dvossel@digium.com>
Thu, 26 Aug 2010 15:22:28 +0000 (15:22 +0000)
commitc26e47f28979bc27268e0310fc7f7e441469d937
tree1f68b204f7aca2e6b36f30004912ef9fb09d9572
parent3550593f30f7fa99a99d31c0056e9e5a0e388296
Fixed how Asterisk destroys a dialog on channel hangup before invite receives a response.

If an ast_channel with a SIP tech pvt hangs up before the sip dialog gets a response
to its outgoing INVITE, Asterisk used to pretend_ack the INVITE.  This is not rfc
compliant and results in confusion at the other endpoint.  sip_pretend_ack will ack
and remove all the packets in the retransmit queue.  This means that the INVITE will
stop retransmitting, and that any response to that INVITE that comes after the pretend_ack
occurs will be ignored.

Instead of faking any sort of acknowledgement for an outgoing INVITE during an internal
hangup, we should let the protocol stack process the INVITE transaction and terminate
the dialog properly.  This is achieved by setting the PENDING_BYE flag.  When this flag
is used, once the dialog proceeds to an escapable state the transaction will either be
canceled with a SIP_CANCEL or completed followed immediately by a BYE.  Attempting to do
this any other way is incorrect.  If the endpoint is not responding to the INVITE request,
the INVITE must continue to be retransmitted until it times out which will result in the
dialog being destroyed.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@283690 65c4cc65-6c06-0410-ace0-fbb531ad65f3
channels/chan_sip.c