<p></p>
<h3>Description</h3>
<p>I want to use Session timers to refresh SDP  on RTPengine node failure.<br>
If call RTP streams established via first RTPengine node, and then this RTPengine node is stopped, then rtpengine Kamailio module do not try to use other RTPengine nodes.</p>
<h3>Troubleshooting</h3>
<h4>Reproduction</h4>
<p>Update /etc/kamailio/kamailio.cfg using patch like</p>
<div class="highlight highlight-source-diff"><pre><span class="pl-c1">diff --git a/etc/kamailio.cfg b/etc/kamailio.cfg</span>
index be71dbb54a..1a6788f79f 100644
<span class="pl-md">--- a/etc/kamailio.cfg</span>
<span class="pl-mi1">+++ b/etc/kamailio.cfg</span>
<span class="pl-mdr">@@ -1,4 +1,7 @@</span>
 #!KAMAILIO
<span class="pl-mi1"><span class="pl-mi1">+</span>#!define WITH_DEBUG</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>#!define WITH_NAT</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>#!define WITH_RTPENGINE</span>
 #
 # Kamailio SIP Server v5.5 - default configuration script
 #     - web: https://www.kamailio.org
<span class="pl-mdr">@@ -195,6 +198,8 @@</span> children=8
  *      listen=[proto]:[localip]:[lport] advertise [publicip]:[pport]
  * - it can be set many times to add more sockets to listen to */
 # listen=udp:10.0.0.10:5060
<span class="pl-mi1"><span class="pl-mi1">+</span>listen=tcp:3.236.25.6:5060</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>listen=tcp:[2600:1f18:578:5700::6]:5060</span>
 
 /* life time of TCP connection when there is no traffic
  * - a bit higher than registration expires to cope with UA behind NAT */
<span class="pl-mdr">@@ -456,7 +461,7 @@</span> modparam("presence_xml", "force_active", 1)
 #!ifdef WITH_NAT
 #!ifdef WITH_RTPENGINE
 # ----- rtpengine params -----
<span class="pl-md"><span class="pl-md">-</span>modparam("rtpengine", "rtpengine_sock", "udp:127.0.0.1:2223")</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>modparam("rtpengine", "rtpengine_sock", "udp6:rtp-us-east-1a-6.nga911.com:2223 udp6:rtp-us-east-1a-7.nga911.com:2223")</span>
 #!else
 # ----- rtpproxy params -----
 modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:7722")
<span class="pl-mdr">@@ -528,6 +533,11 @@</span> request_route {
        # handle requests within SIP dialogs
        route(WITHINDLG);
 
<span class="pl-mi1"><span class="pl-mi1">+</span>       if (loose_route()) {</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>               route(NATMANAGE);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>               record_route();</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>               route(RELAY);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>       }</span>
        ### only initial requests (no To tag)
 
        # authentication
<span class="pl-mdr">@@ -850,10 +860,11 @@</span> route[NATMANAGE] {
        if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB))) return;
 
 #!ifdef WITH_RTPENGINE
<span class="pl-md"><span class="pl-md">-</span>       if(nat_uac_test("8")) {</span>
<span class="pl-md"><span class="pl-md">-</span>               rtpengine_manage("SIP-source-address replace-origin replace-session-connection");</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>       if($avp(rtpengine_offer) == "done") {</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>               rtpengine_answer("ICE=remove address-family=IP4 SDES=off");</span>
        } else {
<span class="pl-md"><span class="pl-md">-</span>               rtpengine_manage("replace-origin replace-session-connection");</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>               rtpengine_offer("ICE=remove address-family=IP6 SDES=off");</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>               $avp(rtpengine_offer) = "done";</span>
        }
 #!else
        if(nat_uac_test("8")) {</pre></div>
<p>Establish call via this Kamailio. In my case used <code>Route</code> header in initial INVITE.<br>
When a call is established, then need stop RTPengine daemon on node used for media proxing.<br>
Wait when the caller sends a session refresh.<br>
According to Kamailio logs not attempt to reach another RTPengine node if the first node not available more.</p>
<h4>Log Messages</h4>
<p>In <a href="https://github.com/kamailio/kamailio/files/6330914/kam.log">kam.log</a> please check messages related to</p>
<pre><code>Call-ID: 6aac81b6-a028-11eb-8bf8-870daa274dfe
CSeq: 34815260 INVITE
</code></pre>
<p>In log you will find at string 3437</p>
<pre><code>11(31837) exec: {1 34815260 INVITE 6aac81b6-a028-11eb-8bf8-870daa274dfe} *** cfgtrace:dbg_cfg_trace(): branch_route=[NATMANAGE] c=[/root/kamailio/etc/kamailio.cfg] l=866 a=25 n=rtpengine_offer
11(31837) DEBUG: {1 34815260 INVITE 6aac81b6-a028-11eb-8bf8-870daa274dfe} rtpengine [rtpengine_funcs.c:144]: check_content_type(): type <application/sdp> found valid
11(31837) DEBUG: {1 34815260 INVITE 6aac81b6-a028-11eb-8bf8-870daa274dfe} rtpengine [rtpengine.c:1834]: build_rtpp_socks(): same rtpengines list version: 1 (1618738091)
11(31837) DEBUG: {1 34815260 INVITE 6aac81b6-a028-11eb-8bf8-870daa274dfe} rtpengine [rtpengine.c:3266]: select_rtpp_node_old(): rtpengine hash table lookup find node=udp6:rtp-us-east-1a-7.nga911.com:2223 for calllen=36 callid=6aac81b6-a028-11eb-8bf8-870daa274dfe viabranch=
11(31837) ERROR: {1 34815260 INVITE 6aac81b6-a028-11eb-8bf8-870daa274dfe} rtpengine [rtpengine.c:3027]: send_rtpp_command(): can't send command "offer" to RTPEngine <udp6:rtp-us-east-1a-7.nga911.com:2223>
11(31837) DEBUG: {1 34815260 INVITE 6aac81b6-a028-11eb-8bf8-870daa274dfe} rtpengine [rtpengine.c:1834]: build_rtpp_socks(): same rtpengines list version: 1 (1618738091)
11(31837) DEBUG: {1 34815260 INVITE 6aac81b6-a028-11eb-8bf8-870daa274dfe} rtpengine [rtpengine.c:3266]: select_rtpp_node_old(): rtpengine hash table lookup find node=udp6:rtp-us-east-1a-7.nga911.com:2223 for calllen=36 callid=6aac81b6-a028-11eb-8bf8-870daa274dfe viabranch=
11(31837) ERROR: {1 34815260 INVITE 6aac81b6-a028-11eb-8bf8-870daa274dfe} rtpengine [rtpengine.c:2664]: rtpp_function_call(): no available proxies
</code></pre>
<p>At this moment one other RTPengine node is available, but rtpengine Kamailio module does not try to reach this node.</p>
<h4>SIP Traffic</h4>
<p><a href="https://github.com/kamailio/kamailio/files/6330925/no-rtpengine-swithover.pcap.gz">no-rtpengine-swithover.pcap.gz</a></p>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>[centos@sbc-a2 ~]$ kamailio -v
version: kamailio 5.5.0-pre0 (x86_64/linux) 9413fc
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: 9413fc 
compiled on 04:03:33 Apr  3 2021 with gcc 8.3.1
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>
<pre><code>[centos@sbc-a2 ~]$ cat /etc/os-release 
NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2713">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZOHUB742Z27NPSUIVTTJKVYVANCNFSM43EB2I6A">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZOFHIITXH3WRFWY5GTTJKVYVA5CNFSM43EB2I6KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4M2MDBUQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2713",
"url": "https://github.com/kamailio/kamailio/issues/2713",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>