9 _moduleLogger = logging.getLogger("channel.call")
13 telepathy.server.ChannelTypeStreamedMedia,
14 telepathy.server.ChannelInterfaceCallState,
17 def __init__(self, connection):
18 telepathy.server.ChannelTypeStreamedMedia.__init__(self, connection, None)
19 telepathy.server.ChannelInterfaceGroup.__init__(self)
20 telepathy.server.ChannelInterfaceChatState.__init__(self)
22 @gtk_toolbox.log_exception(_moduleLogger)
23 def ListStreams(self):
25 For org.freedesktop.Telepathy.Channel.Type.StreamedMedia
29 @gtk_toolbox.log_exception(_moduleLogger)
30 def RemoveStreams(self, streams):
32 For org.freedesktop.Telepathy.Channel.Type.StreamedMedia
34 raise telepathy.NotImplemented("Cannot remove a stream")
36 @gtk_toolbox.log_exception(_moduleLogger)
37 def RequestStreamDirection(self, stream, streamDirection):
39 For org.freedesktop.Telepathy.Channel.Type.StreamedMedia
41 @note Since streams are short lived, not bothering to implement this
43 _moduleLogger.info("A request was made to change the stream direction")
44 raise telepathy.NotImplemented("Cannot change directions")
46 @gtk_toolbox.log_exception(_moduleLogger)
47 def RequestStreams(self, contact, streamTypes):
49 For org.freedesktop.Telepathy.Channel.Type.StreamedMedia
51 @returns [(Stream ID, contact, stream type, stream state, stream direction, pending send flags)]
53 for streamType in streamTypes:
54 if streamType != telepathy.constants.MEDIA_STREAM_TYPE_AUDIO:
55 raise telepathy.NotImplemented("Audio is the only stream type supported")
57 contactId, contactNumber = handle.ContactHandle.from_handle_name(contact.name)
59 self._conn.session.backend.dial(contactNumber)
62 streamState = telepathy.constants.MEDIA_STREAM_STATE_DISCONNECTED
63 streamDirection = telepathy.constants.MEDIA_STREAM_DIRECTION_BIDIRECTIONAL
64 pendingSendFlags = telepathy.constants.MEDIA_STREAM_PENDING_REMOTE_SEND
65 return [(streamId, contact, streamTypes[0], streamState, streamDirection, pendingSendFlags)]
67 @gtk_toolbox.log_exception(_moduleLogger)
68 def GetCallStates(self):
70 For org.freedesktop.Telepathy.Channel.Interface.CallState
72 Get the current call states for all contacts involved in this call.
73 @returns {Contact: telepathy.constants.CHANNEL_CALL_STATE_*}