Set of errors during kamailio build on alpine.
```
CC (gcc) [M tls.so] tls_verify.o
CC (gcc) [M tls.so] tls_ct_wrq.o
CC (gcc) [M tls.so] tls_rpc.o
CC (gcc) [M tls.so] tls_bio.o
tls_bio.c:88:14: error: static declaration of 'BIO_get_data' follows non-static declaration
static void *BIO_get_data(BIO *b)
^~~~~~~~~~~~
In file included from tls_bio.h:27:0,
from tls_bio.c:25:
/usr/include/openssl/bio.h:608:8: note: previous declaration of 'BIO_get_data' was here
void *BIO_get_data(BIO *a);
^~~~~~~~~~~~
tls_bio.c:92:13: error: static declaration of 'BIO_set_data' follows non-static declaration
static void BIO_set_data(BIO *b, void *ptr)
^~~~~~~~~~~~
In file included from tls_bio.h:27:0,
from tls_bio.c:25:
/usr/include/openssl/bio.h:609:7: note: previous declaration of 'BIO_set_data' was here
void BIO_set_data(BIO *a, void *ptr);
^~~~~~~~~~~~
tls_bio.c:96:13: error: static declaration of 'BIO_set_init' follows non-static declaration
static void BIO_set_init(BIO *b, int init)
^~~~~~~~~~~~
In file included from tls_bio.h:27:0,
from tls_bio.c:25:
/usr/include/openssl/bio.h:610:7: note: previous declaration of 'BIO_set_init' was here
void BIO_set_init(BIO *a, int init);
^~~~~~~~~~~~
make[2]: *** [../../Makefile.rules:100: tls_bio.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:511: modules] Error 1
make: *** [Makefile:27: all] Error 2
make[1]: Leaving directory '/usr/src/kamailio/pkg/kamailio/alpine/src/kamailio-25c4b9eb56e0c75daaa98256c590947daa2b9906/src'
>>> ERROR: kamailio: all failed
>>> kamailio: Uninstalling dependencies...
(1/1) Purging .makedepends-kamailio (0)
OK: 448 MiB in 141 packages
pre_build hook failed! (1)
```
First failed build on commit 25c4b9eb56e0c75daaa98256c590947daa2b9906
Look as this commit not related to `tls` and think issue may be on alpine dist change.
--
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/1509
<!-- 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 -->
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] 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
- [x] 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 -->
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
During query operations string fields inside result structure db1_res_t could be corrupted because of incorrect usage of bson memory.
This issue is reproduced when we need to read more than 150 documents from the database. So that is why this issue still exists.
Firstly bson_iter_utf8 function returns pointer to memory which is allocated inside bson memory and which is used multiple times. So the data must be copied into Kamailio memory instead storing that pointer. The pointer becomes invalid after some time.
Secondly, this pointer must not be freed by the caller of bson_iter_utf8. At the current version bson allocated pointer is freed by Kamailio function pkg_free like it is was allocated by pkg_malloc.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1508
-- Commit Summary --
* Fixed db_mongodb module. UTF8 string must be copied into Kamailio memory.
* Fixed indentation.
-- File Changes --
M src/modules/db_mongodb/mongodb_dbase.c (3)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1508.patchhttps://github.com/kamailio/kamailio/pull/1508.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/1508
### Description
Hi everyone.
I integrate Kamailio with CGRateS and found a strange behaviour.
I made a call using Jitsi from 1001 to 1003 (configured before in CGRateS to disconnect after 12 seconds).
The call is disconnected correctly but from Kamailio got 3 CGR_CALL_END events with the same data
which in CGRateS generate an error because from these events CGRateS generate 3 cdrs and all 3 with the same unique key.
Is this a bug or is something wrong with the config?
Kamailio config : https://github.com/cgrates/cgrates/tree/master/data/tutorials/kamevapi/kama…
### NGREP Events between CGRateS and Kamailio
T 2018/04/24 07:55:14.200094 127.0.0.1:8448 -> 127.0.0.1:36774 [AP]
269:{"event":"CGR_AUTH_REQUEST",
.."tr_index":"12566",
.."tr_label":"1148670067",
.."cgr_subsystems":"*attributes;*resources;*accounts;*suppliers",
.."RequestType":"*prepaid",
.."Tenant":"cgrates.org",
.."Account":"1001",
.."Destination":"1003",
.."SetupTime":"1524570914"},
##
T 2018/04/24 07:55:14.227815 127.0.0.1:36774 -> 127.0.0.1:8448 [AP]
214:{"Event":"CGR_AUTH_REPLY","TransactionIndex":"12566","TransactionLabel":"1148670067","Attributes":"","ResourceAllocation":"SPECIAL_1003","MaxUsage":13,"Suppliers":"supplier2,supplier1","ThresholdHits":0,"Error":""},
##
T 2018/04/24 07:55:17.538695 127.0.0.1:8448 -> 127.0.0.1:36774 [AP]
306:{"event":"CGR_CALL_START",
.."h_entry":"226",
.."h_id":"8446",
.."cgr_subsystems":"*resources;*accounts",
.."OriginID":"f1c3db6e9aea754291eed5cdc944cdd2@0:0:0:0:0:0:0:0;2fc2c199",
.."RequestType":"*prepaid",
.."Tenant":"cgrates.org",
.."Account":"1001",
.."Destination":"1003",
.."AnswerTime":"1524570917"},
##
T 2018/04/24 07:55:29.546055 127.0.0.1:36774 -> 127.0.0.1:8448 [AP]
99:{"Event":"CGR_SESSION_DISCONNECT","HashEntry":"226","HashId":"8446","Reason":"INSUFFICIENT_CREDIT"},
##
T 2018/04/24 07:55:29.546285 127.0.0.1:8448 -> 127.0.0.1:36774 [AP]
285:{"event":"CGR_CALL_END",
.."cgr_subsystems":"*resources;*accounts",
.."OriginID":"f1c3db6e9aea754291eed5cdc944cdd2@0:0:0:0:0:0:0:0;2fc2c199",
.."RequestType":"*prepaid",
.."Tenant":"cgrates.org",
.."Account":"1001",
.."Destination":"1003",
.."AnswerTime":"1524570917",
.."Usage":"12"},
##
T 2018/04/24 07:55:29.546561 127.0.0.1:8448 -> 127.0.0.1:36774 [AP]
285:{"event":"CGR_CALL_END",
.."cgr_subsystems":"*resources;*accounts",
.."OriginID":"f1c3db6e9aea754291eed5cdc944cdd2@0:0:0:0:0:0:0:0;2fc2c199",
.."RequestType":"*prepaid",
.."Tenant":"cgrates.org",
.."Account":"1001",
.."Destination":"1003",
.."AnswerTime":"1524570917",
.."Usage":"12"},
##
T 2018/04/24 07:55:29.546664 127.0.0.1:8448 -> 127.0.0.1:36774 [AP]
285:{"event":"CGR_CALL_END",
.."cgr_subsystems":"*resources;*accounts",
.."OriginID":"f1c3db6e9aea754291eed5cdc944cdd2@0:0:0:0:0:0:0:0;2fc2c199",
.."RequestType":"*prepaid",
.."Tenant":"cgrates.org",
.."Account":"1001",
.."Destination":"1003",
.."AnswerTime":"1524570917",
.."Usage":"12"},
#
### Additional Information
```
kamailio -V
version: kamailio 5.1.3 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, 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_LISTEN 16, 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 4.9.2
```
* **Operating System**:
```
root@teo:/home/teo# cat /etc/debian_version
8.10
```
Thank you in advance
TeoV
--
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/1512