Hello!
I want to implement kamailio module for MRCP interaction. I need it for
automatic machine detection (AMD) system. I will be grateful for any help
and have some initial questions:
1. Is it interesting for anyone?
2. Now I reading http://www.asipto.com/pub/kamailio-devel-guide/ guide. Is
it the newest one or I can find something more actual?
I want to implement such scheme:
https://unimrcp.org/ea/index.htm?goto=2:1:30
Where kamailio will be on place of PBX, rtp-sender will be on place of IP
Phone (and will be connected to RTP stream via proc-subsystem to rtpengine
(like a rtpengine-recorder daemon). I want to use same scheme as HTTP async
module (define a route, which must be called on event receive).
--
With best regards
Dmitry Borisov
### Description
When relaying an `INVITE` from a Kamailio proxy to an interconnect we are using DNS SRV records for load-balancing and failover. The proxy is listening on both a private interface and a public interface with an rfc1918 (ie. `10.0.0.14`) and a public IP address (ie. `185.0.0.34`) respectively.
The first branch (before DNS SRV failover) is working as expected. The message will be relayed from the received socket (`185.0.0.34`) to the interconnect. When this branch results in a timeout, the proxy will try to do DNS SRV failover. This new branch and any subsequent branches will no longer use the initial received socket as source. In our case we see that the private address (`10.0.0.14`) is now being used as source address.
### Troubleshooting
#### Reproduction
DNS SRV:
```
_sip._udp.transit.net. SRV 10 10 5060 transit1.net.
_sip._udp.transit.net. SRV 20 10 5060 transit2.net.
transit1.net. A 185.10.20.30
transit2.net. A 185.10.20.31
```
Kamailio:
```
$du = "sip:transit.net;transport=udp";
xinfo("Relaying [$rm] request: [$ru] with Call-ID [$ci]");
t_set_fr(0, 1000);
if (not t_relay()) {
sl_reply_error();
}
```
Network flow:
```
12:30:00 INVITE udp:10.0.0.18:5060 => udp:185.0.0.34:5060 (internal request to proxy)
12:30:00 INVITE udp:185.0.0.34:5060 => udp:185.10.20.30:5060 (relaying from proxy to interconnect)
^^^^^^^^^^
(request times out after 1 second, proxy will do a failover to the next endpoint)
12:30:01 INVITE udp:10.0.0.14:5060 => udp:185.10.20.31:5060 (relaying to next interconnect address)
^^^^^^^^^
```
#### Log Messages
Attempt to see where it goes wrong:
```
onsend_route {
xinfo("[$RAut] [$Rut] [$sas]\n");
xinfo("$snd(buf)\n");
}
```
```
INFO: [sip:185.0.0.34:5060;transport=udp] [sip:185.0.0.34:5060;transport=udp] [udp:10.0.0.18:5060]
INFO: INVITE sip:+1234567890@transit.net;user=phone SIP/2.0#015#012Record-Route: <sip:185.0.0.34;lr;ftag=tDr7m6erX1N3D>#015#012Via: SIP/2.0/UDP 10.0.0.14;branch=z9hG4bKafe7.7fb590e263fa44677514193a6a1156ce.1#015#012Via: SIP/2.0/UDP 10.0.0.18;received=10.0.0.18;rport=5060;branch=z9hG4bK6t59a17N60FcB ...
```
So the `Record-Route` seems to be correct, but the top most `Via` header shows the private IP address. The message is being sent from the private IP address as well and never reaches the second address from the interconnect.
### Possible Solutions
A workaround to add `$fs = "udp:185.0.0.34:5060"` in the `onsend_route` seems to be effective.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.2.3 (x86_64/linux)
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: unknown
compiled with gcc 7.4.0
```
* **Operating System**:
```
Ubuntu 18.04 LTS
Linux proxy4 4.15.0-64-generic #73-Ubuntu SMP Thu Sep 12 13:16:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
```
--
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/2152
### Description
Kamailio fails to forward in-dialog request over TCP/TLS/WS/WSS connection.
### Troubleshooting
kamailio 5.2 branch has a commit
09ac3e47ef79dbd599b7dec5b84ae3b792f025ed cherry picked from master branch.
It makes sense for master because get_send_socket2() behavior has
changed and function became smarter and also there were some patches to
propagate connection it to the uac structure.
After applying this patch to 5.2.x kamailio searches for an outgoing socket, receives the first one due to limitations of get_send_socket2() and SND_F_FORCE_SOCKET flag. Then it fails to find an existing TCP connection by destination ip:port since it searches for a connection associated with a wrong socket.
#### Log Messages
<!--
Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
Dec 11 21:33:49 kamailio[17999]: WARNING: <core> [core/msg_translator.c:2832]: via_builder(): TCP/TLS connection (id: 0) for WebSocket could not be found
Dec 11 21:33:49 kamailio[17999]: ERROR: tm [t_msgbuilder.c:1372]: assemble_via(): via building failed
Dec 11 21:33:49 kamailio[17999]: ERROR: tm [t_msgbuilder.c:1540]: build_uac_req(): error while assembling Via
Dec 11 21:33:49 kamailio[17999]: ERROR: tm [uac.c:517]: t_uac_prepare(): Error while building message
Dec 11 21:33:49 kamailio[17999]: ERROR: presence [notify.c:1798]: send_notify_request(): in function tmb.t_request_within
Dec 11 21:33:49 kamailio[17999]: ERROR: presence [notify.c:1897]: notify(): sending Notify not successful
Dec 11 21:33:49 kamailio[17999]: ERROR: presence [notify.c:1491]: publ_notify(): Could not send notify for message-summary
```
### Possible Solutions
Delete mentioned commit from the 5.2 branch.
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
5.2.5
```
* **Operating System**:
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `uname -a`)
-->
```
linux
```
--
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/2181
Just FYI/notice when preparing for Fedora 32 builds that for `src/modules/siputils`, `contact_flds_separator` is defined both in `contact_ops.h` and `siputils.c`
```
make[2]: Entering directory '/builddir/build/BUILD/kamailio-5.3.2/src/modules/siputils'
gcc -shared -Wl,-O2 -Wl,-E -pthread -rdynamic -ldl -Wl,-Bsymbolic-functions sipops.o config.o siputils.o rpid.o ring.o contact_ops.o chargingvector.o options.o utils.o checks.o -L../../lib/srdb1/ -lsrdb1 -Wl,-rpath,/builddir/build/BUILD/kamailio-5.3.2/src/lib/srdb1 -o siputils.so
make[2]: Leaving directory '/builddir/build/BUILD/kamailio-5.3.2/src/modules/siputils'
/usr/bin/ld: contact_ops.o:/builddir/build/BUILD/kamailio-5.3.2/src/modules/siputils/contact_ops.h:51: multiple definition of `contact_flds_separator'; siputils.o:/builddir/build/BUILD/kamailio-5.3.2/src/modules/siputils/contact_ops.h:51: first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [../../Makefile.rules:191: siputils.so] Error 1
make[1]: *** [Makefile:511: modules] Error 1
make: *** [Makefile:34: every-module] Error 2
```
--
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/2235