[Jingle] Handle description-info
This commit is contained in:
parent
50482f7c2a
commit
5960ec3bce
3 changed files with 14 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue