Richard Fuchs
cf22d82932
MT#55283 eliminate input/output combination SSRC
...
Change-Id: I94636b7f6fb6fb31cd3bf332fffe0203e17f6c16
1 week ago
Richard Fuchs
19af8034a4
MT#55283 split SSRC hash into in and out
...
Change-Id: Ie1d378ee455e6fadb39a16f4c1d86f604870c536
1 week ago
Richard Fuchs
206e7db48b
MT#55283 scale redis timeouts
...
Change-Id: I7594f38da85a61c3846f8c5eb41ee01b63de36ac
2 weeks ago
Richard Fuchs
e12ba22a7c
MT#55283 scale redis timers
...
Change-Id: I8b9fcbb63ab096c7f1362f2df2f137258c45dc12
2 weeks ago
Richard Fuchs
27ff6e6f57
MT#55283 convert last_redis_update to int64_t
...
Change-Id: Id521b8b87ae2366c341e4b9871f253a24e750538
2 weeks ago
Richard Fuchs
f35881548d
MT#55283 convert async_last to int64_t
...
Change-Id: I86284e3b6c0dc9c52be0e2ee54bf63a0490cece1
2 weeks ago
Richard Fuchs
e097ee3701
MT#55283 convert time_t to int64_t
...
Change-Id: If77ae4a1cbc15442b3da786d5cc8268f88400707
2 weeks ago
Richard Fuchs
ad65c9096f
MT#55283 convert call structs to int64_t
...
Change-Id: If1a077d206d96914651b3e4624e7fc09f239ed09
2 weeks ago
Richard Fuchs
952429aa89
MT#55283 convert last_packet to int64_t
...
Change-Id: I21aec3c852a213c433b3a6c62d8b039303ec0f01
2 weeks ago
Richard Fuchs
0050ac5998
MT#55283 convert redis to int64_t
...
Change-Id: I5238eaf821512b21dac33716fb9c5109c9e0955c
2 weeks ago
Richard Fuchs
e92f260e7a
MT#55283 convert daemon/ to int64_t
...
Change-Id: Ie557204821fddfa5af0be96cc8f0ff2dd093fc7c
2 weeks ago
Richard Fuchs
165c42fb8e
MT#55283 convert calls to int64_t
...
Change-Id: I7c9a2229ba3eea418e009bb04def336476d2ec25
2 weeks ago
Richard Fuchs
c70510303a
MT#55283 convert rtpe_now to int64_t
...
First step in converting (almost) all timeval uses to int64_t
Change-Id: If20fd749c61c278273c535b68287df7e6f042808
2 weeks ago
Richard Fuchs
d75e44829d
MT#55283 replace UINT64F with PRIu64
...
Change-Id: I604226d2515dae6b7a348426b5e997dafc840042
2 weeks ago
Richard Fuchs
238dc9d5be
MT#55283 integrate ssrc_hash into upper objects
...
Change-Id: Ib8f78ef6bc3028fc342fe07253ebe628af322e55
2 weeks ago
Richard Fuchs
954bac923b
MT#55283 move SSRC hash from monologue to media
...
Change-Id: Id03603982692e9f6aef3b96d2a04514459eb30a7
3 weeks ago
Richard Fuchs
2a141c2f92
MT#55283 overhaul SSRC hash
...
Remove the actual hash and just keep a linked list. Always move most
recently used entries to the front of the list, which also obsoletes
tracking the last used time stamp.
Change-Id: Id277499228b538dd013a4442e9b5c5a4d247ff15
3 weeks ago
Richard Fuchs
75aa3038db
MT#55283 convert ssrc_hash to g_direct
...
Change-Id: I5cd5a308a8c5f6fefed94e4f594eee3a31b0f6fd
3 weeks ago
Richard Fuchs
4d8156bf91
MT#55283 remove remnants of g_slice
...
The GLib slice allocator has been obsoleted. Having a mixture of two
allocators can lead to hidden issues on systems that use different
implementations. Take the leap and replace everything with g_new/g_free.
Change-Id: I025c8383ef47b2c2472573360407fd6a6ca339b3
3 weeks ago
Richard Fuchs
1ad61d90bb
MT#55283 split up __get_consecutive_ports
...
Separate out the two distinct use cases of requesting a specific port,
and requesting (one or more) random ports.
Change-Id: Ifbe7725d8638d49f620c9f4b9445342d180c8770
2 months ago
Richard Fuchs
806d272f89
MT#55283 use bool for get_consecutive_ports
...
Change-Id: Ic4bfcaf2fe64874c5b108dda2c774bc7a46cd212
2 months ago
Richard Fuchs
48e971398c
MT#55283 convert bit field to bool
...
Change-Id: If2acf3bacadaf83ebc3a02c7c1d71aaa6a90258b
2 months ago
Richard Fuchs
eeeb2d8641
MT#55283 move socket_port_link into stream_fd
...
This allows us to simplify some function signatures
Change-Id: I58f65735ba84ec7a536b1b170d1ef90e266308f5
2 months ago
Richard Fuchs
80f7c20429
MT#55283 convert sockaddr_getaddrinfo to bool
...
Change-Id: I75e04bdda3b54fd9f7cbe9d6ff8c978e2bb2c2d1
3 months ago
Richard Fuchs
927c85e5ff
MT#55283 convert endpoint_parse_any to bool
...
Change-Id: Ia6fd64615591efe1dfd6de4cc70a5642ea777331
3 months ago
Richard Fuchs
3cce4ac230
MT#55283 convert sockaddr_parse_any_str to bool
...
Change-Id: Iaf9179bf1f55774bc9c63fd1238155f7ff3b7570
3 months ago
Richard Fuchs
5dd0a387a3
MT#55283 modernise timeval_from_us
...
Change-Id: I745365e9c0c3c055e6972d18ab4593b9589f55f5
3 months ago
Richard Fuchs
416ca38d25
MT#55283 allow overlapping port ranges
...
Change-Id: I6df35b8cc0687567d7c3c0fd6d44979345dca364
3 months ago
Richard Fuchs
6276b37cd2
MT#55283 use list pointer ops for port pool
...
Avoid repeated calls to the memory allocated for port pool list
management by picking out the list elements without freeing them,
storing them in the stream_fd object, and then returning them to the
list when the port is released.
Change-Id: I67cd5039e62e4d2965e85d7ba7f0454f08f40494
3 months ago
Richard Fuchs
ad6fb06b13
MT#55283 type safety for uid_alloc
...
Change-Id: I4b5975d22f2713b66edba128f0749461578f9cde
3 months ago
Richard Fuchs
02bccee56b
MT#55283 use typed queue for local_intf
...
Change-Id: Id7bf3804ab029bdf60d010b05e057bb7851645cd
3 months ago
Donat Zenichev
bebc6f8f31
MT#55283 redis: cover a usage of write DB with lock
...
Just cover it with already existing lock
used below, but move upper.
Fixes Covery Scan detected defect:
*** CID 1621443: Concurrent data access violations (MISSING_LOCK)
/daemon/redis.c: 2232 in json_restore_call()
2226 call_destroy(c);
2227 release_closed_sockets();
2228 if (must_release_pop) // avoid deadlock with redis_notify->lock below
2229 redis_ports_release_pop(false);
2230 must_release_pop = false;
2231
>>> CID 1621443: Concurrent data access violations (MISSING_LOCK)
>>> Accessing "rtpe_redis_write->db" without holding lock "redis.lock".
>>> Elsewhere, "redis.db" is written to with "redis.lock" held 1 out of 1 times.
2232 redis_select_db(rtpe_redis_write, rtpe_redis_write->db);
2233
2234 mutex_lock(&rtpe_redis_write->lock);
2235 redisCommandNR(rtpe_redis_write->ctx, "DEL " PB, PBSTR(callid));
2236 mutex_unlock(&rtpe_redis_write->lock);
2237
Change-Id: Iff3425451f82218480dcc08f42ea7bddbd6f672f
3 months ago
Richard Fuchs
fdabc9b59e
MT#55283 restore selected DB after delete
...
Deleting a call can have the side effect of changing the active Redis DB
on the writing instance. Restore the correct DB afterwards if needed.
Fixes #1905
Change-Id: I12dae767ffa5d25703e024d2ec59aa21ba9da101
3 months ago
Richard Fuchs
fb1ad3f0cf
MT#55283 properly support empty keyspace list
...
If keyspace notifications are used at all, the respective objects and
threads must be created during startup. This requires at least some
keyspace to be configured. To support usage without any keyspaces
initially (and add them during runtime), add a special case (set
keyspace to -1).
Convert all keyspace variables to signed ints. Ignore negative keyspace
numbers where appropriate. Support Redis endpoint addresses without
database number.
Fixes #1902
Change-Id: I45a3c87bc515f9b14e64ec1ec0906dde271b5f8d
3 months ago
Richard Fuchs
172f389395
MT#55283 safeguard against Redis connect failure
...
Avoids segfault is extra connection can't be established
Closes #1903
Change-Id: I6eb7315f6774015703c7ad036e08596f7f550d60
3 months ago
Richard Fuchs
3bbf4d94a1
MT#55283 bail if Redis contains garbage data
...
Change-Id: I76f21d6c44f04e063cb57dd04f1f631dead0600a
3 months ago
Richard Fuchs
2a46eb2cdc
MT#61368 change media_ids to typed hash table
...
Change-Id: I53e40d80d813eeee3edaebe557b3aa5c9e5b5733
5 months ago
Richard Fuchs
f0b309a6a3
MT#55283 use correct error message in logs
...
Cosmetic change only.
Change-Id: Ia3b3e8b0435c5637c6ac4ff23cd5f43ddf276220
5 months ago
Richard Fuchs
19aceecc17
MT#55283 use more appropriate helper function
...
The string might not be null terminated.
Change-Id: I09d64d69202c8ce7196b8d39223d785353fbd4eb
5 months ago
Richard Fuchs
e1055bef1a
MT#61556 fix typo and remove unused variable
...
Change-Id: Icf75d4e0a0e7eb7ddcd247f568b7b3485541e09f
5 months ago
Donat Zenichev
d9ae6c57cd
MT#61556 redis: use hostname for logging where makes sense
...
When re-establishing connection to redis via hostname,
at a point of time upon new re-resolve hasn't been done yet,
use a hostname for logging of failing attempts to connect,
so that it doesn't confuse users with the older IP.
For the backwards compatibility, this will still log an IP
for those setups using the IP address and not a hostname.
Change-Id: I28f9a2a194b5009040ac8ed909a65fec1f199663
5 months ago
Donat Zenichev
1eb0c5e13e
MT#61556 redis: re-resolve when re-connecting
...
When re-connecting to the remote redis server
try to re-resolve if the redist hostname
was an FQDN and not IP address.
Change-Id: Ie80e1d1a1ea76811c54123201ad4fe8cb64fc748
5 months ago
Richard Fuchs
916bdde573
MT#61371 add tag aliases to Redis output
...
Change-Id: Ia4d46c2b6d09629b8f30b077ab56a59e910be628
6 months ago
Richard Fuchs
2ffd489938
MT#61371 shorten Redis printing
...
Remove duplicate loops
Change-Id: I8b92af4d00db33466486f3a3dfde85b46682c540
6 months ago
Richard Fuchs
dd91961aeb
MT#55283 add STR_PTR macro
...
Convenience wrapper for &STR()
This is useful so that STR() and STR_DUP() can be extended to avoid
duplicate expansion of its macro arguments.
Change-Id: Ieae170807c11b0cdd8b52fac9bab98dccdc2b951
7 months ago
Richard Fuchs
8b26bf2761
MT#55283 switch o= strings to `str`
...
So we can attach other attributes to the strings
Change-Id: I3e6090c8557879efb40ddeb6635ed4b10e742112
7 months ago
Richard Fuchs
1b4b0d1611
MT#55283 add call_strdup_str helper
...
Change-Id: I338f1a90890701fe202179f8079f564a50dce5f0
7 months ago
Donat Zenichev
b8c9684d26
MT#55283 json_restore_call: check `sockaddr_parse_any_str()`
...
Check what the `sockaddr_parse_any_str()` parsing function
returns and react accordingly.
Fixes a defect spotted by Coverity Scan:
*** CID 1599965: Error handling issues (CHECKED_RETURN)
/daemon/redis.c: 2086 in json_restore_call()
2080 c->tos = i;
2081 redis_hash_get_time_t(&c->deleted, &call, "deleted");
2082 redis_hash_get_time_t(&c->ml_deleted, &call, "ml_deleted");
2083 if (!redis_hash_get_str(&id, &call, "created_from"))
2084 c->created_from = call_strdup(id.s);
2085 if (!redis_hash_get_str(&id, &call, "created_from_addr"))
>>> CID 1599965: Error handling issues (CHECKED_RETURN)
>>> Calling "sockaddr_parse_any_str" without checking return value (as is done elsewhere 6 out of 7 times).
2086 sockaddr_parse_any_str(&c->created_from_addr, &id);
2087 if (!redis_hash_get_int(&i, &call, "block_dtmf"))
2088 c->block_dtmf = i;
2089 if (!redis_hash_get_a64(&a64, &call, "call_flags"))
2090 c->call_flags = a64;
2091
Change-Id: I79771f9987df2e395749f05095b65e0038407e65
7 months ago
Richard Fuchs
2b8a510af5
MT#55283 change call_str_cpy etc semantics
...
Looks a bit neater and more modern
Change-Id: I1e23fd25f7f5ca0ee7af888a731e93778cd766df
7 months ago
Richard Fuchs
67e1b9979a
MT#55283 simplify call_str_dup family
...
Instead of having to explicitly pass the call object to each invocation,
keep one thread-local reference to a call, implicitly set by setting the
logging context.
Add helper functions to set and release the respective reference.
Change-Id: Ic0d82eeaa403467d50dae867e33fdf9b9dd7cec5
7 months ago