def __init__(self, session_type): """Initialize the media call. @param session_type: Type of session (SIP, webcam...) @type session_type: L{papyon.media.constants.MediaSessionType}""" self._media_session = MediaSession(session_type) self._signals = [] self._signals.append( self._media_session.connect("prepared", self.on_media_session_prepared)) self._signals.append( self._media_session.connect("ready", self.on_media_session_ready))
def __init__(self, session_type): """Initialize the media call. @param session_type: Type of session (SIP, webcam...) @type session_type: L{papyon.media.constants.MediaSessionType}""" self._media_session = MediaSession(session_type) self._signals = [] self._signals.append(self._media_session.connect("prepared", self.on_media_session_prepared)) self._signals.append(self._media_session.connect("ready", self.on_media_session_ready))
class MediaCall(object): """This class represents the signaling part in a call between two or more peers. Subclasses need to implement the underneath protocol to handle invitations and transaction during calls (start/pause/end). The media related stuff (NAT traversal, codecs, etc.) would be handled by the MediaSession. The MediaCall might however need to implement the on_media_prepared and on_media_ready functions. For example, once the media session is prepared, we might send a message with the media details.""" def __init__(self, session_type): """Initialize the media call. @param session_type: Type of session (SIP, webcam...) @type session_type: L{papyon.media.constants.MediaSessionType}""" self._media_session = MediaSession(session_type) self._signals = [] self._signals.append( self._media_session.connect("prepared", self.on_media_session_prepared)) self._signals.append( self._media_session.connect("ready", self.on_media_session_ready)) @property def media_session(self): return self._media_session def invite(self): """Invite the peer for a call. @note The other participants need to have been previously set.""" pass def accept(self): """Accept the call invitation.""" pass def reject(self): """Reject the call invitation.""" pass def ring(self): """Signal to the peer that we are waiting for the user approval.""" pass def end(self): """End the call.""" pass def dispose(self): """Close the media session and dispose the call.""" for handler_id in self._signals: self._media_session.disconnect(handler_id) self._media_session.close() def on_media_session_prepared(self): pass def on_media_session_ready(self): pass
class MediaCall(object): """This class represents the signaling part in a call between two or more peers. Subclasses need to implement the underneath protocol to handle invitations and transaction during calls (start/pause/end). The media related stuff (NAT traversal, codecs, etc.) would be handled by the MediaSession. The MediaCall might however need to implement the on_media_prepared and on_media_ready functions. For example, once the media session is prepared, we might send a message with the media details.""" def __init__(self, session_type): """Initialize the media call. @param session_type: Type of session (SIP, webcam...) @type session_type: L{papyon.media.constants.MediaSessionType}""" self._media_session = MediaSession(session_type) self._signals = [] self._signals.append(self._media_session.connect("prepared", self.on_media_session_prepared)) self._signals.append(self._media_session.connect("ready", self.on_media_session_ready)) @property def media_session(self): return self._media_session def invite(self): """Invite the peer for a call. @note The other participants need to have been previously set.""" pass def accept(self): """Accept the call invitation.""" pass def reject(self): """Reject the call invitation.""" pass def ring(self): """Signal to the peer that we are waiting for the user approval.""" pass def end(self): """End the call.""" pass def dispose(self): """Close the media session and dispose the call.""" for handler_id in self._signals: self._media_session.disconnect(handler_id) self._media_session.close() def on_media_session_prepared(self): pass def on_media_session_ready(self): pass