Skip to content
Snippets Groups Projects
Commit 5960ec3b authored by Thibg's avatar Thibg
Browse files

[Jingle] Handle description-info

parent 50482f7c
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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():
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment