diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 5efbfbf3493fb170602f8ad3738aea55adba3403..f7a0946ee7c8e868007a449ac460a711cd70b208 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -6492,7 +6492,7 @@ static int sip_hangup(struct ast_channel *ast)
 				stop_session_timer(p);
 			}
 
-			if (!p->pendinginvite) {
+			if (!p->pendinginvite || p->ongoing_reinvite) {
 				struct ast_channel *bridge = ast_bridged_channel(oldowner);
 				char quality_buf[AST_MAX_USER_FIELD], *quality;
 
@@ -12539,7 +12539,7 @@ static int transmit_reinvite_with_sdp(struct sip_pvt *p, int t38version, int old
 	initialize_initreq(p, &req);
 	p->lastinvite = p->ocseq;
 	ast_set_flag(&p->flags[0], SIP_OUTGOING);       /* Change direction of this dialog */
-
+	p->ongoing_reinvite = 1;
 	return send_request(p, &req, XMIT_CRITICAL, p->ocseq);
 }
 
@@ -21136,6 +21136,9 @@ static void handle_response_invite(struct sip_pvt *p, int resp, const char *rest
 	/* Final response, clear out pending invite */
 	if ((resp == 200 || resp >= 300) && p->pendinginvite && seqno == p->pendinginvite) {
 		p->pendinginvite = 0;
+		if (reinvite) {
+			p->ongoing_reinvite = 0;
+		}
 	}
 
 	/* If this is a response to our initial INVITE, we need to set what we can use
diff --git a/channels/sip/include/sip.h b/channels/sip/include/sip.h
index dbf572388537b140968331fcd0d558533fa2f147..d7555ba8de38e1866fe1fd8a94d0529863d96581 100644
--- a/channels/sip/include/sip.h
+++ b/channels/sip/include/sip.h
@@ -1127,6 +1127,7 @@ struct sip_pvt {
 	struct sip_auth_container *peerauth;/*!< Realm authentication credentials */
 	int noncecount;                     /*!< Nonce-count */
 	unsigned int stalenonce:1;          /*!< Marks the current nonce as responded too */
+	unsigned int ongoing_reinvite:1;    /*!< There is a reinvite in progress that might need to be cleaned up */
 	char lastmsg[256];                  /*!< Last Message sent/received */
 	int amaflags;                       /*!< AMA Flags */
 	uint32_t pendinginvite; /*!< Any pending INVITE or state NOTIFY (in subscribe pvt's) ? (seqno of this) */