diff --git a/src/common/jingle_content.py b/src/common/jingle_content.py index 7331d82c7..7b0e3f8fe 100644 --- a/src/common/jingle_content.py +++ b/src/common/jingle_content.py @@ -46,6 +46,7 @@ class JingleContent(object): #self.name = None self.accepted = False self.sent = False + self.negotiated = False self.media = None @@ -82,6 +83,11 @@ class JingleContent(object): def is_ready(self): return self.accepted and not self.sent + def on_negotiated(self): + if self.accepted: + self.negotiated = True + self.session.content_negotiated(self.media) + def add_remote_candidates(self, candidates): """ Add a list of candidates to the list of remote candidates diff --git a/src/common/jingle_rtp.py b/src/common/jingle_rtp.py index a84924f75..aa67d7399 100644 --- a/src/common/jingle_rtp.py +++ b/src/common/jingle_rtp.py @@ -200,7 +200,7 @@ class JingleRTPContent(JingleContent): self.transport.remote_candidates = [] # TODO: farsight.DIRECTION_BOTH only if senders='both' self.p2pstream.set_property('direction', farsight.DIRECTION_BOTH) - self.session.content_negociated(self.media) + self.on_negotiated() def __on_remote_codecs(self, stanza, content, error, action): """ diff --git a/src/common/jingle_session.py b/src/common/jingle_session.py index 25eebd2a1..3e2392739 100644 --- a/src/common/jingle_session.py +++ b/src/common/jingle_session.py @@ -649,7 +649,7 @@ class JingleSession(object): self.connection.dispatch('JINGLE_DISCONNECTED', (self.peerjid, self.sid, content.media, 'removed')) - def content_negociated(self, media): + def content_negotiated(self, media): self.connection.dispatch('JINGLE_CONNECTED', (self.peerjid, self.sid, media)) diff --git a/src/dialogs.py b/src/dialogs.py index 555a897ca..4f1799a33 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -4793,9 +4793,11 @@ class VoIPCallReceivedDialog(object): return ctrl = gajim.interface.new_chat(contact, self.account, resource) # Chat control opened, update content's status - if session.get_content('audio'): + audio = session.get_content('audio') + video = session.get_content('video') + if audio and not audio.negotiated: ctrl.set_audio_state('connecting', self.sid) - if session.get_content('video'): + if video and not video.negotiated: ctrl.set_video_state('connecting', self.sid) # Now, accept the content/sessions. # This should be done after the chat control is running