diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index a52e168210a8d0d19479cad0f0c831a663bd9e1a..64165edb0058e5daf9a6a671e059bd7e4023b609 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -5759,8 +5759,6 @@ static void __expire_registry(void *data)
 	ast_log(LOG_DEBUG, "Expiring registration for peer '%s'\n", p->name);
 	/* Reset the address */
 	memset(&p->addr, 0, sizeof(p->addr));
-	/* Reset expire notice */
-	p->expire = -1;
 	/* Reset expiry value */
 	p->expiry = min_reg_expire;
 	if (!ast_test_flag(p, IAX_TEMPONLY))
@@ -5778,6 +5776,9 @@ static void __expire_registry(void *data)
 
 static int expire_registry(void *data)
 {
+	struct iax2_peer *p = data;
+	/* Reset expire notice */
+	p->expire = -1;
 #ifdef SCHED_MULTITHREADED
 	if (schedule_action(__expire_registry, data))
 #endif