From now on the `call_subscription` concept gets
deprecated, and instead of it the `media_subscriptions`
concept gets applied.
Benefits of this change is:
- ability to subscribe one-to-multiple medias (different monologues)
- media level manipulations, without affecting whole SDP session
- no need to use medias offset, to detect proper subscription's media
- there is no need of particular medias order, they can be
subscribed to each other in any possible way
(even though RFC still requires to always have proper ordering)
Deprecated objects:
- `struct call_subscription`
- `GQueue subscriptions`
- `GQueue subscribers`
- `GHashTable * subscriptions_ht`
- `GHashTable * subscribers_ht`
Deprecated functionality:
- `__unsubscribe_one()`
- `__unsubscribe_all_offer_answer_subscribers()`
- `__unsubscribe_from_all()`
- `__subscribe_offer_answer_both_ways()`
- `__add_subscription()`
- `__unsubscribe_one_link()`
- `call_get_call_subscription()`
- `call_subscriptions_clear()`
- `call_subscriptions_free()`
Offtopic: additionally this commit adds helper func:
- `call_media_subscribed_to_monologue()`
Change-Id: Ifb44f7a1ba5b483b1472882b1b8d06444dba1727
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
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
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
The global list of monologues is populated in reverse order from the
list of medias. Iterate the list backwards so that the resulting medias
are in ascending order.
Change-Id: Icadca7a6cecb636ca6e021c0286b44e5cd3cdc84
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
Start using media subscriptions instead of call subscriptions
in the `call_block_silence_media()`, because older concept
gets deprecated.
Change-Id: I0ac0378a99d69017d34f8f949d7f3228bfa5b07a
Start using the media subscriptions model
(based on newly introduced `media_subscription` objects)
in scope of:
- `ng_stats_monologue()`
- `ng_call_stats()`
Change-Id: I158aedd1fae9d65135144b3331089bfc11020f13
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
To be able to use this feature from controlling agents which don't
directly support the new dictionary keys, add an alternative syntax via
the `flags` list. This is in line with all other similar dictionary keys
(e.g. `codec-` etc)
Change-Id: I7210c74c9cd3b31338052efa1c3504fe775c1c46
Similar to the other list building helper functions, add one that builds
a key/value table. The benefit is that this can then be used as a
callback in a different context.
Change-Id: If639543eaa3d67153c4cc9656d715a0c0aba3887
These functions iterate over lists, building hash tables or queues
respectively. Eliminate code duplication.
Change-Id: I375a72cc6a4d30044678e6d4abab148880713fe3
Operating on an empty queue is essentially a no-op, so there's no point
in doing an extra check first to see if the queue is empty. Remove this
extra check for the CMD_ADD case.
Change-Id: I3c7524cd407fb350a46bdf8d3a91014158c6bf44
Use an indexed array to generically support all possible media types
instead of hard-coding a few possible types. This makes lookup faster
and is also future-proof.
Add helper functions to allocate and lookup the appropriate object.
Change-Id: I28406b2c5a6829330f41601fa52e738d9a8ee315
Add second callback function to be able to handle lists that not just
contain strings, but also arbitrary other elements.
Rename the old call_ng_flags_list to call_ng_flags_str_list to reflect
this.
Unused at this point.
Change-Id: I49b46acf3ba53172b68998a93523d2d7eca1bd0b
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
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
Make it possible to set output-destination immediately when starting the
reording, not only afterwards.
Closes#1667
Change-Id: Idb7de770ad5a41d6ae6055784213e7983df9bfec
For efficiency reasons `substitute` kind of SDP manipulations
commands have been moved to the `GHashTable` instead of the `GQueue`.
Change-Id: Iec6c44109ae912ba0de440bbed6ecaee6a238b97
Add a flag to inhibit kernel mode while DTMF injection is active. Tie in
DTMF playback trigger function: Remove stream from kernel, set inhibit
flag, play DTMF, then unset inhibit flag when all events have been
injected.
Change-Id: I533ec95a676bc7edf4dd973217f8d9499f1e22b6
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
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
Require all callers of media_block_match() and play_media_select_party()
ot provide their own "flags" and do the cleanup of them afterwards.
Change-Id: I465696e899851dd98e714c5b0d55397a6dbd5dab
It substitutes a specified `a=` line taken from the concerned
media attributes list. If such line has been not found,
the attributes list remains untouched.
It subsitutes one attribute at a time, so one attribute into
another attribute.
Change-Id: Ie0a48ba46a1b196fbe33b09dedc40e4498640e34
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
In order to improve the efficieny of the code (make lookups
faster) use GQueues for CMD_ADD manipulations and
GHashTable for CMD_REM manipulations.
This gives the following benefits:
- faster lookup (check), if any SDP command is to be applied
(no need to iterate through all values of commands, as it used to be)
- keep a sequence for CMD_ADD values given by option flag(s)
In order to keep the code more lightweight and clear,
add a separate struct ptr to queues and hash tables into
the call_interfaces header.
Change-Id: I7e45aca4062750c7b8959473edb410ed76cc04e7
New section of option flags has been introduced for SDP body
attributes manipulations.
Three levels of the SDP session are concerned:
- session level (global one)
- media level - audio
- media level - video
Three different actions are supported for now:
- add
- remove
The value of the command has a wildcard matching approach.
Other attributes apart `a=` can not be edited by this functionality.
So such headers as: `c=`, `s=`, `o=` cannot be touched.
Change-Id: I939d4582839096b2399f7ded865e91ff6eb960a4
(cherry picked from commit 3f06c18793fe95e5b070044a0291a3e1528ac6e4)
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
As Redis updates must be triggered with the call unlocked, use a
convenience wrapper function to unlock, update, unref.
fixes#1602
Change-Id: I67095f31fb605b6977c88d9e9b3db581dd71a0d9
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
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
New helper func: call_ng_flags_str_q_multi()
It parses given flags delimited by a separator, and stores
each of them in the given GQueue.
By default delimiter is assumed as: ';'.
Change-Id: I1e29bf3d852868e2bc4d98b1775f70b38f61054a
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
Add a flag to force increasing the SDP version,
even if the SDP hasn't been changed.
And cover it with tests.
Flag name: 'force-increment-sdp-ver'
Additionally fix the name of the 'sdp-version' flag
in the 'rtpengine-ng-client' tool.
Change-Id: I466792668b0cd313b5e21b248dd14cd599333cbd
Support multiple tone frequencies for DTMF-security=tone to enable
audibly distinguishing multiple consecutive DTMF events from one
another.
Change-Id: I6fa33a5768aae198220d0b0cc4c53308c5661a52
Legacy UDP/TCP control protocols don't provide information about RTP
payload types, therefore don't pretend that we know that this is RTP.
Setting the RTP flag without knowing the payload types has the undesired
side effect that unknown payload types (all of them) would not be
handled by the kernel module.
Change-Id: I5882f777a5912b912ec7c870f21c77aac8127600
This distinguishes `to-label` from `set-label` for media blocking
methods, when previously they were synonymous.
Upgrade sink determination to list at the same time.
Change-Id: I5b35c78f2f307867b51b5376d5a6afbd79128d99
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
This makes it possible to refactor and simplify the interface functions,
as pointers and offsets can't be utilised with bit fields.
Change-Id: I70f1ac0eca7d2ccf8e8d5f5794580163f3f5b7ad
Since we're already doing the full parsing of the request flags, use the
same function to parse all required flags
Change-Id: I0880ccbbbc36eae7b172440ce51afc1c544583a1
SSRC entries might be present for the same SSRC in multiple contexts,
but only one of them will hold the actual stats. Don't create output
SSRC entries unless we know they won't be empty, as otherwise we won't
be able to create the actual SSRC entries (with stats) later on as they
dict key will already exist.
Change-Id: I54e263a17e14869ebb98456963f8ca75d11e9a89
Multiple untagged monologues can exist at the same time which would lead
to a broken bencode dictionary. Instead use a pseudo label to
distinguish them.
Change-Id: I0f41c42df8ec17c1c4fb5cc6451ea039612e505f
This restores backwards compatibility with existing code parsing the
output, e.g. Kamailio to report MOS stats.
Change-Id: Ibafb2a7a3cf118166ffe1cca9a62a06b63252944
commit d15fd4a547
Author: Damir Nedžibović <damir.nedzibovic@enreach.com>
Date: Tue Jul 6 14:07:42 2021 +0200
Also free the character data.
commit 8869187215
Author: Damir Nedžibović <damir.nedzibovic@enreach.com>
Date: Mon Jul 5 16:11:32 2021 +0200
Make documentation and parameters consistant.
commit 4b15aea2ee
Author: Damir Nedžibović <damir.nedzibovic@enreach.com>
Date: Thu Jun 10 15:34:00 2021 +0200
Update documentation.
commit 6ec1b3035d
Author: Damir Nedžibović <damir.nedzibovic@enreach.com>
Date: Thu Jun 10 15:33:12 2021 +0200
Do not use metadata for setting the recording file; use output_destination instead.
commit f65a76e8a3
Author: Damir Nedžibović <damir.nedzibovic@enreach.com>
Date: Wed Jun 9 15:56:02 2021 +0200
Only append file extension if skip_filename_extension is not set.
commit 92e9d7c679
Author: Damir Nedžibović <damir.nedzibovic@enreach.com>
Date: Wed Jun 9 14:12:48 2021 +0200
Rename the option to better match its usage.
commit 11128bff49
Author: Damir Nedžibović <damir.nedzibovic@enreach.com>
Date: Wed Jun 9 13:19:10 2021 +0200
Implement support for seting an output file and folder per recording.
Change-Id: I1579d62467eaf06a7aa1ac11e59dbb374f150deb
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
Additionally allow `except` and `offer` (and `transcode`) to revert
masked codecs.
Also adds `mask=full` and `strip=full`
closes#1054
Change-Id: I93a2891f2a0b9d324f6804e38f992be73c46211a
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
Useful when someone needs to:
- completely drop early media, but stop dropping after call is answered.
- completely drop initial invite media, but stop dropping after re-invite
Adds a new option ptime-reverse to complement setting of ptime towards
the offerer. This and ptime setting are now ignored in answers.
Change-Id: Icbc04f191cbc194b75b72a97832fcaba58feb10e
The from-tag may have been added to the message automatically, so we
should first check if any other flags are present, and use it only if
nothing else was found
Change-Id: Iec95d56812c31185ecd1171d01c922e7af0f5dd4
Codecs that were implicitly accepted for transcoding had no option to
set their parameters (such as bitrate) for encoding. The codec-set
option adds this.
fixes#681
Change-Id: Ib238eb73a507af168c366579abc80da07250fe88
To avoid repeated strcmp()s and make use of switch()'s optimised binary
lookup, we employ a second build step that preprocesses certain .c files
and uses gperf to substitute pseudomacros with their respective constant
hash value.
Change-Id: Id89c4728a0fc7aa911691d4dd1ba8e7b3916a983
closes#658
Squashed commit (plus docs and minor modification) of:
commit 4187cd3b2d
Author: Muhammad Zaka <muhammad.zaka@synety.com>
Date: Mon Nov 19 18:13:43 2018 +0000
removed unnecessary pad_crypto_def variable
commit 5c7b7c0ced
Author: Muhammad Zaka <muhammad.zaka@synety.com>
Date: Mon Nov 19 17:39:18 2018 +0000
add `pad-crypto` flag to not truncate trailing '==' after base64 encode
commit 98bea79902
Author: Muhammad Zaka <muhammad.zaka@synety.com>
Date: Fri Nov 16 10:59:47 2018 +0000
crypto containing padding should be sent within sdp for pass through
Change-Id: I1f7502f34e9492100e5c3a5a7345319ed996c22c