Last time, I removed something I shouldn't have...

This commit is contained in:
Thibaut GIRKA 2009-09-20 22:41:17 +02:00
parent 40199e359c
commit a4e019ee7e
1 changed files with 9 additions and 2 deletions

View File

@ -191,8 +191,7 @@ class JingleSession(object):
def is_ready(self): def is_ready(self):
''' Returns True when all codecs and candidates are ready ''' Returns True when all codecs and candidates are ready
(for all contents). ''' (for all contents). '''
return all((c.candidates_ready and c.p2psession.get_property('codecs-ready') return all((content.is_ready() for content in self.contents.itervalues()))
for c in self.contents.itervalues()))
''' Middle-level function to do stanza exchange. ''' ''' Middle-level function to do stanza exchange. '''
def start_session(self): def start_session(self):
@ -572,6 +571,11 @@ class JingleContent(object):
'session-terminate-sent': [], 'session-terminate-sent': [],
} }
def is_ready(self):
#print '[%s] %s, %s' % (self.media, self.candidates_ready,
# self.p2psession.get_property('codecs-ready'))
return self.candidates_ready and self.p2psession.get_property('codecs-ready')
def stanzaCB(self, stanza, content, error, action): def stanzaCB(self, stanza, content, error, action):
''' Called when something related to our content was sent by peer. ''' ''' Called when something related to our content was sent by peer. '''
if action in self.callbacks: if action in self.callbacks:
@ -944,6 +948,9 @@ class ConnectionJingle(object):
raise xmpp.NodeProcessed raise xmpp.NodeProcessed
def addJingleIqCallback(self, jid, id, jingle):
self.__iq_responses[(jid, id)] = jingle
def startVoIP(self, jid): def startVoIP(self, jid):
jingle = JingleSession(self, weinitiate=True, jid=jid) jingle = JingleSession(self, weinitiate=True, jid=jid)
self.add_jingle(jingle) self.add_jingle(jingle)