comparison libervia/backend/plugins/plugin_xep_0167/mapping.py @ 4116:23fa52acf72c

plugin XEP-0167, XEP-0176: transport-info and ICE candidate sending are delayed if session is not active yet
author Goffi <goffi@goffi.org>
date Mon, 21 Aug 2023 15:19:45 +0200
parents 4b842c1fb686
children b2709504586a
comparison
equal deleted inserted replaced
4115:0da563780ffc 4116:23fa52acf72c
437 ): 437 ):
438 first_content = next(iter(all_media.values())) 438 first_content = next(iter(all_media.values()))
439 try: 439 try:
440 ice_candidates = first_content["transport_data"]["candidates"] 440 ice_candidates = first_content["transport_data"]["candidates"]
441 except KeyError: 441 except KeyError:
442 log.warning("missing candidates in SDP") 442 ice_candidates = []
443 else: 443 for idx, content in enumerate(all_media.values()):
444 for idx, content in enumerate(all_media.values()): 444 if idx == 0:
445 if idx == 0: 445 continue
446 continue 446 content["transport_data"].setdefault("candidates", ice_candidates)
447 content["transport_data"].setdefault("candidates", ice_candidates)
448 447
449 return call_data 448 return call_data
450 449
451 450
452 def build_description(media: str, media_data: dict, session: dict) -> domish.Element: 451 def build_description(media: str, media_data: dict, session: dict) -> domish.Element: