### Description
Ability to flush on-demand htable from memory to DB.
### Possible Solutions
Implement a new RPC `htable.flush` command
Flush hash table to database.
Name: dhtable.flush
Parameters:
htable : Name of the hash table to flush
Example:
...
kamcmd htable.flush
...
--
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/2201
Tracking here the issue exposed by @linuxmaniac via PR #924, as it was merged and then reverted (by #1248), so anyone can be aware of as well as comment/propose solutions for it.
> Add "-fno-strict-aliasing" to compilation flags
>
> Fixes a slew of:
> "dereferencing type-punned pointer will break strict-aliasing rules"
> warnings from GCC for lines of the form:
> Py_INCREF(Py_True);
> and
> Py_INCREF(Py_False);
>
> due to the cast from PyIntObject* to PyObject*
>
> GCC is technically correct here; see:
> http://www.python.org/dev/peps/pep-3123/
> though this is unlikely to lead to non-working machine code.
The initial proposed patch for `src/modules/app_python/Makefile` is:
```
@@ -22,6 +22,8 @@ ifeq ($(OS), freebsd)
LIBS+=-pthread
endif
+# python2 https://www.python.org/dev/peps/pep-3123/
+DEFS+=-fno-strict-aliasing
DEFS+=-I${PYTHON_INCDIR}
DEFS+=-DKAMAILIO_MOD_INTERFACE
```
--
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/1249
Hello,
I got this message under some circumstances (the number called)
Jun 12 15:15:01 proxy1 /usr/sbin/kamailio[16096]: ERROR: <core> [core/parser/sdp/sdp.c:228]: set_sdp_payload_fmtp(): Invalid payload location
What means "Payload location" ?
SDP Debug from the callee:
Jun 12 15:15:01 proxy1 /usr/sbin/kamailio[16096]: DEBUG: sdpops [sdpops_mod.c:1626]: sdp_get_helper(): Found SDP v=0#015#012o=- 5793 1 IN IP4 192.168.50.50#015#012s=-#015#012t=0 0#015#012m=audio 24734 RTP/AVP 8 101#015#012c=IN IP4 217.112.190.117#015#012a=rtpmap:101 telephone-event/8000#015#012a=fmtp:18 annexa=yes#015#012a=fmtp:101 0-15#015#012a=ptime:30#015#012a=silenceSupp:off - - - -#015#012a=sendrecv#015#012
SDP Debug called pbx:
Jun 12 15:15:01 proxy1 /usr/sbin/kamailio[16097]: DEBUG: sdpops [sdpops_mod.c:1626]: sdp_get_helper(): Found SDP v=0#015#012o=root 1673681431 1673681431 IN IP4 217.112.180.5#015#012s=Asterisk PBX 11.25.1#015#012c=IN IP4 217.112.180.5#015#012t=0 0#015#012m=audio 10884 RTP/AVP 8 101#015#012a=rtpmap:8 PCMA/8000#015#012a=rtpmap:101 telephone-event/8000#015#012a=fmtp:101 0-16#015#012a=ptime:20#015#012a=sendrecv#015#012
--
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/1983
### 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
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [ ] Commit message has the format required by CONTRIBUTING guide
- [ ] Commits are split per component (core, individual modules, libs, utils, ...)
- [ ] Each component has a single commit (if not, squash them into one commit)
- [ ] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [ ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
These commits create a CDR addressed engine, similar to the one that acc module exports for acc message accounting. Such an engine made an extension module like acc_json possible. This CDR engine is then used in acc_json to write the functionality for logging CDRs in JSON format.
I have added functions to the API exported by acc module instead of creating another separate CDR API, as I thought this is cleaner.
I only implemented the acc_json logging to syslog (no message queue support yet).
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2107
-- Commit Summary --
* acc: adding CDR engine functionality
* acc_json: adding CDR as JSON functionality
-- File Changes --
M src/modules/acc/acc_api.h (38)
M src/modules/acc/acc_cdr.c (41)
M src/modules/acc/acc_cdr.h (6)
M src/modules/acc/acc_logic.c (10)
M src/modules/acc/acc_logic.h (2)
M src/modules/acc/acc_mod.c (93)
M src/modules/acc_json/acc_json_mod.c (131)
M src/modules/acc_json/acc_json_mod.h (4)
M src/modules/acc_json/doc/acc_json_admin.xml (54)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2107.patchhttps://github.com/kamailio/kamailio/pull/2107.diff
--
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/pull/2107
### Description
In plain Kamailio language, we used the following line:
```
if ( sdp_with_transport("RTP/SAVP") ) {
```
Now we wanted to convert that to Kemi. Turns out, the `sdp_with_transport()` function is not exported to Kemi. So we thought, we could use `sdp_transport()` to work around the missing function. This works as long as there is only one transport in SDP.
But if a phone sends two media streams in SDP, one with RTP/AVP and one with RTP/SAVP, `sdp_transport()` will return `-2`.
### Troubleshooting
#### Reproduction
Send an INVITE to Kamailio and try to get the transport type into a variable with ` sdp_transport()`. This can be done for example with a snom phone where in the rtp section of the identity configuration the parameter "RTP/SAVP" is set to "optional".
#### Log Messages
```
Jan 10 13:08:13 hagi /usr/sbin/kamailio[7136]: DEBUG: app_jsdt [app_jsdt_api.c:996]: sr_kemi_jsdt_exec_func_ex(): param[0] for: sdp_transport is str: $avp(mediaTransport)
Jan 10 13:08:13 hagi /usr/sbin/kamailio[7136]: DEBUG: <core> [core/usr_avp.c:887]: parse_avp_ident(): Parsing 'mediaTransport'
Jan 10 13:08:13 hagi /usr/sbin/kamailio[7136]: DEBUG: <core> [core/pvapi.c:368]: pv_cache_add(): pvar [$avp(mediaTransport)] added in cache
Jan 10 13:08:13 hagi /usr/sbin/kamailio[7136]: DEBUG: sdpops [sdpops_mod.c:1214]: sdp_transport_helper(): stream 0 of 0 - transport [RTP/SAVP]
Jan 10 13:08:13 hagi /usr/sbin/kamailio[7136]: DEBUG: sdpops [sdpops_mod.c:1214]: sdp_transport_helper(): stream 1 of 0 - transport [RTP/AVP]
Jan 10 13:08:13 hagi /usr/sbin/kamailio[7136]: DEBUG: sdpops [sdpops_mod.c:1219]: sdp_transport_helper(): no common transport
```
### Additional Information
We are still running Kamailio 5.1.x, but as far as I could see, the behavior has not changed since then.
--
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/2194