Maybe when I opened the previous patch by a text editor to check if it has all I wanted to add tabs were accidentally replaced by spaces.
Anyway fixed version is in the attachment.
How did you generate the patch? Apparently the tabs in existing code were replaced by whitespaces and the patch fails to apply because it doesn't match any longer the context.

Can you resend in it raw format with 'git diff >../filename.patch'?

Cheers,
Daniel


On Fri, Sep 6, 2013 at 12:46 AM, Vitaliy Aleksandrov <[email protected] <mailto:[email protected]>> wrote:

    Make the patch for master branch, 4.0 doesn't take any new
    feature and I applied the patches to master branch anyhow.

    Also, do not forget the patch for xml documentation.

    Cheers,
    Daniel
    Patch for master branch is in the attachment.

    Changelog:
    - documentation is updated
    - tcpconn_id initialized to "-1" for contacts loaded from a
    database during startup (Write-Back & Write-Through database modes).
    - tcpconn_id is being updated when UA reconnects and refreshes its
    registration.

    _______________________________________________
    SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
    list
    [email protected] <mailto:[email protected]>
    http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users




--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> - http://www.linkedin.com/in/miconda
Kamailio Advanced Trainings - Berlin, Oct 21-24; Miami, Nov 11-13, 2013
   - more details about Kamailio trainings at http://www.asipto.com -


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

diff --git a/modules/usrloc/doc/usrloc_admin.xml b/modules/usrloc/doc/usrloc_admin.xml
index ce7ddfb..4f7e3e5 100644
--- a/modules/usrloc/doc/usrloc_admin.xml
+++ b/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>
diff --git a/modules/usrloc/ucontact.c b/modules/usrloc/ucontact.c
index e7f8938..9cc2e06 100644
--- a/modules/usrloc/ucontact.c
+++ b/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;
 }
diff --git a/modules/usrloc/udomain.c b/modules/usrloc/udomain.c
index f587c1b..244f8e7 100644
--- a/modules/usrloc/udomain.c
+++ b/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;
 }
 
diff --git a/modules/usrloc/ul_mod.c b/modules/usrloc/ul_mod.c
index 7d88f67..b1be56b 100644
--- a/modules/usrloc/ul_mod.c
+++ b/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;
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to