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
If "streams" is given, it contains one entry per media stream.
Media-specific subscriptions aren't currently supported, so we expect
only one entry per call party, which includes a subscription to all
media streams. Crudely work around this with a feed ID uniqueness test
until proper multi-stream support is available.
Change-Id: Iaf6f8e63fb2dc20880fe807b118cc574942d53eb
We can determine the feed ID from the handle and the API does not
mandate the feed ID to be present.
Change-Id: I25b6c84b7cd8fb816d95db13d30aef41d943cafe
The "configure" message can be used without SDP to update an existing
publisher. In this use case we simply use the "audio" and "video" flags
to update the respective RECV flags of the media streams. This supports
muting and unmuting.
Change-Id: Icc77c4720124616b8b8acae3419d4d3aa200ae81
Put the code to print the details of a publisher into a JSON into a
separate function so that it can be reused.
Change-Id: I6530f2450c971663e4000fcbdc63716f631385c4
Use a callback function to populate the internal JSON fields. This makes
it possible to reuse this function for other, similar notifications.
Change-Id: I0127379b26502d88e9af38cc89f77f6b88358018
We want to send the notification to each publisher's own session, and
not to the session of the originating event.
Change-Id: I46a7c9b6adf796b076da03fac62c77ddc1d2f214
Distinguish between two cases: Sending a message to one particular WS or
HTTP connection directly as a response to a request, and sending an
asynchronous message or event to a session. Introduce
janus_send_json_sync_response() to do the format, and update all event
notifications to use janus_send_json_async().
Change-Id: I3b5a05e8c3c61d046bcaec29006698625a2570fa
We only support websocket-connected Janus sessions for now, and don't
support the HTTP polling mechanism.
Change-Id: Ia4160deeb02db20ed819864fe35f45de14c47ed8
As multiple handles from multiple different sessions can participate in
the same room, we need a way to look up handles from different sessions.
We therefore transfer ownership of all janus_handle objects to global
level. As these are currently not reference-counted, this necessitates
holding the global lock for the entirety of the signalling process.
Change-Id: Ibe27cb28407d1c8d7290faaaf5b6ae7c7f71679a
Janus rooms are not necessarily tied to just a single session. Make it
possible for one room to be used from multiple sessions.
Change-Id: Id35db2ada66a5bf392ce577cb5f2a970ca13b9dc
There's a mixture of RTPengine and RTPEngine, though we lowercase it
entirely most of the time, so let's stick to this and unify its style.
While at it remove the "the" article for rtpengine as well,
where applicable.
Change-Id: Idbad9313499942ad12ade2c9ce76fe3ec4cd2762
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
We're supposed to use the remote password for sending STUN error
responses (same as for sending STUN success responses), not the local
one.
Fixes a bug from 2015.
Closes#1626
Change-Id: I975178405dcd41661bdc5e0c1208295f9db70006
While LWS explicitly allows usage of lws_callback_on_writable() from
other threads, for some reason there is no internal locking in place,
and so a concurrently running lws_service() can interfere with internal
structures, in particular if lws_service() is closing connections at the
same time as lws_callback_on_writable() is invoked.
The suggested approach of using lws_cancel_service() in combination with
the LWS_CALLBACK_EVENT_WAIT_CANCELLED callback and a user-kept queue is
not feasible, as we need to support LWS 2.x, which doesn't have
LWS_CALLBACK_EVENT_WAIT_CANCELLED.
Closes#1624
Change-Id: Ia3ddeda66fd553c87f99404e0816d97ecbd4cdfe
Avoid calling lws_write() from threads other than the service thread, as
this might not be thread-safe. Instead store the values used for the
HTTP response headers in the websocket_output, then trigger a "writable"
callback, and finally do all the lws_write() calls from the service
thread.
Reported in #1624
Change-Id: Ifcb050193044e5543f750a12fb44f5e16d4c0a08
In order to support a per-call toggle for DTMF logging without having
the global config option set, we always open the socket just in case.
Change-Id: Ibb62672afa21e41623e74603214b4d9d8b94443c
Improve an efficiency of the code in terms of not checking anything
inside the function, if the `sdp_manipulation` flags are absent.
Change-Id: I2a5d8cf675a73ec7a2b4af94d5c7fe2f18fc1772
Do not use the `g_queue_is_empty()` to check the emptiness
of the `add_commands_*` GQueue. It's enough to check the pointer
and the first `->head` value.
Change-Id: Ie01f45d5f8bbaa5af3a09594cce145a0e83943c2
Do not proceed to the `g_hash_table_lookup()` if the `attr_name`
is empty.
Additonally: improve slightly the same check for the CMD_SUBST.
Change-Id: I39e34c34b458150ebae38dff5e6a46f6e8f17c66
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
Since the function has been swapped to the 'bool' return value,
we must comply with it.
media_player.c: In function ‘media_player_read_decoded_packet’:
media_player.c:374:17: warning: ‘return’ with no value,
in function returning non-void
374 | return;
| ^~~~~~
media_player.c:371:13: note: declared here
371 | static bool media_player_read_decoded_packet(struct media_player *mp) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Change-Id: If4034164de1325b780dcb1792c6a1674ec7b55b4