From cfa6831f9a81988dc1844ba3e4e6048c12841606 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Mon, 27 Jul 2015 15:04:30 +0200 Subject: [PATCH] uac: reset ongoing registration state if retry interval is exceeded - cover the case of remote registration process stuck in ongoing state for long time - reported by Andy J Robinson, GH #255 --- modules/uac/uac_reg.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/uac/uac_reg.c b/modules/uac/uac_reg.c index 0cff68946e3..7b7d2deff1e 100644 --- a/modules/uac/uac_reg.c +++ b/modules/uac/uac_reg.c @@ -928,8 +928,13 @@ int uac_reg_update(reg_uac_t *reg, time_t tn) return -1; if(reg->expires==0) return 1; - if(reg->flags&UAC_REG_ONGOING) - return 2; + if(reg->flags&UAC_REG_ONGOING) { + if (reg->timer_expires > tn - reg_retry_interval) + return 2; + LM_DBG("record marked as ongoing registration (%d) - resetting\n", + (int)reg->flags); + reg->flags &= ~(UAC_REG_ONLINE|UAC_REG_AUTHSENT); + } if(reg->flags&UAC_REG_DISABLED) return 4; if(reg->timer_expires > tn + reg_timer_interval + 3)