# HG changeset patch # User Goffi # Date 1720192717 -7200 # Node ID b4b4ea8c5c87300d0d0501eaca4e475e5071f367 # Parent 00a9316547ed5b3f9b4f4df94e217c1a6a5ab03f plugin XEP-0167: Let use a `call_setup_cb` method in session: when set, the `call_setup_cb` method will be used instead of calling the `call_setup` bridge signal. This will be useful to incoming `Conferences` component to handle the signaling internally. rel 445 diff -r 00a9316547ed -r b4b4ea8c5c87 libervia/backend/plugins/plugin_xep_0167/__init__.py --- a/libervia/backend/plugins/plugin_xep_0167/__init__.py Fri Jul 05 17:18:37 2024 +0200 +++ b/libervia/backend/plugins/plugin_xep_0167/__init__.py Fri Jul 05 17:18:37 2024 +0200 @@ -51,6 +51,7 @@ C.PI_NAME: "Jingle RTP Sessions", C.PI_IMPORT_NAME: "XEP-0167", C.PI_TYPE: "XEP", + C.PI_MODES: C.PLUG_MODE_BOTH, C.PI_PROTOCOLS: ["XEP-0167"], C.PI_DEPENDENCIES: ["XEP-0166"], C.PI_MAIN: "XEP_0167", @@ -502,19 +503,30 @@ # we should have the answer long before 2 min answer_sdp_d.addTimeout(2 * 60, reactor) - self.host.bridge.call_setup( - session["id"], - data_format.serialise( + call_setup = session.get("call_setup_cb") + + if call_setup is None: + self.host.bridge.call_setup( + session["id"], + data_format.serialise( + { + "role": session["role"], + "sdp": sdp, + } + ), + client.profile, + ) + else: + await call_setup( + client, + session, { "role": session["role"], "sdp": sdp, - } - ), - client.profile, - ) + }, + ) answer_sdp = await answer_sdp_d - parsed_answer = mapping.parse_sdp(answer_sdp, session["role"]) session["metadata"].update(parsed_answer["metadata"]) self.propagate_data(session, parsed_answer) @@ -583,7 +595,7 @@ else: log.warning(f"FIXME: unmanaged action {action}") - self.host.trigger.point( + await self.host.trigger.async_point( "XEP-0167_jingle_handler", client, action, diff -r 00a9316547ed -r b4b4ea8c5c87 libervia/backend/plugins/plugin_xep_0338.py --- a/libervia/backend/plugins/plugin_xep_0338.py Fri Jul 05 17:18:37 2024 +0200 +++ b/libervia/backend/plugins/plugin_xep_0338.py Fri Jul 05 17:18:37 2024 +0200 @@ -132,7 +132,7 @@ jingle_elt = session["jingle_elt"] self.add_group_element(jingle_elt, session) - def _jingle_handler_trigger( + async def _jingle_handler_trigger( self, client: SatXMPPEntity, action: str,