Przeglądaj źródła

usrloc: update connection id for registration refresh

Vitaliy Aleksandrov 12 lat temu
rodzic
commit
605360798f

+ 20 - 0
modules/usrloc/doc/usrloc_admin.xml

@@ -875,6 +875,26 @@ modparam("usrloc", "db_ops_ruid", 1)
 		</example>
 	</section>
 
+	<section id="usrloc.p.handle_lost_tcp">
+		<title><varname>handle_lost_tcp</varname> (int)</title>
+		<para>
+			If set to 1, Kamailio will remove location records made via
+			TCP/TLS/WS/WSS transports when it looses corresponding tcp connections.
+		</para>
+		<para>
+		<emphasis>
+			Default value is <quote>0</quote>.
+		</emphasis>
+		<example>
+		<title>Set <varname>handle_lost_tcp</varname> parameter</title>
+		<programlist format="linespecific">
+...
+modparam("usrloc", "handle_lost_tcp", 1)
+...
+<programlisting>
+		</example>
+	</section>
+
 	</section>
 
 	<section>

+ 1 - 0
modules/usrloc/ucontact.c

@@ -307,6 +307,7 @@ int mem_update_ucontact(ucontact_t* _c, ucontact_info_t* _ci)
 	_c->last_keepalive = _ci->last_modified;
 	_c->flags = _ci->flags;
 	_c->cflags = _ci->cflags;
+	_c->tcpconn_id = _ci->tcpconn_id;
 
 	return 0;
 }

+ 3 - 0
modules/usrloc/udomain.c

@@ -351,6 +351,9 @@ static inline ucontact_info_t* dbrow2info( db_val_t *vals, str *contact)
 		ci.reg_id = VAL_UINT(vals+15);
 	}
 
+	/* tcp connection id */
+	ci.tcpconn_id = -1;
+
 	return &ci;
 }
 

+ 1 - 1
modules/usrloc/ul_mod.c

@@ -161,7 +161,7 @@ int timer_interval  = 60;				/*!< Timer interval in seconds */
 int db_mode         = 0;				/*!< Database sync scheme: 0-no db, 1-write through, 2-write back, 3-only db */
 int use_domain      = 0;				/*!< Whether usrloc should use domain part of aor */
 int desc_time_order = 0;				/*!< By default do not enable timestamp ordering */
-int handle_lost_tcp = 0;
+int handle_lost_tcp = 0;				/*!< By default do not remove contacts before expiration time */
 
 int ul_fetch_rows = 2000;				/*!< number of rows to fetch from result */
 int ul_hash_size = 9;