Module: kamailio
Branch: master
Commit: 24a3a172dbdecb6e987df943a3ad1acb4da664b5
URL: https://github.com/kamailio/kamailio/commit/24a3a172dbdecb6e987df943a3ad1ac…
Author: Donato Sciarra <donato.sciarra(a)bmw.de>
Committer: Donato Sciarra <donato.sciarra(a)bmw.de>
Date: 2020-04-28T10:33:23+02:00
core: do not use tcp id for lookup if not needed
In case the first lookup (with tcp id) is not successfull, the second
attempt should have been performed without a tcp id.
Issue was introduced with dc43750644 (new global parameter
tcp_connection_match) in 5.3.
---
Modified: src/core/tcp_main.c
---
Diff: https://github.com/kamailio/kamailio/commit/24a3a172dbdecb6e987df943a3ad1ac…
Patch: https://github.com/kamailio/kamailio/commit/24a3a172dbdecb6e987df943a3ad1ac…
---
diff --git a/src/core/tcp_main.c b/src/core/tcp_main.c
index e57a29d99e..89e3b56b7c 100644
--- a/src/core/tcp_main.c
+++ b/src/core/tcp_main.c
@@ -1967,7 +1967,7 @@ int tcp_send(struct dest_info* dst, union sockaddr_union* from,
if (likely(port)){
/* try again w/o id */
if(tcp_connection_match==TCPCONN_MATCH_STRICT) {
- c=tcpconn_lookup(dst->id, &ip, port, from, try_local_port, con_lifetime);
+ c=tcpconn_lookup(0, &ip, port, from, try_local_port, con_lifetime);
} else {
c=tcpconn_get(0, &ip, port, from, con_lifetime);
}
Hello,
(cross-posting because it is relevant to know where users need to run
Kamailio as well as what developers tend to use for coding, but replies
can go to one or the other list).
Somehow I tried to stay close to ANSI-C/C90 with C coding style, for the
reason of being compatible as much as possible with old compiles and
niche/embedded systems. But I noticed that there are couple of C99
extensions in the core, like inline functions, variadic macros (the
debugging macros), use of 'long long' or line comments starting with
"//" (not so many, but still such comment style is used). Although I
haven't searched for occurrences in core, but I remember seeing
designated initializers (or initializing a structure by field names).
These are part of C99, as listed by:
* https://en.wikipedia.org/wiki/C99#Design
Although likely GCC had some of them like custom extensions before the
standard was out.
On the other hand, newer standard C11 made some of those extensions
optional:
*
https://en.wikipedia.org/wiki/C11_(C_standard_revision)#Optional_features
So, my email here is to figure out if we should consider C99 as the
requirement for adding C code or be more restrictive because there are
still cases of usage on very specific systems that do not have such C
compiler. We can eventually make a list of what is accepted or not from
the recent versions of C standard to stay as much as possible portable
across Unix'es.
>From develeopers perspective, it would be good to learn if they use (in
other projects, etc.) extensions of the new standards that they found
useful and simplify their programming work.
Cheers,
Daniel
--
Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
### Description
I tried to use the `$env(NAME)` pseudovariable as argument for `modparam()` calls but evidently the result was empty.
### Troubleshooting
#### Reproduction
Set up `auth_ephemeral` and add this to your configuration:
```
modparam("auth_ephemeral", "secret", "$env(AUTH_EPHEMERAL_SECRET)")
```
Now export `AUTH_EPHEMERAL_SECRET=something` and start Kamailio with sufficient debug output. You'll see that Kamailio literally uses `$env(AUTH_EPHEMERAL_SECRET)` as secret instead of inserting the value of the environment variable.
#### Log Messages
```
kamailio_1 | 17(23) DEBUG: auth_ephemeral [authorize.c:136]: do_auth(): secret: $env(AUTH_EPHEMERAL_SECRET) (27)
```
### Possible Solutions
Replacement of environment variables should be supported in `modparams()`. (And possibly in *all* functions.)
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.2.1 (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 5.3.1
```
* **Operating System**:
```
$ uname -a
Linux e2193249aa45 4.4.0-128-generic #154-Ubuntu SMP Fri May 25 14:15:18 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
```
(Using the Docker image `kamailio/kamailio:5.2.1-xenial` ATM.)
--
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/2276
Module: kamailio
Branch: 5.2
Commit: fb937491f4222960a7cddaa73853cb2dd08672f7
URL: https://github.com/kamailio/kamailio/commit/fb937491f4222960a7cddaa73853cb2…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2020-04-27T14:31:53+02:00
modules: readme files regenerated - modules ... [skip ci]
---
Modified: src/modules/rtpengine/README
---
Diff: https://github.com/kamailio/kamailio/commit/fb937491f4222960a7cddaa73853cb2…
Patch: https://github.com/kamailio/kamailio/commit/fb937491f4222960a7cddaa73853cb2…
---
diff --git a/src/modules/rtpengine/README b/src/modules/rtpengine/README
index 1afd177f59..56e9caecfe 100644
--- a/src/modules/rtpengine/README
+++ b/src/modules/rtpengine/README
@@ -1860,13 +1860,6 @@ rtpengine_offer();
“direction=external” respectively. Useful for brevity or as
legacy option if the RTP proxy only supports two network
interfaces instead of multiple, arbitrarily named ones.
- + auto-bridge - this flag an alternative to the “internal” and
- “external” flags in order to do automatic bridging between
- IPv4 on the "internal network" and IPv6 on the "external
- network". Instead of explicitly instructing the RTP proxy to
- select a particular address family, the distinction is done by
- the given IP in the SDP body by the RTP proxy itself. Not
- supported by Sipwise rtpengine.
+ address-family=... - instructs the RTP proxy that the
recipient of this SDP body expects to see addresses of a
particular family. Possible values are “IP4” and “IP6”. For