Hello,

thanks for testing and reporting the resultes -- I will backport the commit to branch 5.5.

Cheers,
Daniel

On 09.09.21 10:41, Pepelux wrote:
Hi Daniel

It works fine with handle_lost_tcp=1

Now the Tcpconn-Id value is -1 and the AOR is kept at location
 

                                               Contact: {
                                                        Address: sip:1002-test1@192.168.89.82
                                                        Expires: 3580
                                                        Q: 0.000000
                                                        Call-ID: dfjrewr12386fd6-343@kamailio.rpc
                                                        CSeq: 1
                                                        User-Agent: kamailio SIP Router - RPC Server
                                                        Received: [not set]
                                                        Path: [not set]
                                                        State: CS_NEW
                                                        Flags: 0
                                                        CFlags: 0
                                                        Socket: [not set]
                                                        Methods: 0
                                                        Ruid: ulcx-6139c433-74fc-1
                                                        Instance: [not set]
                                                        Reg-Id: 0
                                                        Server-Id: 0
                                                        Tcpconn-Id: -1
                                                        Keepalive: 0
                                                        Last-Keepalive: 1631175743
                                                        KA-Roundtrip: 0
                                                        Last-Modified: 0
                                                }
                                        }

# kamailio -v
version: kamailio 5.6.0-dev1 (x86_64/linux) a0a971
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: a0a971
compiled on 10:14:46 Sep  9 2021 with gcc 6.3.0


Regards

On Thu, 9 Sept 2021 at 09:24, Daniel-Constantin Mierla <miconda@gmail.com> wrote:

Hello,

I pushed a commit to make it work with handle_lost_tcp set:

  * https://github.com/kamailio/kamailio/commit/a0a97119bef7671f33734399dc9de4562abae39c

Can you give it a try? If works, then it will be backported.

Cheers,
Daniel

On 09.09.21 08:51, Pepelux wrote:
Hi

Yes, I had it. With value 0 works fine

Thanks Daniel for your help

On Thu, 9 Sept 2021 at 08:10, Daniel-Constantin Mierla <miconda@gmail.com> wrote:

Hello,

do you have this modparam set>

  * https://www.kamailio.org/docs/modules/stable/modules/usrloc.html#usrloc.p.handle_lost_tcp

Cheers,
Daniel

On 08.09.21 18:56, Pepelux wrote:
Hi all

I have problems adding a new location by RPC command.

# kamailio -v
version: kamailio 5.5.0 (x86_64/linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 8.3.0


A simple example, adding an AOR which expires in 1 hour:
 
# date ; kamcmd ul.add kam_location 1002-test1@sipserver.com sip:1002-test1@192.168.89.82 3600 0.0 . 0 0 0 .
Wed 08 Sep 2021 01:58:00 PM CEST


Location record has been inserted correctly:

# date ; kamcmd ul.dump | grep test -A24
Wed 08 Sep 2021 01:58:02 PM CEST
                                        AoR: 1002-test1@sipserver.com
                                        HashID: -597689288
                                        Contacts: {
                                                Contact: {
                                                        Address: sip:1002-test1@192.168.89.82
                                                        Expires: 3598
                                                        Q: 0.000000
                                                        Call-ID: dfjrewr12386fd6-343@kamailio.rpc
                                                        CSeq: 1
                                                        User-Agent: kamailio SIP Router - RPC Server
                                                        Received: [not set]
                                                        Path: [not set]
                                                        State: CS_SYNC
                                                        Flags: 0
                                                        CFlags: 0
                                                        Socket: [not set]
                                                        Methods: 0
                                                        Ruid: ulcx-61389f47-2e44-01
                                                        Instance: [not set]
                                                        Reg-Id: 0
                                                        Server-Id: 0
                                                        Tcpconn-Id: 0
                                                        Keepalive: 0
                                                        Last-Keepalive: 1631102280
                                                        KA-Roundtrip: 0
                                                        Last-Modified: 0
                                                }
                                        }
                                }


But a few seconds later, the location record has gone:

# date ; kamcmd ul.dump | grep test -A24
Wed 08 Sep 2021 01:58:26 PM CEST


In kamailio logs I can see that:

Sep  8 13:58:00 sipserver /usr/sbin/kamailio[11844]: DEBUG: usrloc [ul_rpc.c:637]: ul_rpc_add(): path == 0 -> unset
Sep  8 13:58:00 sipserver /usr/sbin/kamailio[11844]: DEBUG: usrloc [ul_rpc.c:652]: ul_rpc_add(): ret: 10 table:kam_location aor:1002-test1@sipserver.com contact:sip:1002-test1@192.168.89.82 expires:3600 dtemp:0.000000 path: flags:0 bflags:0 methods:0
Sep  8 13:58:00 sipserver /usr/sbin/kamailio[11844]: DEBUG: usrloc [ul_rpc.c:660]: ul_rpc_add(): q:0
Sep  8 13:58:00 sipserver /usr/sbin/kamailio[11844]: DEBUG: usrloc [ucontact.c:1857]: uldb_insert_attrs(): trying to insert location attributes
Sep  8 13:58:00 sipserver /usr/sbin/kamailio[11844]: DEBUG: usrloc [ucontact.c:1868]: uldb_insert_attrs(): no location attributes
Sep  8 13:58:03 sipserver /usr/sbin/kamailio[11827]: DEBUG: {1 81337 REGISTER 1955770655-18357-1@BJC.BGI.B.BBF REGISTER} usrloc [ucontact.c:1801]: uldb_delete_attrs_ruid(): trying to delete location attributes
Sep  8 13:58:03 sipserver /usr/sbin/kamailio[11827]: DEBUG: {1 81337 REGISTER 1955770655-18357-1@BJC.BGI.B.BBF REGISTER} usrloc [ucontact.c:72]: ucontact_xavp_store(): trying to clone per contact xavps
Sep  8 13:58:03 sipserver /usr/sbin/kamailio[11827]: DEBUG: {1 81337 REGISTER 1955770655-18357-1@BJC.BGI.B.BBF REGISTER} usrloc [ucontact.c:1857]: uldb_insert_attrs(): trying to insert location attributes
Sep  8 13:58:04 sipserver /usr/sbin/kamailio[11829]: DEBUG: {1 141 REGISTER 1aa357700bd0696702c40340595d89e7@185.99.186.215 REGISTER} usrloc [ucontact.c:1801]: uldb_delete_attrs_ruid(): trying to delete location attributes
Sep  8 13:58:04 sipserver /usr/sbin/kamailio[11829]: DEBUG: {1 141 REGISTER 1aa357700bd0696702c40340595d89e7@185.99.186.215 REGISTER} usrloc [ucontact.c:72]: ucontact_xavp_store(): trying to clone per contact xavps
Sep  8 13:58:04 sipserver /usr/sbin/kamailio[11829]: DEBUG: {1 141 REGISTER 1aa357700bd0696702c40340595d89e7@185.99.186.215 REGISTER} usrloc [ucontact.c:1857]: uldb_insert_attrs(): trying to insert location attributes
Sep  8 13:58:06 sipserver /usr/sbin/kamailio[11852]: DEBUG: {1 114 REGISTER 5ne5ebv674tptk0p1uj4gg REGISTER} usrloc [ucontact.c:1801]: uldb_delete_attrs_ruid(): trying to delete location attributes
Sep  8 13:58:06 sipserver /usr/sbin/kamailio[11852]: DEBUG: {1 114 REGISTER 5ne5ebv674tptk0p1uj4gg REGISTER} usrloc [ucontact.c:72]: ucontact_xavp_store(): trying to clone per contact xavps
Sep  8 13:58:06 sipserver /usr/sbin/kamailio[11852]: DEBUG: {1 114 REGISTER 5ne5ebv674tptk0p1uj4gg REGISTER} usrloc [ucontact.c:1857]: uldb_insert_attrs(): trying to insert location attributes
Sep  8 13:58:23 sipserver /usr/sbin/kamailio[11828]: DEBUG: {1 12484 REGISTER 1382185578-19234-1@BJC.BGI.B.BGC REGISTER} usrloc [ucontact.c:1801]: uldb_delete_attrs_ruid(): trying to delete location attributes
Sep  8 13:58:23 sipserver /usr/sbin/kamailio[11828]: DEBUG: {1 12484 REGISTER 1382185578-19234-1@BJC.BGI.B.BGC REGISTER} usrloc [ucontact.c:72]: ucontact_xavp_store(): trying to clone per contact xavps
Sep  8 13:58:23 sipserver /usr/sbin/kamailio[11828]: DEBUG: {1 12484 REGISTER 1382185578-19234-1@BJC.BGI.B.BGC REGISTER} usrloc [ucontact.c:1857]: uldb_insert_attrs(): trying to insert location attributes
Sep  8 13:58:23 sipserver /usr/sbin/kamailio[11835]: DEBUG: usrloc [urecord.c:377]: wb_timer(): tcp connection has been lost, expiring contact sip:1002-test1@192.168.89.82
Sep  8 13:58:23 sipserver /usr/sbin/kamailio[11835]: DEBUG: usrloc [urecord.c:387]: wb_timer(): Binding '1002-test1@sipserver.com','sip:1002-test1@192.168.89.82' has expired
Sep  8 13:58:23 sipserver /usr/sbin/kamailio[11835]: DEBUG: usrloc [ucontact.c:1801]: uldb_delete_attrs_ruid(): trying to delete location attributes
Sep  8 13:58:25 sipserver /usr/sbin/kamailio[11830]: DEBUG: {1 185389 REGISTER 1487655759-19321-1@BJC.BGI.B.BBB REGISTER} usrloc [ucontact.c:1801]: uldb_delete_attrs_ruid(): trying to delete location attributes
Sep  8 13:58:25 sipserver /usr/sbin/kamailio[11830]: DEBUG: {1 185389 REGISTER 1487655759-19321-1@BJC.BGI.B.BBB REGISTER} usrloc [ucontact.c:72]: ucontact_xavp_store(): trying to clone per contact xavps
Sep  8 13:58:25 sipserver /usr/sbin/kamailio[11830]: DEBUG: {1 185389 REGISTER 1487655759-19321-1@BJC.BGI.B.BBB REGISTER} usrloc [ucontact.c:1857]: uldb_insert_attrs(): trying to insert location attributes
Sep  8 13:58:33 sipserver /usr/sbin/kamailio[11853]: DEBUG: {1 3360 REGISTER pgmirc5oirbekeaj3tmrf7 REGISTER} usrloc [ucontact.c:1801]: uldb_delete_attrs_ruid(): trying to delete location attributes
Sep  8 13:58:33 sipserver /usr/sbin/kamailio[11853]: DEBUG: {1 3360 REGISTER pgmirc5oirbekeaj3tmrf7 REGISTER} usrloc [ucontact.c:72]: ucontact_xavp_store(): trying to clone per contact xavps
Sep  8 13:58:33 sipserver /usr/sbin/kamailio[11853]: DEBUG: {1 3360 REGISTER pgmirc5oirbekeaj3tmrf7 REGISTER} usrloc [ucontact.c:1857]: uldb_insert_attrs(): trying to insert location attributes
Sep  8 13:58:44 sipserver /usr/sbin/kamailio[11829]: DEBUG: {1 5645 REGISTER 89744034-6071-1@BJC.BGI.A.BJ REGISTER} usrloc [ucontact.c:1801]: uldb_delete_attrs_ruid(): trying to delete location attributes
Sep  8 13:58:44 sipserver /usr/sbin/kamailio[11829]: DEBUG: {1 5645 REGISTER 89744034-6071-1@BJC.BGI.A.BJ REGISTER} usrloc [ucontact.c:72]: ucontact_xavp_store(): trying to clone per contact xavps
Sep  8 13:58:44 sipserver /usr/sbin/kamailio[11829]: DEBUG: {1 5645 REGISTER 89744034-6071-1@BJC.BGI.A.BJ REGISTER} usrloc [ucontact.c:1857]: uldb_insert_attrs(): trying to insert location attributes
Sep  8 13:58:44 sipserver /usr/sbin/kamailio[11830]: DEBUG: {1 5683 REGISTER 1974024198-16543-1@BJC.BGI.B.BDE REGISTER} usrloc [ucontact.c:1801]: uldb_delete_attrs_ruid(): trying to delete location attributes
Sep  8 13:58:44 sipserver /usr/sbin/kamailio[11830]: DEBUG: {1 5683 REGISTER 1974024198-16543-1@BJC.BGI.B.BDE REGISTER} usrloc [ucontact.c:72]: ucontact_xavp_store(): trying to clone per contact xavps
Sep  8 13:58:44 sipserver /usr/sbin/kamailio[11830]: DEBUG: {1 5683 REGISTER 1974024198-16543-1@BJC.BGI.B.BDE REGISTER} usrloc [ucontact.c:1857]: uldb_insert_attrs(): trying to insert location attributes
Sep  8 13:58:50 sipserver /usr/sbin/kamailio[11829]: DEBUG: {1 144820 REGISTER 381139623-5062-1@BJC.BGI.B.BAD REGISTER} usrloc [ucontact.c:1801]: uldb_delete_attrs_ruid(): trying to delete location attributes
Sep  8 13:58:50 sipserver /usr/sbin/kamailio[11829]: DEBUG: {1 144820 REGISTER 381139623-5062-1@BJC.BGI.B.BAD REGISTER} usrloc [ucontact.c:72]: ucontact_xavp_store(): trying to clone per contact xavps
Sep  8 13:58:50 sipserver /usr/sbin/kamailio[11829]: DEBUG: {1 144820 REGISTER 381139623-5062-1@BJC.BGI.B.BAD REGISTER} usrloc [ucontact.c:1857]: uldb_insert_attrs(): trying to insert location attributes
Sep  8 13:58:59 sipserver /usr/sbin/kamailio[11828]: DEBUG: {1 84973 REGISTER 467700456-5060-1@BJC.BGI.B.BCI REGISTER} usrloc [ucontact.c:1801]: uldb_delete_attrs_ruid(): trying to delete location attributes
Sep  8 13:58:59 sipserver /usr/sbin/kamailio[11828]: DEBUG: {1 84973 REGISTER 467700456-5060-1@BJC.BGI.B.BCI REGISTER} usrloc [ucontact.c:72]: ucontact_xavp_store(): trying to clone per contact xavps
Sep  8 13:58:59 sipserver /usr/sbin/kamailio[11828]: DEBUG: {1 84973 REGISTER 467700456-5060-1@BJC.BGI.B.BCI REGISTER} usrloc [ucontact.c:1857]: uldb_insert_attrs(): trying to insert location attributes
Sep  8 13:59:01 sipserver /usr/sbin/kamailio[11854]: DEBUG: {1 116 REGISTER 5ne5ebv674tptk0p1uj4gg REGISTER} usrloc [ucontact.c:1801]: uldb_delete_attrs_ruid(): trying to delete location attributes
Sep  8 13:59:01 sipserver /usr/sbin/kamailio[11854]: DEBUG: {1 116 REGISTER 5ne5ebv674tptk0p1uj4gg REGISTER} usrloc [ucontact.c:72]: ucontact_xavp_store(): trying to clone per contact xavps
Sep  8 13:59:01 sipserver /usr/sbin/kamailio[11854]: DEBUG: {1 116 REGISTER 5ne5ebv674tptk0p1uj4gg REGISTER} usrloc [ucontact.c:1857]: uldb_insert_attrs(): trying to insert location attributes
Sep  8 13:59:04 sipserver /usr/sbin/kamailio[11830]: DEBUG: {1 81338 REGISTER 1955770655-18357-1@BJC.BGI.B.BBF REGISTER} usrloc [ucontact.c:1801]: uldb_delete_attrs_ruid(): trying to delete location attributes
Sep  8 13:59:04 sipserver /usr/sbin/kamailio[11830]: DEBUG: {1 81338 REGISTER 1955770655-18357-1@BJC.BGI.B.BBF REGISTER} usrloc [ucontact.c:72]: ucontact_xavp_store(): trying to clone per contact xavps
Sep  8 13:59:04 sipserver /usr/sbin/kamailio[11830]: DEBUG: {1 81338 REGISTER 1955770655-18357-1@BJC.BGI.B.BBF REGISTER} usrloc [ucontact.c:1857]: uldb_insert_attrs(): trying to insert location attributes


What am I doing wrong? It is supposed that the connection is by UDP. I also tried to insert the socket value as UDP, but it had the same problem.

Thanks!



__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda