Moving from call subscriptions to media subscriptions.
Add a possibility to run `media_stop()` and `__monologue_stop()`
for all related to this monologue media subscribers.
This is an improvement, which gives the following benefits:
- all subscribers are handled inside of the func, less code out of it
- the function gets in sync with new media subscriptions concept
Change-Id: Ia0b897f53438559a68c8b469c71fec72f0d562af
Use media subscriptions model in the `kill_calls_timer()`
to find subscribers and related monologues in order
the to update the `xmlrpc_helper` data.
Change-Id: I4e7e8586a701eeb135c34138ba5a9dc288817c8d
In the `dialogue_unconfirm()` (previously `dialogue_unkernelize()`)
use media subscriptions to find subscribers/subscriptions
and correlated to them medias to unconfirm them.
This change is bound to the switch from monologue
subscriptions to media subscriptions.
Additionally: Refactor unkernelize/unconfirm in `call.c`
To provide a sense of the functions clearer,
the namings of the following function singatures
have been changed:
- `dialogue_unkernelize()` -> `dialogue_unconfirm()`
- `__monologue_unkernelize()` -> `__monologue_unconfirm()`
Change-Id: If8cc2515eb26dcc4ffed02a420514f98d43cc5c6
Report to whom a `call_monologue` is subscribed and
who is subscribed to it using media level subscriptions
instead of using monologues one.
Change-Id: I07a7353d5682b9346d1ade25d11b902ee927d4ac
Add handling of SDP session level attributes for:
- `monologue_subscribe_request()`
- `monologue_subscribe_answer()`
This will be used by `janus.c` related functionality.
Change-Id: I1c50b5b9da08e7d8cb2c98eb6995d8610386d6ed
Move `a=extmap:` attribute to the `call_media`'s
`sdp_attributes` using `stream_params`.
Required by the `insert_sdp_attributes()` used in `sdp_create()`.
Additionally revert `extmap` unit test checks in the
`testVideoroomWebRTCVideo`.
Change-Id: If63e4e8733ea0899f34fae1f1d38997e9e2c081c
Move `a=ssrc-group:` attribute to the `call_media`'s
`sdp_attributes` using `stream_params`.
Required by the `insert_sdp_attributes()` used in `sdp_create()`.
Change-Id: I67025dc83dd8e5e46422b6dc1bc54aa9c838dfea
We have to move the list of attributes with following types
to the `call_media`'s `sdp_attributes` using `stream_params`:
ATTR_SSRC
ATTR_MSID
ATTR_OTHER
This is then required by the `insert_sdp_attributes()`
used by:
- `sdp_replace()` -> `replace_sdp_media_section()`
- `sdp_create()`
Additionally: move the `insert_sdp_attributes()`
to the usage of the `append_attr_to_gstring()`, which
gives SDP attrs manipulations control over attributes
being inserted into SDP. Previously not supported.
Additionally: `process_media_attributes()` takes new
argument `bool strip_attr_other`, in order to control
whether or not to strip `ATTR_OTHER/ATTR_SSRC/ATTR_MSID`.
For now there is only one user of it `replace_sdp_media_section()`,
but for later on, we can control this using this bool.
Additionally: `print_sdp_media_section()` takes new
argument `bool print_other_attrs`, in order to control
whether or not to strip `ATTR_OTHER/ATTR_SSRC/ATTR_MSID`.
This is required, because the sdp replacing/creating mechanism
needs a controllable way of adding them, users are:
- `janus_videoroom_join()`
`janus_videoroom_configure()` - always need them
- `call_publish_ng` - always needs them
- `call_subscribe_request_ng` - never needs them
(otherwise leads to a duplication of such attributes)
- `call_offer_answer_ng()` - requires them always
- `call_subscribe_request_ng()` - never needs them
(otherwise leads to a duplication of such attributes)
Change-Id: I9c83d99da1603acb55443c462797b2cd1e72477d
Stop using the call subscriptions model in the
subscribe request/answer functionality and move to
the media subscriptions.
Change-Id: I8aab2b1b4cdf9a3c5a04172c395ca509295ce0a3
If we're updating the handlers for one particular source -> sink flow,
only stop/reset the handlers matching this flow.
Change-Id: I1d046f47f8d26cac47c5d0f4318498eacb6c5677
Fix all instances of argument-less function signatures.
Fix all instances of auto-cleanup variables declared after they need to
be in scope.
Change-Id: I3a005df03ede971e08d4f62d7c7711a1913fda5e
With the "foreign" flag now stored in call_flags, restoring a call from
Redis restores this flag as well, overwriting the desired flag as we had
set it through call_get_or_create().
Reverse the flag setting by taking it out of call_get_or_create() (where
it's always false anyway, except when coming from Redis) and setting it
explicitly with call_make_own_foreign() after restorting call and its
flags.
Change-Id: Ib68be2aeedfa988b7555e426fa337657e1062245
Stop using call subscriptions for lookups based on
the `__sub_is_transcoding()` and use media subscriptions instead.
Change-Id: I545daca19f5ce433fd660a5a7d60181ac4ed1d8b
Part 1.
Deprecate usage of the call subscriptions for updating
transcoding attributes, use media subscriptions instead.
Change-Id: Iadde906189c9634d7691d823556f2c0dfd61a655
Stop using call subscription in the `monologue_offer_answer()`,
which is used here to update transcoding related attributes and
use media subscriptions model instead.
Change-Id: I27abfe23ed2f3f532c3899e5d483cb302e43a142
Start using the media subscriptions model
(based on newly introduced `media_subscription` objects)
in scope of:
- `redis_encode_json()`
- `json_link_medias()`
- `rbl_subs_cb()`
Change-Id: I3f7267ab156b361d7e7bec4ff91a8976a7be02ee
Start using the media subscriptions model
(based on newly introduced `media_subscription` objects)
in scope of `call_get_dialogue()`.
Change-Id: Id7b8f84354bcc0525ff180d94cedfc6dc29a7c63
The following functions have been deprecated
due to no use:
- `__offer_answer_get_subscriptions()`
- `__tags_get_subscriptions()`
Change-Id: Id71dcd1a5573720299711b369410cd7fcd9de476
Start using the media subscriptions model
(based on newly introduced `media_subscription` objects)
in scope of `__update_init_subscribers()`.
Change-Id: I45446239384cf2813d9ae6ecadb2499eefa86ca8
Start using the media subscriptions model
(based on newly introduced `media_subscription` objects)
parallel to existing model, which is based on
the `call_subscription`.
Change-Id: I1f111ef181b2d698609c0b28dd72431bb3f2cf0a
Introduce `media_unconfirm()` to do a selective handling
of medias to unkernelize the correlated to it streams.
This is analogue of the of the `__monologue_unconfirm()`
but for medias.
Change-Id: Id8ede0fc56412021c301e97764fd5dd070b7d484
Previous implementation assumes that we use the `call_subscription`
objects in:
- `call_offer_answer_ng()`
- `call_update_lookup_udp()`
- `call_request_lookup_tcp()`
when appealing to the `call_get_mono_dialogue()`, in order to
get the `call_subscription` objects, in order to then pass it
for usage in the `monologue_offer_answer()`, where the most important
again is to use monologue references stored inside
the given `call_subscription` objects.
Instead of using the `call_subscription`, just use `call_monologue`
objects as a base data objects for this work,
which will allow us in the coming commits to deprecate
the `call_subscriptions` based model and
get to the subscription model based on medias.
Change-Id: Ia9ee5ba66522929acbceca28854ebccd3705635a
Introduction of the basic functions required for
a handling of the media subscriptions:
- `__unsubscribe_media_link()`
- `__unsubscribe_media()`
- `__unsubscribe_all_medias()`
- `__add_media_subscription()`
- `__subscribe_medias_both_ways()`
- `__subscribe_matched_medias()`
- `call_get_media_subscription()`
- `call_totag_subscribed_to_monologue()`
- `call_viabranch_intact_monologue()`
Change-Id: Iad2af5323b2ea8a10a83064d9ee72106c1d8f9c0
Forking to background kills already created threads, so forking must
happen first and thread creation after.
closes#1695
Change-Id: I743b890b83903d9e0b3248b032844e7e357d2307
Make sure we don't try to send on closed sockets or to endpoints which
haven't been initialised.
Fixes unexpected fallout from 83c7336e
Change-Id: If73d61e52edeb72257515adab7428ecef82c2797
Transcoding is flow-specific, so it doesn't make sense to have a flag
for it in a call_media section. Instead we use the transcoding flag set
on the call_subscription objects (on subscribers), and set/unset a flag
on the monologue struct, depending on whether any media flows (going to
subscribers) have transcoding enabled.
Change-Id: Id671d56e56a22eaa8e56f6d449770b0c7b086cea
Pass the subscription object to codec_handlers_update to eliminate the
need for a return type and the subsequent if/else.
Change-Id: I311b3e8ca14ee5090cf329163975354385cee800
Do a direct lookup of the call subscription object and set the
transcoding flag directly. Remove obsolete function.
Change-Id: I8b8329e53afb641fad80d38b45120efd46c408db
This is a convenience function that does an unnecessary loop iteration.
We have a hash table to perform the exact lookup needed. Turn the
function into a simple wrapper which uses the hash table.
Change-Id: If91976a955dea80e882656849b0b13d426e5748f
We have the subscription objects available now, so we can directly set
the transcoding flag without having to do a hash table lookup.
Change-Id: I2b85f34ca4d03dfaf81d92ea252902d1ee194efd
Instead of just return the monologues involved in an offer/answer,
return the respective subscription objects that have the monologues
pointing to each other. This makes it possible to set flags within these
objects.
Change-Id: Id88e56e1bf164a75e2172d0df04316cde5d8a955
Deprecate increasing/decreasing functionality of
the call timer run duration, because it's not needed anymore,
most of the unnecessary functionality has been moved lately
to separate dedicated threads and the `call_timer`
is simply unloaded for now.
Additionally: remove logging with timestamps, because
we do not need to monitor it anymore.
Change-Id: I8d1fd260472528fcee6a12f48b9a92f195893787
Move the `ice_slow_timer()` functionality to a separate thread,
so that we do the work more efficiently, and not be dependent
on the call_timer runs by poller.
Furthermore it makes more sense to keep in the `ice.c`,
since it obviously has to do with ice timing.
Additionally:
Update the test-stats due to these changes in the `call_timer()`
We have to call the `ice_slow_timer()` now explicitely from
the test-stats.c, because the `call_timer()` is not anymore
responsible for providing stats counters rate calculations.
Change-Id: I03377dd59ea71c27497e1f4d30164075f05165cd
Similarly as for the `stats_rate_min_max()`,
move the `stats_counters_calc_rate()` functionality
to the same separate thread, so that we do the work
more efficiently and not be dependent on the call_timer
runs by poller.
Furthermore it makes more sense to keep in the `statistics.c`,
since it obviously has to do with statistics.
Additionally:
Update the test-stats due to these changes in the `call_timer()`
We have to call the `stats_counters_calc_rate()` now explicitely from
the test-stats.c, because the `call_timer()` is not anymore
responsible for providing stats counters rate calculations.
Change-Id: I1682eb76e3057f0f431c27b9633717d965313a1a
To do the work more efficiently,
and not be dependent on the call_timer runs by poller,
we should move the ports iterations (stats update from the kernel)
functionality to a separate thread, to make it faster and
not be dependent on what happens in the `call_timer` at all.
Since it has nothing to do with the call timers.
As an additional benefit: we unload the `call_timer` runner.
Change-Id: I511529ce504ef3d29f4e9d6d731ffd470d78d27a
To do the work more efficiently,
and not be dependent on the call_timer runs by poller,
we should move the `stats_rate_min_max()` to a separate thread,
to make it faster and not be dependent on what happens in the `call_timer` at all.
Since it has nothing to do with the call timers.
Change-Id: I9a39e1b63cb8741377f5af5b2d52d4f8b428a0ad
To do the work more efficiently and not be dependent on
the `call_timer` runs by poller, we should move
the releasing of sockets to a separate thread, to make it
faster and not be dependent on what happens in the `call_timer`
at all. Since it has nothing to do with the call timers.
Since now we have two queues:
- thread scope (local): ports_to_release
- global one: ports_to_release_glob
`sockets_releaser()` uses the ports_to_release_glob,
meanwhile appending in the `call_timer()` happens using the
ports_to_release.
Change-Id: Iadd966ac895b2dd64f81269d4fdf5d83747fe0b7
Deprecate usage of the bit flags for return.
And instead do:
- only return true/false for the redis update
- check if we have to destroy the whole call using the
`call_monologues_associations_left()` only
Additionally remove unused variables.
Change-Id: Ie858c533d1aa4b74024d65c7064aa56437389882
Check globally left monologues (with associations left) after
the `monologue_delete_iter()` has already done its job.
This is needed to prevent cases, when a recursive call of the
`monologue_delete_iter()` leads to blocking of the whole call
destorying, meanwhile it's required, e.g.:
- A is in progress of destorying
- B gets recursive call of `monologue_delete_iter()` and sees
that A has still one association left with C, which A simply
hasn't manage to remove yet.
This commit introduces new function: `call_monologues_associations_left()`
Change-Id: I0941c18a76fa8c2a78d3864aee9e6433283bec88
This commit: 6f0ad0db0f
introduced an improved behavior of the call deconstruction
when dealing with multiple forked legs. But it also
introduced a regression related to TPCC related calls.
This is because it takes into consideration existing
`->viabranches`, which is not efficient in certain cases.
Instead, we just have to ensure, whether there are
other monologues of the call object, which are not directly
"visible" for this branch being cancelled (so they are not directly
associated to that), but they might have own associations
present, which means the call mustn't be globally destoroyed.
Change-Id: I630f2d88ef3b557af3a95816fc2703daccaff374
Upon calling the `monologue_delete_iter()`, we have to take into account
an amount of forked legs we have now entirely in the call.
If there's more than 1 forked leg, don't mark the whole call for a full destruction,
since other forks might be successful (and they are not in a scope of processing now).
Only destroy this branch and associated to it monologue(s).
Change-Id: I6fdb4ba33ae7582578d84d57d91f9536d932ca47
When the `discard-recording` flag is given in one of the commands to
rtpengine (e.g. in the `delete` command), the metafile is renamed to a
.DISCARD suffix and then deleted.
The recording daemon then, seeing the .DISCARD suffix, proceeds to
immediately close all recordings, delete the files if any, and delete
the entries from the DB.
Change-Id: I3f0cac129f2d56cbccd770d43bf434dea6c0a0db
Rename the original call_delete_branch() to call_delete_branch_by_id()
and provide a new call_delete_branch() which takes a reference to a call
object instead of a call ID.
Change-Id: Ie549e7f550fab5edc6e81472e78565e1925fae67
Move trickle ICE handling out of __media_init_from_flags and into a
higher-level function. This obsoletes the special magic return value to
indicate a trickle ICE failure.
All methods accepting trickle ICE updates must now explicitly call the
trickle ICE update function.
The requirement to have a full dialogue for trickle ICE updates is
removed as trickle ICE only affects one side.
Change-Id: I0850e1858876ca7bcdd39b7144b53b5a4afed53e
Moving code for handling (queuing, dequeuing) trickle ICE fragments into
ice.c, where it makes no sense. No functional changes.
Change-Id: Ib68f82e8d58efe066fdc48cd32ca9869cdeab846
This is slightly more performant as it does the retrieval and removal
with just one lookup instead of two.
Change-Id: Iba702704218ac4689a6788fd23a792ad40460ea8
We're also in controlling role for subscribe answers.
Make sure we don't clobber the source media's ICE options when adding a
subcriptions.
Change-Id: I5361462aefdbbe6411841332b69a8dc4b0e1e013
Using a pointer array instead of a linked lists allows us to directly
reference a media section by index number, without having to spool into
the linked list.
No functional changes.
Change-Id: I8b0e93f0c2e9addbcb4c938894118ed4a6aec768
If a subscribe answer says that it doesn't want to receive any media
(i.e. `inactive` - `recv` flag unset), clear our corresponding `send`
flag so that we actually don't send media there.
Change-Id: I8862cc6f4121a82c723a8303ba70345d064cd243
... which is the more direct way to copy a bit flag in a mirror fashion,
instead of doing an if/else.
Change-Id: I7283d31f7a44e6bf1ee15ea1c14cb3b8fe0293b9
Track audio writes in the mix buffer to set the `active` flag to true
whenever a write occurs, which makes it possible to create the buffer in
an inactivate state and implicitly set it active on demand.
Handle the mix buffer not returning any data in the RTP sending logic
(which is what happens for an inactive buffer) by simply not sending any
packets.
Change-Id: Iaeb0f6deadb3d90020c8c62872735cc94db80504
Similar to the existing media_player, but instead of simply producing
its own standalone output media stream, the audio_player takes over the
entire media stream flowing to the receiver, including media forwarded
from the opposite side of the call, as well as media produced by the
media_player.
Change-Id: Ic34ecf08fc73b04210cfffb1a7d795b462ece5ea
Don't change to a new port for sendonly streams as this causes problems
with NAT. A device receiving a sendonly SDP with a new port won't send
any RTP to the new port, leading to a closed (non existent) NAT mapping.
Change-Id: I2ea2163eb9f1203226bd781b53f421c790a86f0a
The old port latching logic was simply to use the last (newest)
allocated endpoint_map. This turned out to be wrong, because the last
used socket on the monologue could have been one that was allocated
earlier (and older endpoint_map), as it can happen during repeated
re-invites. Add a new function to actually look for the correct
endpoint_map, matching the currently used socket, to make sure the port
doesn't change.
Change-Id: Iae768fe48539264575aed67cbbb6b08ac745130f
Defined in RFC 8842. If a tls-id was previously given and a the new SDP
shows a different tls-id or none at all, we must restart DTLS.
Relevant to #1585
Change-Id: I554234dfcacbd330c7a0c6aea68f24d0449cba21
Rename structs and variables to make it clear that these min/max values
are min/max per-sec rate values.
Carry mins and maxes separately from averages. This changes the meaning
of $command_ps_avg away from an "average of averages" to an actual
average, which is more accurate.
Calculate this average based on per-interval differences and interval
duration (stats_rate_min_max_avg_sample).
Side effect: As rtpe_latest_graphite_interval_start is now set in
print_graphite_data instead of in graphite_loop_run, the test now
reports a different "interval calls duration".
Change-Id: I67b1118c18ca2464a48c4836fca3cfdb4d53c898
Perform accumulation of stats only once (i.e. increasing an actual
counter) and report stats based on differences to previous values,
instead of carrying multiple stats counters for each metric and
resetting each counter to zero whenever stats are reported.
`rtpe_stats` is the global master accumulator.
`_intv` variables are intermediate and local storage for values sampled
from `rtpe_stats` at regular intervals.
`_rate` and `_diff` variables hold stats calculated from `rtpe_stats`
and the respective `_intv` variable whenever the sampling and reporting
occurs.
`stats_counters_calc_diff` is used to calculate stats as differences
between `rtpe_stats` and the last sampled `_intv`
`stats_counters_calc_rate` does the same but calculates a per-second
rate, based on a microsecond duration.
Eliminate now-useless struct global_stats_ax
Change-Id: Ic4ca630161787025219b67e49b41995204d60573
... so that the publishing session gets notified about "webrtcup" and
not the session which created the room.
Change-Id: If7b308df4afa7afb19ecaca1f743f87c3c736007
This is a new option flag, which provides a possiblity
to select specific crypto suite(s) for the offerer from
the given list of crypto suites received in the offer.
This will be used later on, when processing an answer from
the recipient and generating an answer to be sent out towards offerer.
Furthermore, this is being decided not when the answer is processed,
but already when the offer is processed.
Flag usage example:
`SDES-offerer_pref:AES_256_CM_HMAC_SHA;AES_256_CM_HMAC_SHA1_32;`
Change-Id: I2b22b38347d24f27331482e18b92305fbadb2520
1872 /* first add those mentioned in the order list,
1873 * but only, if they were previously generated/added to the sdes_out */
>>> CID 1530346: Control flow issues (DEADCODE)
>>> Execution cannot reach the expression "NULL" inside this statement: "l = (cpq_order ? cpq_order-...".
1874 for (GList *l = cpq_order ? cpq_order->head : NULL; l; l = l->next)
Change-Id: I58f84ba82d215a9eb6cbd97548e8e9e8a954bdc6
This is a new option flag, which provides the ordered list,
in which to add crypto suites into the SDP body.
Right now they're always added in the order given in the source code.
Flag usage example:
`SDES-order:AES_256_CM_HMAC_SHA;AES_256_CM_HMAC_SHA1_32;AES_192_CM_HMAC_SHA1_80;`
This means — those listed SDES crypto suites will be added
into the generated SDP body at the top of crypto suites list, in the given order.
But, each of them is added, only if it is about to be added/generated.
In other words, the `SDES-order:` flag itself doesn't add crypto suites,
it just affects the order of those suites to be added.
And the rest of non-mentioned suites, which are also to be added,
will be appended after those given, in the free manner of ordering.
Important thing to remember - it doesn't change the crypto suite tag
for the recipient, even though changing the order of them.
Additionally.
This flag does not contradict with `SDES-nonew`, `SDES-only-` and `SDES-no-` flags.
It just orders the list of crypto suites already prepared to be sent out.
Change-Id: I0fec54f9e2f3cd4913e905e8afe825712f82d1ae
A new function dedicated to SDES crypto suites policy checks
has been introduced: 'crypto_params_sdes_check_limitations()'.
Use it to decrease an amount of repeating code blocks
related to SDES checks.
Change-Id: I0ac242a63107a9f3a41f95a57e3d3675645ac18d
Add a new flag to only accept these individual crypto suites
and none of the others.
For example, `SDES-only-NULL_HMAC_SHA1_32`
would only accept the crypto suite `NULL_HMAC_SHA1_32` for
the offer being generated.
This also takes precedence over the `SDES-no-` flag(s),
if used together, so the `SDES-no` will be not taken into account.
This has two effects:
- if a given crypto suite was present in a received offer,
it will be kept, so will be present in the outgoing offer; and
- if a given crypto suite was not present in the received offer,
it will be added to it. The rest, which is not mentioned,
will be dropped/not added.
Flag name: 'SDES-only-<crypto name>'
Additionally: add another new flag 'SDES-nonew'.
It will not add any new crypto suites into the offer.
It takes precedence over the `SDES-no` and `SDES-only` flags,
if used in combination.
Change-Id: Ic4fa03957ee3d4d24b0c4f3fd003eada05f49b0b
Unmark a monologue that has been scheduled for deletion when it's
associated with another one, which happens during offer/answer.
Fixes a regression from 53dbef7e1 which removed this logic from
__monologue_unkernelize with re-adding it elsewhere.
Change-Id: I037162e91fec42631680f7767f58b172fd6e04db
`call_get_monologue_new` is supposed to always return a full dialogue,
but an error in invocation (using a from-tag that doesn't belong to an
offer/answer) can lead to the second half being unset. Return an error
in this case.
Change-Id: I84b21ff5e5c0403fc07cae83fee206705ecff8b3
Use the new `associated_tags` table to determine which tags are
associated with which. Iterate the associations between tags in a
tree-like manner and do this at the moment the `delete` command is
received. Break up the `associated_tags` links at this time, and
determine which tags would be left dangling and mark all of these for
deletion. If no tags are left after this process, mark the entire call
for deletion.
The previous approach was cumbersome and prone to errors. Using tag
names and branch names to determine which tags are associated with which
is a pointless hurdle, and using a table of associations that is
explicitly kept for this purpose is a much cleaner approach. Also
postponing the decision about which tags to delete until the time the
deletion actually happens can lead to tags not being deleted, when they
really should be (e.g. A -> B, delete A, A -> C).
Change-Id: I03ae57d0a2117ecd721372c1a49468fc34dd630c
Keep track which tags (monologues) were created together as part of an
offer/answer exchange with a separate hash table, regardless of whether
these monologues actually have tagged names or are just nameless
branches.
Change-Id: I60aa114c8caf6ecdff4705e3399f60190d04dda6
During offer/answer, we remove existing subscriptions before
re-establishing the new set of subscriptions. But we must also remove
the subscriptions of previous subscribers in order to keep the lists of
subscriptions and subscribers correctly reciprocal.
Change-Id: I7d39fa59892159f41033ae6a40e7cb51d861b12e
Support multiple tone frequencies for DTMF-security=tone to enable
audibly distinguishing multiple consecutive DTMF events from one
another.
Change-Id: I6fa33a5768aae198220d0b0cc4c53308c5661a52
Based on the information gotten from Richard Fuchs
document the main objects in the code, to let the code be more
understandable for other code readers.
Mainly documented:
- call
- call_monologue
- call_subscription
- call_media
- packet_stream
- stream_fd
- sink_handler
- rtpe_callhash / rtpe_callhash_lock
Change-Id: I0cf122bea2d9c3f198b48da134a70301564ff1f9
Legacy protocols don't set sp->num_ports. Use a sensible default for
this case.
Probably a regression from 2d2d7665b
Change-Id: Idcbc477a68b6db70a91a5d082736ac642c50ab15
This makes it possible to have different media silencing options for
different outputs. Functionally this commit alone is a no-op.
Change-Id: I967c3e07ea4645bb49ccb76db12d51ded2d72f06
Create a dedicated struct to hold certain attributes shared by both sink
handlers and media subscriptions, as a preparation to simplify handling
these attributs.
Change-Id: I866159c33ed6d6a2873d2cf68c4906ea705d253e
If an offer is going to a side that is already known to support
rtcp-mux, don't try to offer a fallback RTCP port. Do this by pretending
that rtcp-mux=require is set, which leads to the correct behaviour. This
is needed because the RTCP fallback port might already be closed, so
trying to include it in the offer would require opening a new set of
ports, which is undesirable.
closes#1494
Change-Id: I550bec08379c799cb7dd090a70d090ae47462467
Keep a running lifetime total of all "gauge" type metrics. Also track
the square of the sums of all "gauge" type metrics in order to determine
the standard deviation.
Change-Id: I23f60774a6421636f1a913674c7d1b54a1c5f702
When doing the initial answer, the packet_stream endpoint port isn't
filled in yet. Use the stream_params port instead to test for rejected
streams.
closes#1499
Change-Id: I8f315d95521f874fb8c5e6222263d017800b5fc9
When ports are closed early (while the call is still running), we must
first update a slave rtpengine with this new information (that these
ports are now closed) before actually releasing the ports ourselves. Not
doing so leads to a race condition where the master instance re-uses a
port that was just closed before the slave instance knows about the port
being closed.
We implement this using a thread-local list to keep track of ports that
were released while processing a control message, and process this list
to actually close the ports only after Redis has been updated.
Additional calls to the function to close the ports are placed in
strategic locations to make sure this is triggered in every code path.
closes#1495
Change-Id: I803f4594f30ca315da0b84c6e76893f54ca3a7c9
This eliminates a spurious false warning log message for rejected
streams that use a dummy payload type
Change-Id: Id628cafb8d7c4ea576cd01ff35f5dd9cd2151280
Since we're creating a dummy sfd to hold the SRTCP context when we don't
have an actual RTCP port, we must make sure to remember and re-use this
dummy sfd during a re-invite. Otherwise we end up creating a duplicate
dummy sfd, which is detected as a different sfd and thus triggers an ICE
restart.
Change-Id: Iadc91e163bd15a3cd5f57656b52941724c920143
There's no need to open ports on non-primary interfaces if ICE is not in
use as these ports will not be used or seen by anyone.
This mostly obsoletes the `save-interface-ports` config option, with the
exception of ICE advertised by the offerer. We currently have no option
to reject ICE from the offerer during the offer phase, so ports would
always be opened on that side.
Relevant to #1164 and 001abe5
Change-Id: I43df70bc0ec49b81f63aec97c776e48617b2acfd
This enables the same behaviour towards the offerer when rtcp-mux=demux
or =accept is used, as we have towards the answerer when
rtcp-mux=require is used.
Change-Id: I56a1cea84efce0c2db1b58c500629d0e54d582f4
Special handling for codec lists that were received as part of an
answer: If the list includes a codec that was not offered, ignore that
codec. This prevents transcoders from being set up that were not
requested.
This brought to light some tests that were actually broken.
Change-Id: Iac71056ec5e10b5de5567917974f2c4e0261eb0c
If DTLS is rejected in an answer via `DTLS=off` we must forget that DTLS
was previously offered, as otherwise a re-invite would detect the
fingerprint as changed if the re-invite doesn't offer DTLS again. We
also make sure DTLS is shut down if during stream init DTLS is not
given, when it was present before.
Change-Id: I48ee6f0ec5ec02f558a6799951552ea2272d0e96
This is useful for functions which are used both from a timer and from
other callers. These functions would reset the logging context at their
end to free the reference held by the logging context, which would
wrongly reset the logging context when the same function was called from
a different code path. Using a stack with push/pop semantics makes it
safe to use these functions from any code path.
Additionally introduce an explicit reset function that clears the entire
stack regardless of context. This reset function is called at the end of
every work iteration in every worker thread, just in case not everything
was popped from the stack.
Change-Id: I0e2c142b95806b26473c65a882737e39d161d24d
commit a2e5cfb8e5
Author: Razvan Crainea <razvan@opensips.org>
Date: Thu Jan 13 16:16:19 2022 +0200
Add tests for subscribe requests on paused media
commit fa58596a9f
Author: Razvan Crainea <razvan@opensips.org>
Date: Wed Jan 12 22:01:27 2022 +0200
Swap media direction check for `subscribe request`
as @rfuchs mentioned in his review, the SEND/RECV media flags are set
according to rtpengine's perspective, not the media flow's one.
commit e1e9a157c0
Author: Razvan Crainea <razvan@opensips.org>
Date: Wed Jan 12 19:27:42 2022 +0200
Fix `subscribe request` SDP media direction
When building the SDP for a `subscribe request` command, take into
consideration the media direction of the source stream - if stream is
`recvonly`, then we do not have anything to send, thus the direction
should be advertised as `inactive`, rather than `sendonly`.
Change-Id: I2d78bbec8ad584774f3c90f0ce5cca42f57f7b0f
With multiple media subscriptions, codec handlers are called
consecutively, once for each forwarding chain, leading to DTMF events
reported multiple times. The DTMF trigger must therefore keep track of
the state in the upper media object, not in the codec handlers.
Change-Id: I9ceaf406e093f25b7c037a325a0f2a7a91954922
This makes it possible to add new streams without specifying the
direction/interface again.
Reported in #1366
Change-Id: I8f320ecbe72f123d755ba80370de9c40960eb0f0
While doing the A/B reassociation during an offer/answer exchange, we
don't (necessarily) want to remove all existing subscriptions. Instead
we cant to unsubscribe all subscribers so we don't do media forking, but
leaving existing subscriptions alone to make early media reception
possible. This mirros the old behaviour.
Change-Id: Ib9e6671ca2d23d1eb4509d7cf939015c816cc622
Also add a safeguard against filling the remote peer address with an
address from the wrong family
closes#1305
Change-Id: Iac18212b4d526a2f7d49a06ddcd724aa89b06060
The contents of the ->next element cannot be accessed completely lock
free as they're zeroed out during call removal. Instead grab a reference
to the linked next call before releasing the lock, and also lock the
next element before moving on. This requires a more granular locking as
not to interfere with call removal: One lock to protect the contained
call and the ->next, and another to protect the ->prev
Change-Id: I5474ea3f88e3276f93ba62a952b3be13c0c182e9
commit b0c722da69ad088a2eddced12b37c0546a514890
Author: Daniel Hauptmann <dhauptmann@sipwise.com>
Date: Mon Jul 26 15:35:51 2021 +0200
changed flag bit length
in call_interfaces.h changed bit length of reuse_codec from 0 to 1
commit 0313a747532d5987f25fa9edb202aa460bf98dd1
Author: Daniel Hauptmann <dhauptmann@sipwise.com>
Date: Mon Jul 26 15:29:20 2021 +0200
inversed reuse_codec logic
in test-transcode.c and call.c, reuse_codec = 0 (default) will now result in using codec_store_populate instead of codec_store_populate_reuse
commit b876bd686bd30df21a5962aca16fc1c85574f554
Author: Daniel Hauptmann <dhauptmann@sipwise.com>
Date: Mon Jul 26 15:18:19 2021 +0200
adding option to minimalize changes in the codec_store_population
added function codec_store_populate_reuse in codec.c which replaces codec_store_populate but makes fewer changes to the GLists with the old and new codecs
added flag to enable this feature (disabled by default)
commit 6fd0b701c9589b2fae00300801e02a9b5cc397ab
Author: Daniel Hauptmann <dhauptmann@sipwise.com>
Date: Mon Jul 26 14:44:42 2021 +0200
Added Option to minimize change in the codecs
In codec.c added function to populate codec store with the fewest changes between the old and new GList which contains the codecs.
Added new testroutine in test-transcode.c line 1500
Added flag to call_interfaces.h to optionally enable this feature
Change-Id: If58d9a07d114b05dfb75553a87eb4372ae949fbb
commit 3bf554a8fbae7e948343699f40d935693618b764
Author: Daniel Hauptmann <dhauptmann@sipwise.com>
Date: Fri Jul 23 13:58:02 2021 +0200
changing codec-exchange behaviour
in codec.c line 3288 function codec_store_populate now doesnt empty dst and copy new codec from src to it, instead codecs from src will be appended to dst and codec from dst, which are not
being contained by src are being removed
Change-Id: Id6b7ee65595f9cc5c71ef557c7bac5ee38f97cbe
Complete overhaul of the codec handling code:
*) obsolete flags `asymmetric codecs`, `symmetric codecs`, `reorder
codecs`
*) support proper codec offer/answer
*) split codec manipulation (strip/offer/accept/etc) into separate
functions for clarity and better code maintenance
*) fully update codec handlers in both directions after an answer
*) explicit allocation and handling of codecs and payload types in a
codec_store object
*) improve codec matchup logic during answer
*) more explicit handling of supplemental codecs (CN/DTMF)
*) remove now obsolete hacks for handling certain use cases
Change-Id: I996705ba8fe339524c2f70e6bb0fd854f9a1f4fb
This solves problems when the same SSRC is looped through the same call
multiple times in different mono/dialogues, with different parameters.
Change-Id: I1d033cb1f012574d82b5bcbfffe11eb5f983cfd8
The JSON context is already in an object, therefore skip the surrounding
{} enclosure.
Also don't run the global MQTT timer when MQTT is disabled.
closes#1290
Change-Id: I63c622bd339545e625ee18def33f21de2533f949
This makes the type in line with string(3) functions and eliminates some
compiler warnings.
Also update the related bencode data type.
Change-Id: I7ef4024f4b5a0f737b3dbe03bcd078032395bce6
If we receive an SDP with a DTLS fingerprint, by default we adopt the
hash function used for that fingerprint in subsequent communication with
that peer. However, if the SDP is an answer, and we previously used a
different hash function in the offer towards that peer, then a later
re-invite offer would be sent with a different fingerprint, causing an
unexpected DTLS restart. Instead, make sure we don't change fingerprints
if one was already sent.
Change-Id: I603bb86ce2d7121556c161749ed08128dd0b63b2
Avoid using an explicit test for the trickle ICE endpoint address and
instead use the TRICKLE_ICE flag.
Change-Id: I821ced7e77c798004c9d88ec072848b7f6e24a85
When set to `false`, no changes at all. (default)
When set to `true`, bind only one desired family local address.
Also add info in rtpengine.pod file.
Also add log for sfd with no call.
If a supplemental codec was removed by the codec tracker, we must reset
any codec handlers on the opposite side that were using this output
codec.
Change-Id: I7fb9d0ec7a061682fe3b28d9ead14ac263aff7c3
add explicit flag for fingerprint length instead of using the hash
function
restart DTLS after a shutdown due to a reset
clear fingerprint buffer when running the hash
suppress stray log message when no fingerprint was seen yet
add option to test script
closes#1095
Change-Id: Ic58ea6c5aa48a215743d6a3c1b371fc4a5ea77ce
An endpoint switching protocols is normally passed through to the peer,
but in an answer that is usually not desirable. Change the default
behaviour to stick to the original protocol that was offered even if the
answerer changes protocols.
Change-Id: Ib288549f4b1c9ab57a6333c6b7dd511537af96f7
Initially created branches don't have a tag associated with them, so
they don't appear in `other_tags`. We need to keep track of which
branches were created from a single from-tag through their via-branch
values so we know when all branches have been deleted.
closes#1037
Change-Id: I4c6ce602b99a9104de98098cd06ca399eb28e1b2