correctly close jingle session when no intersection between the remote codecs and the local ones. Fixes #8210
This commit is contained in:
parent
30aa143888
commit
b672e23503
|
@ -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
|
||||
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):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue