diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index df406483c3ca58b59dd77e1d047c3a636a3a2080..7985d0633e509d9e3c94d62b882e7a8890a16497 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -12167,7 +12167,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int
 		 */
 		v=v->next;
 	}
-	if (!ast_test_flag((&global_flags_page2), SIP_PAGE2_IGNOREREGEXPIRE) && ast_test_flag(peer, SIP_DYNAMIC)) {
+	if (!ast_test_flag((&global_flags_page2), SIP_PAGE2_IGNOREREGEXPIRE) && ast_test_flag(peer, SIP_DYNAMIC) && realtime) {
 		time_t nowtime;
 
 		time(&nowtime);