diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 7cfe8867970bbf976c585c43e5239a51b2b8d100..396db2350c9955e15bc0878a932af5989fbbd608 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -22652,6 +22652,8 @@ static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct so
 	int debug = sip_debug_test_pvt(p);
 	const char *e;
 	int error = 0;
+	int oldmethod = p->method;
+	int acked = 0;
 
 	/* Get Method and Cseq */
 	cseq = get_header(req, "Cseq");
@@ -22827,7 +22829,7 @@ static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct so
 		if (seqno == p->pendinginvite) {
 			p->invitestate = INV_TERMINATED;
 			p->pendinginvite = 0;
-			__sip_ack(p, seqno, 1 /* response */, 0);
+			acked = __sip_ack(p, seqno, 1 /* response */, 0);
 			if (find_sdp(req)) {
 				if (process_sdp(p, req, SDP_T38_NONE))
 					return -1;
@@ -22836,9 +22838,13 @@ static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct so
 		} else if (p->glareinvite == seqno) {
 			/* handle ack for the 491 pending sent for glareinvite */
 			p->glareinvite = 0;
-			__sip_ack(p, seqno, 1, 0);
+			acked = __sip_ack(p, seqno, 1, 0);
+		}
+		if (!acked) {
+			/* Got an ACK that did not match anything. Ignore
+			 * silently and restore previous method */
+			p->method = oldmethod;
 		}
-		/* Got an ACK that we did not match. Ignore silently */
 		if (!p->lastinvite && ast_strlen_zero(p->randdata)) {
 			pvt_set_needdestroy(p, "unmatched ACK");
 		}