From a4e019ee7e471e7e5171911db89a3117753babc5 Mon Sep 17 00:00:00 2001 From: Thibaut GIRKA Date: Sun, 20 Sep 2009 22:41:17 +0200 Subject: [PATCH] Last time, I removed something I shouldn't have... --- src/common/jingle.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/common/jingle.py b/src/common/jingle.py index c777e60d7..aabc34a56 100644 --- a/src/common/jingle.py +++ b/src/common/jingle.py @@ -191,8 +191,7 @@ class JingleSession(object): def is_ready(self): ''' Returns True when all codecs and candidates are ready (for all contents). ''' - return all((c.candidates_ready and c.p2psession.get_property('codecs-ready') - for c in self.contents.itervalues())) + return all((content.is_ready() for content in self.contents.itervalues())) ''' Middle-level function to do stanza exchange. ''' def start_session(self): @@ -572,6 +571,11 @@ class JingleContent(object): '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): ''' Called when something related to our content was sent by peer. ''' if action in self.callbacks: @@ -944,6 +948,9 @@ class ConnectionJingle(object): raise xmpp.NodeProcessed + def addJingleIqCallback(self, jid, id, jingle): + self.__iq_responses[(jid, id)] = jingle + def startVoIP(self, jid): jingle = JingleSession(self, weinitiate=True, jid=jid) self.add_jingle(jingle)