Module: kamailio
Branch: master
Commit: 93934221231897106a1933d37ffd3c046fed47a9
URL: https://github.com/kamailio/kamailio/commit/93934221231897106a1933d37ffd3c0…
Author: Anthony Messina <amessina(a)messinet.com>
Committer: Anthony Messina <amessina(a)messinet.com>
Date: 2020-11-14T11:17:29-06:00
acc: docs - database column constraint alteration for acc_extra_nullable and cdr_extra_nullable [skip ci]
---
Modified: src/modules/acc/doc/acc_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/93934221231897106a1933d37ffd3c0…
Patch: https://github.com/kamailio/kamailio/commit/93934221231897106a1933d37ffd3c0…
---
diff --git a/src/modules/acc/doc/acc_admin.xml b/src/modules/acc/doc/acc_admin.xml
index d1c007312e..f88d403d2b 100644
--- a/src/modules/acc/doc/acc_admin.xml
+++ b/src/modules/acc/doc/acc_admin.xml
@@ -634,6 +634,10 @@ modparam("acc", "acc_prepare_always", 1)
set to 0, the value is saved as empty string (the existing behavior).
</para>
<para>
+ Database columns may need to be altered to DROP NOT NULL constraints
+ and DROP DEFAULT values in order to accept NULL values.
+ </para>
+ <para>
Default value is 0.
</para>
<example>
@@ -1157,6 +1161,10 @@ modparam("acc", "cdr_extra", "c1=$dlg_var(caller);c2=$dlg_var(callee)"
If set to 1, custom CDR fields not defined in config operation (or set to $null) will be saved as NULL.
</para>
<para>
+ Database columns may need to be altered to DROP NOT NULL constraints
+ and DROP DEFAULT values in order to accept NULL values.
+ </para>
+ <para>
Default value is 0.
</para>
<example>
Module: kamailio
Branch: master
Commit: eb8049fee6695744731b2c17735bf3d7788744ac
URL: https://github.com/kamailio/kamailio/commit/eb8049fee6695744731b2c17735bf3d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: GitHub <noreply(a)github.com>
Date: 2020-11-16T09:04:05+01:00
Merge pull request #2550 from amessina/master
acc: docs - database column constraint alteration for acc_extra_nullaâ¦
---
Modified: src/modules/acc/doc/acc_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/eb8049fee6695744731b2c17735bf3d…
Patch: https://github.com/kamailio/kamailio/commit/eb8049fee6695744731b2c17735bf3d…
---
diff --git a/src/modules/acc/doc/acc_admin.xml b/src/modules/acc/doc/acc_admin.xml
index d1c007312e..f88d403d2b 100644
--- a/src/modules/acc/doc/acc_admin.xml
+++ b/src/modules/acc/doc/acc_admin.xml
@@ -634,6 +634,10 @@ modparam("acc", "acc_prepare_always", 1)
set to 0, the value is saved as empty string (the existing behavior).
</para>
<para>
+ Database columns may need to be altered to DROP NOT NULL constraints
+ and DROP DEFAULT values in order to accept NULL values.
+ </para>
+ <para>
Default value is 0.
</para>
<example>
@@ -1157,6 +1161,10 @@ modparam("acc", "cdr_extra", "c1=$dlg_var(caller);c2=$dlg_var(callee)"
If set to 1, custom CDR fields not defined in config operation (or set to $null) will be saved as NULL.
</para>
<para>
+ Database columns may need to be altered to DROP NOT NULL constraints
+ and DROP DEFAULT values in order to accept NULL values.
+ </para>
+ <para>
Default value is 0.
</para>
<example>
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for feature requests.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
If you submit a feature request (or enhancement) add the description of what you would like to be added.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
Just as in #1378, allowing nullable entries for SQL would be appreciated in acc `db_extra` and acc `multi_leg_info`.
### Expected behavior
Empty/NULL values should be inserted with `NULL`. For example, I can't create a `timestamp without time zone` to be used with multi-leg-accounting as follows.
```
modparam("acc", "multi_leg_info",
"leg_dst_user=$avp(leg_dst_user);"
"leg_dst_domain=$avp(leg_dst_domain);"
"leg_sip_code=$avp(leg_sip_code);"
"leg_time=$avp(leg_time);"
"leg_to_tag=$avp(leg_to_tag)")
$avp(leg_time)=$timef(%F %T)
```
#### Actual observed behavior
Emplty/NULL values are inserted with `''` which fails as `''` is invalid input for a `timestamp without time zone` column.
#### 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).
-->
```
db_postgres [km_dbase.c:266]: db_postgres_submit_query(): 0x7f26f7fb6cc8 PQsendQuery Error: ERROR: invalid input syntax for type timestamp: ""
```
#### SIP Traffic
<!--
If the issue is exposed by processing specific SIP messages, grab them with ngrep or save in a pcap file, then add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
(paste your sip traffic here)
```
### Possible Solutions
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a improvement.
-->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
ersion: kamailio 5.4.1-8.gitd43872c11e.fc32.2 (x86_64/linux) 09fd6a
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_BLACKLIST, 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: 09fd6a
compiled on 00:00:00 Oct 22 2020 with gcc 10.2.1
```
* **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 host 5.8.15-201.fc32.x86_64 #1 SMP Thu Oct 15 15:56:44 UTC 2020 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/2531
### Description
When specifying a _record_route_advertised_address()_ before using the uac_replace function (for changing the FROM and TO Header field URIs), the rr param static buffer doesn't get emptied and a fallowing CALL (not a request in the same call) contains the rr params of the first call placed after restarting kamailio (to get the buffer resetted).
### Troubleshooting
Restarting kamailio will reset the wrong buffer pointer and gets you another functioning call.
Alternatively place the _record_route_advertised_address()_ after using uac_replace function.
#### Reproduction
use record_route_advertised_address() before doing a uac_replace. This will get the vst and vsf parameters doubled in the rr of the second call after kamailio is restarted. When you place a call the first call proxied will carry only one set of vsf & vst parameters in the RR. The second call will carry the vst & vsf of the first call and a set of vst & vsf of the second call. If the uac_replace is replacing the same URIs the contents of the two sets of vsf and vst parameters in the RR Header will be identical.
uac.so config:
loadmodule "uac.so"
modparam("uac", "restore_mode","auto");
#### Analysis
record_route() empties the RR param static buffer as follows, if it contains other message's params:
if (rr_param_buf.len && rr_param_msg!=_m->id) {
/* rr_params were set for a different message -> reset buffer */
rr_param_buf.len = 0;
}
But unfortunately, record_route_advertised_address() / record_route_preset() does not do this – it does NOT check/clean the buffer before adding RR.
So if the static buffer contains old entries (e.g. from an old call's subsequent request), wrong rr parameters are added.
This happens with uac module: restore_uri() is called for subsequent requests (via callback).
restore_uri() calls (unnecessarily):
if ( uac_rrb.add_rr_param(msg, &add_to_rr)!=0 ) {
LM_ERR("add rr param failed\n");
goto failed;
}
So, if record_route has not yet been performed at this stage, add_rr_param() adds an entry to the static rr param buffer.
(for subsequent request, record_route won't be performed)
If, for a following call, record_route_advertised_address() / record_route_preset() is called, the buffer is not checked/emptied, and old/wrong rr params are added.-->
```
#### SIP Traffic
```
Record-Route URI [truncated]: sip:my.node.com;transport=tls;r2=on;ftag=2ccb63ad;lr;vsf=AAAAAAAAAAAAAAAAAAAAADkIA0Mdsdfsdfhc2guY29tO3VzZXI9cGhvN0LmNvbQbmU-;vst=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMQEEEESwksdfsdfhddCBteAgccAQN0LmNvbQ-
Record-Route Host Part: my.node.com
Record-Route URI parameter: transport=tls
Record-Route URI parameter: r2=on
Record-Route URI parameter: ftag=2ccb63ad
Record-Route URI parameter: lr
Record-Route URI parameter: vsf=AAAAAAAAAAAAAAAAAAAAADkIA0Mdsdfsdfhc2guY29tO3VzZXI9cGhvN0LmNvbQbmU-
Record-Route URI parameter: vst=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMQEEEESwksdfsdfhddCBteAgccAQN0LmNvbQ--
Record-Route URI parameter: vst=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMQEEEESwksdfsdfhddCBteAgccAQN0LmNvbQ--
Record-Route URI parameter: vsf=AAAAAAAAAAAAAAAAAAAAADkIA0Mdsdfsdfhc2guY29tO3VzZXI9cGhvN0LmNvbQbmU-
Record-Route URI parameter: did=4a8.56a2
URI, vsf & vst anonymised
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.2.7 (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, 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: unknown
compiled with gcc 8.3.0
```
* **Operating System**:
```
4.19.0-10-amd64 #1 SMP Debian 4.19.132-1 (2020-07-24) 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/2486
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for feature requests.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
If you submit a feature request (or enhancement) add the description of what you would like to be added.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
fix_nated_sdp() function with an IP address as argument supports modifying the media line and the connection line but not a=rtcp. It would be helpful if it did that line too.
### Expected behavior
a=rtcp:<port> IN ip4 <new IP>
#### Actual observed behavior
No modification
--
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/2459
**1**
```
CC (gcc) [kamailio] core/dst_blocklist.o
CC (gcc) [kamailio] core/endianness.o
CC (gcc) [kamailio] core/error.o
core/dns_cache.c: In function 'dns_sip_resolve':
core/dns_cache.c:3303:19: warning: 'origproto' may be used uninitialized in this function [-Wmaybe-uninitialized]
3303 | if(proto) *proto=origproto;
| ~~~~~~^~~~~~~~~~
core/dns_cache.c:3257:16: note: 'origproto' was declared here
3257 | char n_proto, origproto;
| ^~~~~~~~~
CC (gcc) [kamailio] core/events.o
CC (gcc) [kamailio] core/flags.o
CC (gcc) [kamailio] core/fmsg.o
CC (gcc) [kamailio] core/forward.o
CC (gcc) [kamailio] core/hash_func.o
```
**2**
```
CC (gcc) [M crypto.so] api.o
CC (gcc) [M crypto.so] crypto_aes.o
CC (gcc) [M crypto.so] crypto_evcb.o
CC (gcc) [M crypto.so] crypto_mod.o
crypto_mod.c: In function 'ki_crypto_hmac_sha256_helper':
crypto_mod.c:316:29: warning: pointer targets in passing argument 1 of 'base64url_enc' differ in signedness [-Wpointer-sign]
316 | val.rs.len = base64url_enc((unsigned char *)digest, digest_len, (unsigned char *)val.rs.s, pv_get_buffer_size()-1);
| ^~~~~~~~~~~~~~~~~~~~~~~
| |
| unsigned char *
In file included from crypto_mod.c:33:
../../core/basex.h:867:25: note: expected 'char *' but argument is of type 'unsigned char *'
867 | int base64url_enc(char *in, int ilen, char *out, int osize);
| ~~~~~~^~
crypto_mod.c:316:66: warning: pointer targets in passing argument 3 of 'base64url_enc' differ in signedness [-Wpointer-sign]
316 | val.rs.len = base64url_enc((unsigned char *)digest, digest_len, (unsigned char *)val.rs.s, pv_get_buffer_size()-1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| |
| unsigned char *
In file included from crypto_mod.c:33:
../../core/basex.h:867:45: note: expected 'char *' but argument is of type 'unsigned char *'
867 | int base64url_enc(char *in, int ilen, char *out, int osize);
| ~~~~~~^~~
At top level:
crypto_mod.c:343:12: warning: 'ki_crypto_hmac_sha256' defined but not used [-Wunused-function]
343 | static int ki_crypto_hmac_sha256(sip_msg_t* msg, str *ins, str *keys, str *dpv)
| ^~~~~~~~~~~~~~~~~~~~~
CC (gcc) [M crypto.so] crypto_uuid.o
LD (gcc) [M crypto.so] crypto.so
```
**3**
```
LD (gcc) [M janssonrpcc.so] janssonrpcc.so
CC (gcc) [M http_async_client.so] async_http.o
CC (gcc) [M http_async_client.so] hm_hash.o
In file included from http_multi.h:40,
from async_http.h:48,
from async_http.c:53:
/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
1 | #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
| ^~~~~~~
CC (gcc) [M http_async_client.so] http_async_client_mod.o
In file included from http_multi.h:40,
from async_http.h:48,
from http_async_client_mod.c:59:
/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
1 | #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
| ^~~~~~~
CC (gcc) [M http_async_client.so] http_multi.o
In file included from http_multi.h:40,
from http_multi.c:35:
/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
1 | #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
| ^~~~~~~
LD (gcc) [M http_async_client.so] http_async_client.so
CC (gcc) [M kazoo.so] const.o
CC (gcc) [M kazoo.so] kazoo.o
CC (gcc) [M kazoo.so] kz_amqp.o
```
**4**
```
CC (gcc) [M sctp.so] sctp_rpc.o
CC (gcc) [M sctp.so] sctp_server.o
CC (gcc) [M sctp.so] sctp_stats.o
sctp_server.c: In function 'sctp_handle_notification':
sctp_server.c:2314:48: warning: taking address of packed member of 'struct sctp_paddr_change' may result in an unaligned pointer value [-Waddress-of-packed-member]
2314 | strcpy(su_buf, su2a((union sockaddr_union *)&snp->sn_paddr_change
| ^~~~~~~~~~~~~~~~~~~~~
2315 | .spc_aaddr,
| ~~~~~~~~~~
LD (gcc) [M sctp.so] sctp.so
CC (gcc) [M acc_radius.so] acc_radius_mod.o
LD (gcc) [M acc_radius.so] acc_radius.so
CC (gcc) [M auth_radius.so] auth_radius.o
```
--
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/2543