浏览代码

modules/lcr: always use current time when loading gateways

- Always use current time when deciding if a gateway is defunct or not.
  Otherwise a gateway may get used even if its defunct until time in
  database is greater than current time.
(cherry picked from commit 0c819f3ff3d947897fa0bafbaaa0081b671bb4e4)
Juha Heinanen 15 年之前
父节点
当前提交
2da81aa4f5
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      modules/lcr/lcr_mod.c

+ 2 - 3
modules/lcr/lcr_mod.c

@@ -1746,12 +1746,11 @@ static int load_gws(struct sip_msg* _m, char *_lcr_id, char *_from_uri)
     gw_count = gws[0].ip_addr;
 
     if (defunct_capability > 0) {
-	now = time((time_t *)NULL);
 	delete_avp(defunct_gw_avp_type, defunct_gw_avp);
-    } else {
-	now = MAX_UVAR_VALUE(now);
     }
 
+    now = time((time_t *)NULL);
+
     while (pl) {
 	if (ruri_user.len < pl->prefix_len) {
 	    pl = pl->next;