### Description
I want to use Session timers to refresh SDP on RTPengine node failure.
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.
### Troubleshooting
#### Reproduction
Update /etc/kamailio/kamailio.cfg using patch like
```diff
diff --git a/etc/kamailio.cfg b/etc/kamailio.cfg
index be71dbb54a..1a6788f79f 100644
--- a/etc/kamailio.cfg
+++ b/etc/kamailio.cfg
@@ -1,4 +1,7 @@
#!KAMAILIO
+#!define WITH_DEBUG
+#!define WITH_NAT
+#!define WITH_RTPENGINE
#
# Kamailio SIP Server v5.5 - default configuration script
# - web: https://www.kamailio.org
@@ -195,6 +198,8 @@ 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
+listen=tcp:3.236.25.6:5060
+listen=tcp:[2600:1f18:578:5700::6]:5060
/* life time of TCP connection when there is no traffic
* - a bit higher than registration expires to cope with UA behind NAT */
@@ -456,7 +461,7 @@ modparam("presence_xml", "force_active", 1)
#!ifdef WITH_NAT
#!ifdef WITH_RTPENGINE
# ----- rtpengine params -----
-modparam("rtpengine", "rtpengine_sock", "udp:127.0.0.1:2223")
+modparam("rtpengine", "rtpengine_sock", "udp6:rtp-us-east-1a-6.nga911.com:2223 udp6:rtp-us-east-1a-7.nga911.com:2223")
#!else
# ----- rtpproxy params -----
modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:7722")
@@ -528,6 +533,11 @@ request_route {
# handle requests within SIP dialogs
route(WITHINDLG);
+ if (loose_route()) {
+ route(NATMANAGE);
+ record_route();
+ route(RELAY);
+ }
### only initial requests (no To tag)
# authentication
@@ -850,10 +860,11 @@ route[NATMANAGE] {
if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB))) return;
#!ifdef WITH_RTPENGINE
- if(nat_uac_test("8")) {
- rtpengine_manage("SIP-source-address replace-origin replace-session-connection");
+ if($avp(rtpengine_offer) == "done") {
+ rtpengine_answer("ICE=remove address-family=IP4 SDES=off");
} else {
- rtpengine_manage("replace-origin replace-session-connection");
+ rtpengine_offer("ICE=remove address-family=IP6 SDES=off");
+ $avp(rtpengine_offer) = "done";
}
#!else
if(nat_uac_test("8")) {
```
Establish call via this Kamailio. In my case used `Route` header in initial INVITE.
When a call is established, then need stop RTPengine daemon on node used for media proxing.
Wait when the caller sends a session refresh.
According to Kamailio logs not attempt to reach another RTPengine node if the first node not available more.
#### Log Messages
In [kam.log](https://github.com/kamailio/kamailio/files/6330914/kam.log) please check messages related to
```
Call-ID: 6aac81b6-a028-11eb-8bf8-870daa274dfe
CSeq: 34815260 INVITE
```
In log you will find at string 3437
```
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
```
At this moment one other RTPengine node is available, but rtpengine Kamailio module does not try to reach this node.
#### SIP Traffic
[no-rtpengine-swithover.pcap.gz](https://github.com/kamailio/kamailio/files/…
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
[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
```
* **Operating System**:
```
[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"
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2713
### Description
To avoid extra DNS requests I want to use absolute DNS names instead of relative.
To do this I configured
```
modparam("siptrace", "duplicate_uri", "sip:sip-trace6.example.com.:9060"
```
And now I can see errors
```
CRITICAL: <core> [core/proxy.c:264]: mk_proxy(): could not resolve hostname: "sip-trace6.example.com."
ERROR: siptrace [siptrace_hep.c:178]: trace_send_hep3_duplicate(): bad host name in uri
CRITICAL: <core> [core/proxy.c:264]: mk_proxy(): could not resolve hostname: "sip-trace6.example.com."
ERROR: siptrace [siptrace_hep.c:178]: trace_send_hep3_duplicate(): bad host name in uri
CRITICAL: <core> [core/proxy.c:264]: mk_proxy(): could not resolve hostname: "sip-trace6.example.com."
ERROR: siptrace [siptrace_hep.c:178]: trace_send_hep3_duplicate(): bad host name in uri
```
I am expecting "sip-trace6.example.com." DNS name resolution without errors in Kamailio log.
used current master.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2706
Hello,
as I added support for other transports (tcp, tls, ...) to DMQ
inter-nodes communications and trying to configure it for a few testing
scenarios, I ended up in some design issues/limitations. Two of them
seem to prevent usual operations, therefore I want to get more opinions
and see what would be the best way to go further.
1) there is no decoupling between server_address and server socket. The
server socket is kept internally, but it is built from server_address
parameter. The actual problem appears when trying to use FQDN as
notification_address, because it ends up to have duplicate peer
addresses for the same node.
For example:
- server1 with ip 1.2.3.4 and domain server1.sip.com
- server2 with ip 5.6.7.8 and domain server2.sip.com
On server1:
modparam("dmq", "server_address", "sip:1.2.3.4:5060")
modparam("dmq", "notification_address", "sip:server2.sip.com:5060")
On server2:
modparam("dmq", "server_address", "sip:5.6.7.8:5060")
modparam("dmq", "notification_address", "sip:server1.sip.com:5060")
Then each node end ups with 4 peer nodes.
On server1:
- sip:1.2.3.4:5060 (local=1)
- sip:server1.sip.com:5060 (local=0)
- sip:5.6.7.8:5060 (local=0)
- sip:server2.sip.com:5060 (local=0)
On server2:
- sip:1.2.3.4:5060 (local=0)
- sip:server1.sip.com:5060 (local=0)
- sip:5.6.7.8:5060 (local=1)
- sip:server2.sip.com:5060 (local=0)
Practically each server considers the local FQDN being a remote peer.
There are KDMQ requests sent to itself, but a real problematic issue is
that presence replication (as I tested, could be for the other modules
as well) is broken, because instead of an update it happens a replace.
The case was a PUBLISH with body having state open, then in 30sec there
is an PUBLISH to refresh using same ETag and empty body (as per spec),
but instead of just updating the expires value, it also updates the body
to empty string.
If notification_address is using IP address instead of FQDN of the other
server, everything works as expected, with body being kept on refresh
and only expires being updated.
The looping/spiralling is overwriting the purpose of the KDMQ
replication action.
Use of FQDN is needed for TLS transport in order to be able to validate
the domain against the attributes in certificate. Currently it does not
work to have server_address with FQDN (maybe it would work with
advertise address to listen, but that will force to use for SIP headers,
which is not wanted).
To solve it I would introduce server_socket modparam, which if it is not
set, then it is computed from server_address like for now. This keeps
backward compatibility.
2) The second issue is a bit related. As there was a need to remove the
FQDN and change the notification_address to be with the IP of the other
node, I restarted each node, but the FQDNs stayed there, because after
the restart of the server 1, it got the list with FQDNs from the server
2. Then restarting the server 2, ended up by sync'ing with server 1 and
receiving again all the addresses. Practically the solution was to shut
down all the nodes, which is something one is likely not wanting to do,
because the entire platform is down with no active node, and even if it
is for short time, for cases when data is only in memory (e.g., htable
items, or in-memory only presence) everything is lost.
In other words, there is no way to remove a peer address that still
points to an active node but it is no longer wanted, because it persists
in the other running nodes. Could be also the case of changing the
domain to be used for notification address.
This issue leads to the 1), because one node then appears many times
(old FQDN and new FQDN), leading to loops/spirals with unwanted/broken
side effects.
I haven't thought much of it, but one solution could be an RPC command
to be able to remove unwanted addresses from list of peers. It still can
be a race of sync'ing immediately after removing via rpc, before being
able to remove from the other node, but then one can check with rpc
dmq.list_nodes and re-run the rpc command if it is the case.
Given that Kamailio is in testing phase for 5.5, I want to see if anyone
thinks of other solutions to fix this issues without introducing a new
parameter (again, with backward compatibility) and a new rpc command
(which does not have effect in breaking existing behaviour).
Cheers,
Daniel
--
Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - Online
May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone)
* https://www.asipto.com/sw/kamailio-advanced-training-online/
Module: kamailio
Branch: master
Commit: 38692da8abff093b45f5a50994b7a95e5aa515f9
URL: https://github.com/kamailio/kamailio/commit/38692da8abff093b45f5a50994b7a95…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2021-04-19T10:16:20+02:00
modules: readme files regenerated - lost ... [skip ci]
---
Modified: src/modules/lost/README
---
Diff: https://github.com/kamailio/kamailio/commit/38692da8abff093b45f5a50994b7a95…
Patch: https://github.com/kamailio/kamailio/commit/38692da8abff093b45f5a50994b7a95…
---
diff --git a/src/modules/lost/README b/src/modules/lost/README
index e92e50ada6..14cf3b36a6 100644
--- a/src/modules/lost/README
+++ b/src/modules/lost/README
@@ -239,7 +239,7 @@ Chapter 1. Admin Guide
findService contains only one location, which is selected via this
parameter as follows:
* 0 - takes the first location of any type
- * 1 - takes the last last of any type
+ * 1 - takes the last location of any type
* 2 - takes the first geodetic location
* 3 - takes the first civic location
Module: kamailio
Branch: master
Commit: b0ee86a7b8ab6866b40320c1141bf95aec5d2071
URL: https://github.com/kamailio/kamailio/commit/b0ee86a7b8ab6866b40320c1141bf95…
Author: Wolfgang Kampichler <dev(a)kampichler.info>
Committer: Wolfgang Kampichler <dev(a)kampichler.info>
Date: 2021-04-19T10:13:13+02:00
lost: doc - typo removed
---
Modified: src/modules/lost/doc/lost_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/b0ee86a7b8ab6866b40320c1141bf95…
Patch: https://github.com/kamailio/kamailio/commit/b0ee86a7b8ab6866b40320c1141bf95…
---
diff --git a/src/modules/lost/doc/lost_admin.xml b/src/modules/lost/doc/lost_admin.xml
index 1df4aefd21..7f4597632b 100644
--- a/src/modules/lost/doc/lost_admin.xml
+++ b/src/modules/lost/doc/lost_admin.xml
@@ -211,7 +211,7 @@
<emphasis>0</emphasis> - takes the first location of any type
</para></listitem>
<listitem><para>
- <emphasis>1</emphasis> - takes the last last of any type
+ <emphasis>1</emphasis> - takes the last location of any type
</para></listitem>
<listitem><para>
<emphasis>2</emphasis> - takes the first geodetic location