Add support of replacements flags:
- replace-origin
- replace-origin-username
- replace-origin-full
Additionally: fix websocket tests, because now
the `-` symbol isn't considered as the one to be
set always when using `replce-origin-full`.
Instead it will use values of the very first parsed SDP.
Change-Id: I7636f020cb92cb760fcd25b0b84509e6d5ba2a9f
Instead of using separate data members to
bring data with the `call_monologue` structure,
just use the whole `sdp_origin` object type (structure)
as a pointer and keep it aling with real SDP origin
of according monologue's side.
Refactor the code accordingly for `sdp_create()`
users (firstly only here).
Additionally introduce functions to alloc/de-alloc
`sdp_orig` object:
- `sdp_orig_dup()` returns a pointer to copied object
- `sdp_orig_free()` deallocates it
Change-Id: Iff6a777e4867e78c73ca79c73fdb73ff8e9f22eb
Rework the `sdp_out_add_origin()` func so, that
it's compatible with offer/answer model.
Additionally it uses the previously existing logic
for the PUBLISH operations always, regardless any
conditions.
Additionally: fix auto-daemon-tests-websocket accordingly.
Change-Id: I0bddc67f4ebe47a24063ccc82428929aeb6cc37a
Always ensure to set the actual sdp session name when
creating SDP using `sdp_create()`.
A new dedicated func `sdp_out_add_session_name()` introduced
for that.
Additionally: fix auto-daemon-tests-websocket and
auto-daemon-tests-pubsub accordingly.
Change-Id: Ie62573149ef9ae226dc8c955dcb2cfaaa4d3ae87
Always ensure to set the origin name properly when
creating SDP using `sdp_create()`.
A new dedicated func `sdp_out_add_oirigin()` introduced
for that.
Additionally: fix auto-daemon-tests-websocket accordingly.
Change-Id: I671f7b54f8bed9c4b78d6532c0072836d77173e6
For convenience we provide extra HTTP and WS endpoints that accept a
cookie-less NG or JSON message string. Not all commands are sensitive to
retransmits and this makes it easier to query call status etc.
Change-Id: Iffbc4ef9a5fdf916a374dfdd4042c61b437d18c9
Fix up tests to match reordered attributes.
Remove 10-year-old a=ssrc parsing code completely as it's unused.
Change-Id: I78064b1b2f27a442fe8bf4b448c7174c5458d3b1
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
Janus reports inactive and disabled streams only as being disabled and
doesn't report the codec in use. Mirror this behaviour.
Change-Id: Icf193f60a054b803afea02f048dcd8d26632bc47
Support the "id" parameter for the "join" as "publisher" message.
Preempts choosing a random feed ID.
Add a test case for this.
Change-Id: Iae8c2f50864adf913b288085aa70d5427e0a4456
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
1) a=ice-options can be a session-level attribute. Use the correct
lookup function to check for both media-level and session-level
attributes.
2) The RTP endpoint address must be filled in before we do the trickle
ICE check, which uses 0.0.0.0:9 as determining factor.
3) Adapt a test case.
Change-Id: Ic0caffc85791131173848d28f5a652ad9d9124db
Generate the output fmtp= string based on the preferences received from
the opposite side. Also add the required format printing function.
Change-Id: I12124efe0b9876c6571bc32c1c45744af80b83d3
According to:
{
"request" : "join",
"ptype" : "subscriber",
"room" : <unique ID of the room to subscribe in>,
"use_msid" : <whether subscriptions should include an msid that references the publisher; false by default>,
"autoupdate" : <whether a new SDP offer is sent automatically when a subscribed publisher leaves; true by default>,
"private_id" : <unique ID of the publisher that originated this request; optional, unless mandated by the room configuration>,
"streams" : [
{
"feed" : <unique ID of publisher owning the stream to subscribe to>,
"mid" : "<unique mid of the publisher stream to subscribe to; optional>"
"crossrefid" : "<id to map this subscription with entries in streams list; optional>"
// Optionally, simulcast or SVC targets (defaults if missing)
},
// Other streams to subscribe to
]
}
{
"videoroom" : "attached",
"room" : <room ID>,
"streams" : [
{
"mindex" : <unique m-index of this stream>,
"mid" : "<unique mid of this stream>",
"type" : "<type of this stream's media (audio|video|data)>",
"feed_id" : <unique ID of the publisher originating this stream>,
"feed_mid" : "<unique mid of this publisher's stream>",
"feed_display" : "<display name of this publisher, if any>",
"send" : <true|false; whether we configured the stream to relay media>,
"ready" : <true|false; whether this stream is ready to start sending media (will be false at the beginning)>
},
// Other streams in the subscription, if any
]
}
Change-Id: Ieb38d4f562686283457a963334056b27927be974
related to #1497#1549
> ======================================================================
> ERROR: setUpClass (__main__.TestWSJanus)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/code/t/auto-daemon-tests-websocket.py", line 114, in setUpClass
> eventloop.run_until_complete(get_ws(cls, "janus-protocol"))
> File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
> return future.result()
> File "/code/t/auto-daemon-tests-websocket.py", line 23, in get_ws
> cls._ws = await connect(
> File "/usr/lib/python3/dist-packages/websockets/legacy/client.py", line 622, in __await_impl__
> transport, protocol = await self._create_connection()
> File "/usr/lib/python3.10/asyncio/base_events.py", line 1089, in create_connection
> transport, protocol = await self._create_connection_transport(
> File "/usr/lib/python3.10/asyncio/base_events.py", line 1107, in _create_connection_transport
> protocol = protocol_factory()
> File "/usr/lib/python3/dist-packages/websockets/legacy/client.py", line 160, in __init__
> super().__init__(**kwargs)
> File "/usr/lib/python3/dist-packages/websockets/legacy/protocol.py", line 154, in __init__
> self._drain_lock = asyncio.Lock(
> File "/usr/lib/python3.10/asyncio/locks.py", line 78, in __init__
> super().__init__(loop=loop)
> File "/usr/lib/python3.10/asyncio/mixins.py", line 17, in __init__
> raise TypeError(
> TypeError: As of 3.10, the *loop* parameter was removed from Lock() since it is no longer necessary
>
> ----------------------------------------------------------------------
Change-Id: I3178c54ed7eb40b9cc06769c1f1e237e0d58f966
* Use an explicitly created global event loop
* Await websocket connection closure
Relevant to #1497
Change-Id: I600189f5383ca7e5da8b45460508c1ddcddede0b