Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t_set_fr only works with UDP #1966

Closed
bpbp-boop opened this issue May 28, 2019 · 6 comments
Closed

t_set_fr only works with UDP #1966

bpbp-boop opened this issue May 28, 2019 · 6 comments

Comments

@bpbp-boop
Copy link

Description

Using t_set_fr within the LOCATION section of a slightly modified default kamailio.cfg only works if the contact is using UDP and not TCP.

# ----- tm params -----
# auto-discard branches from previous serial forking leg
modparam("tm", "failure_reply_mode", 3)
# default retransmission timeout: 30sec
modparam("tm", "fr_timer", 30000)
# default invite retransmission timeout after 1xx: 120sec
modparam("tm", "fr_inv_timer", 30000)

# User location service
route[LOCATION] {
        [...]
        # per subscriber ring time
        if ($avp(s:ring_time) != $null) {
                # xlog("setting time out to $avp(s:ring_time)");
                t_set_fr($avp(s:ring_time) * 1000);
        }
}

Reproduction

register an contact with UDP, set the timer to 5 seconds. observe kamailio terminates the invite after 5 seconds.
then with TCP observe kamailio terminates the invite after 30 seconds (the default)

Additional Information

  • Kamailio Version - output of kamailio -v
version: kamailio 5.2.1 (x86_64/linux) 947769
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, 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_BLACKLIST, HAVE_RESOLV_RES
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: 947769
compiled on 20:48:14 Feb 26 2019 with gcc 4.8.5
  • Operating System:
    CentOS 7
@bpbp-boop
Copy link
Author

debug with mysql stuff removed:
https://gist.github.com/bpbp-boop/1ed530f73164a9737803ab2bcd1dca24

@henningw
Copy link
Contributor

Thank you for the report. This was reported some time ago on the list link but also did not came to a conclusion.

@bpbp-boop
Copy link
Author

I found a work-around - I assume there is a new branch created when the contact is using TCP because the following fixes it

# User location service
route[LOCATION] {
        [...]
        # per subscriber ring time
        if ($avp(s:ring_time) != $null) {
                # xlog("setting time out to $avp(s:ring_time)");
                t_set_fr($avp(s:ring_time) * 1000);
                t_set_max_lifetime($avp(s:ring_time) * 1000, 0);
        }
}

@henningw
Copy link
Contributor

henningw commented Aug 2, 2019

I can reproduce this with current git master, also your workaround.

@amessina
Copy link
Contributor

amessina commented Sep 2, 2019

Is there a workaround for TCP/TLS contacts and combined parallel/serial forking (https://kamailio.org/docs/modules/stable/modules/tm#tm.serial_forking)? Should t_set_max_lifetime() be increased for each loop (in failure_route) of t_next_contacts()?

@miconda
Copy link
Member

miconda commented Aug 11, 2020

Closing being an aged item, with an workaround. Should anyone want to implement a different approach, just do a PR.

@miconda miconda closed this as completed Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants