21613b77da965ff7cb426f7151d48e2a74aa1eeb
[theonering] / src / channel / call.py
1 import weakref
2 import logging
3
4 import telepathy
5
6
7 _moduleLogger = logging.getLogger("channel.call")
8
9
10 class CallChannel(
11                 telepathy.server.ChannelTypeStreamedMedia,
12                 telepathy.server.ChannelInterfaceCallState,
13         ):
14
15         def __init__(self, connection):
16                 self._recv_id = 0
17                 self._connRef = weakref.ref(connection)
18
19                 telepathy.server.ChannelTypeText.__init__(self, connection, None)
20                 telepathy.server.ChannelInterfaceGroup.__init__(self)
21                 telepathy.server.ChannelInterfaceChatState.__init__(self)
22
23                 self.GroupFlagsChanged(telepathy.CHANNEL_GROUP_FLAG_CAN_ADD, 0)
24                 self.__add_initial_participants()
25
26         def ListStreams(self):
27                 """
28                 For org.freedesktop.Telepathy.Channel.Type.StreamedMedia
29                 """
30                 pass
31
32         def RemoveStreams(self, streams):
33                 """
34                 For org.freedesktop.Telepathy.Channel.Type.StreamedMedia
35                 """
36                 pass
37
38         def RequestStreamDirection(self, stream, streamDirection):
39                 """
40                 For org.freedesktop.Telepathy.Channel.Type.StreamedMedia
41
42                 @note Since streams are short lived, not bothering to implement this
43                 """
44                 _moduleLogger.info("A request was made to change the stream direction")
45
46         def RequestStreams(self, contact, streamType):
47                 """
48                 For org.freedesktop.Telepathy.Channel.Type.StreamedMedia
49
50                 @returns [(Stream ID, contact, stream type, stream state, stream direction, pending send flags)]
51                 """
52                 pass
53
54         def GetCallStates(self):
55                 """
56                 For org.freedesktop.Telepathy.Channel.Interface.CallState
57
58                 Get the current call states for all contacts involved in this call. 
59                 @returns {Contact: telepathy.constants.CHANNEL_CALL_STATE_*}
60                 """
61                 pass