[sr-dev] git:4.2:e3618b8f: uac: reset ongoing registration state if retry interval is exceeded

Daniel-Constantin Mierla miconda at gmail.com
Wed Jul 29 12:45:32 CEST 2015


Module: kamailio
Branch: 4.2
Commit: e3618b8f8acd03db05c4b5ed09aa6b2945f39869
URL: https://github.com/kamailio/kamailio/commit/e3618b8f8acd03db05c4b5ed09aa6b2945f39869

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-07-29T12:39:44+02:00

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

(cherry picked from commit cfa6831f9a81988dc1844ba3e4e6048c12841606)
(cherry picked from commit e5f8d6282eefbe4c8ad0b0309ac06ab468e9b1f2)

---

Modified: modules/uac/uac_reg.c

---

Diff:  https://github.com/kamailio/kamailio/commit/e3618b8f8acd03db05c4b5ed09aa6b2945f39869.diff
Patch: https://github.com/kamailio/kamailio/commit/e3618b8f8acd03db05c4b5ed09aa6b2945f39869.patch

---

diff --git a/modules/uac/uac_reg.c b/modules/uac/uac_reg.c
index de4e265..612910f 100644
--- a/modules/uac/uac_reg.c
+++ b/modules/uac/uac_reg.c
@@ -906,8 +906,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)




More information about the sr-dev mailing list