From 5960ec3bce84cf99a923c8b4801d31944ecb1fca Mon Sep 17 00:00:00 2001 From: Thibaut Girka <thib@sitedethib.com> Date: Tue, 4 May 2010 10:31:05 +0200 Subject: [PATCH] [Jingle] Handle description-info --- src/common/jingle_content.py | 5 +++++ src/common/jingle_rtp.py | 8 +++----- src/common/jingle_session.py | 6 ++++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/common/jingle_content.py b/src/common/jingle_content.py index f4022cc8e0..af94561c2b 100644 --- a/src/common/jingle_content.py +++ b/src/common/jingle_content.py @@ -127,6 +127,11 @@ class JingleContent(object): content.addChild(node=self.transport.make_transport([candidate])) self.session.send_transport_info(content) + def send_description_info(self): + content = self.__content() + self._fill_content(content) + self.session.send_description_info(content) + def __fill_jingle_stanza(self, stanza, content, error, action): """ Add our things to session-initiate stanza diff --git a/src/common/jingle_rtp.py b/src/common/jingle_rtp.py index 0bc6810036..2a1b19a50b 100644 --- a/src/common/jingle_rtp.py +++ b/src/common/jingle_rtp.py @@ -99,8 +99,7 @@ class JingleRTPContent(JingleContent): farsight.DIRECTION_RECV, 'nice', params) def is_ready(self): - return (JingleContent.is_ready(self) and self.candidates_ready - and self.p2psession.get_property('codecs-ready')) + return (JingleContent.is_ready(self) and self.candidates_ready) def make_bin_from_config(self, config_key, pipeline, text): pipeline = pipeline % gajim.config.get(config_key) @@ -177,9 +176,8 @@ class JingleRTPContent(JingleContent): elif name == 'farsight-recv-codecs-changed': pass elif name == 'farsight-codecs-changed': - if self.is_ready(): - self.session.on_session_state_changed(self) - # TODO: description-info + if self.sent and self.p2psession.get_property('codecs-ready'): + self.send_description_info() elif name == 'farsight-local-candidates-prepared': self.candidates_ready = True if self.is_ready(): diff --git a/src/common/jingle_session.py b/src/common/jingle_session.py index 65fcb180f0..f2537a9f9b 100644 --- a/src/common/jingle_session.py +++ b/src/common/jingle_session.py @@ -264,6 +264,12 @@ class JingleSession(object): jingle.addChild(node=content) self.connection.connection.send(stanza) + def send_description_info(self, content): + assert self.state != JingleStates.ended + stanza, jingle = self.__make_jingle('description-info') + jingle.addChild(node=content) + self.connection.connection.send(stanza) + def on_stanza(self, stanza): """ A callback for ConnectionJingle. It gets stanza, then tries to send it to -- GitLab