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
Use the address family of the address object to do the conversion, not
the family of the socket. This allows for v4-in-v6 socket usage.
Change-Id: I4d23b7036207e71f5e70706d621d8ec2b7ca0934
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
We don't necessarily have a parsed-out RTP header (e.g. when forwarding
T.38) so we can't use the RTP header values to keep stats. Use the
actual datagram size instead.
Change-Id: I16d25c3353dcd21a0e8c6e06610a8bfe6859710d
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
dump_packet() had the "recording" argument removed at some point, making
the macro arguments invalid and checking for non-NULL pointless.
Change-Id: I9c021f3075ca9923217eaf7193f12c95b77ae081
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
These tests depends on an additional feature ("end event") that hasn't
been implemented yet. Disable these tests for now.
Change-Id: I54186cb5a1ed9119497fc05d7760d207a981cffa
Generate the output fmtp= string based on the preferences received from
the opposite side. Also add the required format printing function.
Change-Id: I12124efe0b9876c6571bc32c1c45744af80b83d3
If the remote Opus decoder prefers receiving single-channel encoded
audio, honour it and send them single-channel audio.
Change-Id: I4bf952b9f922099c95e19b0ab51fbdffb2cc19db
This commit parses out the string, but doesn't do anything with the
values except for the FEC flag. Move the FEC on/off switch from the
extra codec options into the `fmtp` string.
Change-Id: I51f74f7cb62dd49a9af9815920f077bf300cfa33