Commit b672e235 authored by Yann Leboulanger's avatar Yann Leboulanger

correctly close jingle session when no intersection between the remote codecs...

correctly close jingle session when no intersection between the remote codecs and the local ones. Fixes #8210
parent 30aa1438
......@@ -36,6 +36,7 @@ from common import gajim
from common.jingle_transport import JingleTransportICEUDP
from common.jingle_content import contents, JingleContent, JingleContentSetupException
from common.connection_handlers_events import InformationEvent
from common.jingle_session import FailedApplication
import logging
......@@ -283,10 +284,10 @@ class JingleRTPContent(JingleContent):
codecs.append(c)
if codecs:
# FIXME: Handle this case:
# GLib.GError: There was no intersection between the remote codecs and
# the local ones
self.p2pstream.set_remote_codecs(codecs)
try:
self.p2pstream.set_remote_codecs(codecs)
except GLib.Error:
raise FailedApplication
def iter_codecs(self):
codecs = self.p2psession.props.codecs_without_config
......
......@@ -59,6 +59,11 @@ class TieBreak(Exception):
action
"""
class FailedApplication(Exception):
"""
Exception that should be raised in case responder supports none of the payload-types offered by the initiator
"""
class JingleSession(object):
"""
This represents one jingle session, that is, one or more content types
......@@ -347,6 +352,10 @@ class JingleSession(object):
except OutOfOrder:
# FIXME
self.__send_error(stanza, 'unexpected-request', 'out-of-order')
except FailedApplication:
reason = nbxmpp.Node('reason')
reason.addChild('failed-application')
self._session_terminate(reason)
def __ack(self, stanza, jingle, error, action):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment