Package common :: Module jingle_session :: Class JingleSession
[hide private]
[frames] | no frames]

Class JingleSession

source code


This represents one jingle session, that is, one or more content types negotiated between an initiator and a responder.
Instance Methods [hide private]
 
__init__(self, con, weinitiate, jid, sid=None)
con -- connection object, weinitiate -- boolean, are we the initiator? jid - jid of the other entity
source code
 
approve_session(self)
Called when user accepts session in UI (when we aren't the initiator)
source code
 
decline_session(self)
Called when user declines session in UI (when we aren't the initiator)
source code
 
approve_content(self, media) source code
 
reject_content(self, media) source code
 
end_session(self)
Called when user stops or cancel session in UI
source code
 
get_content(self, media=None) source code
 
add_content(self, name, content, creator='we')
Add new content to session.
source code
 
remove_content(self, creator, name, reason=None)
Remove the content name created by creator by sending content-remove, or by sending session-terminate if there is no content left.
source code
 
modify_content(self, creator, name, *someother)
We do not need this now
source code
 
on_session_state_changed(self, content=None) source code
 
is_ready(self)
Return True when all codecs and candidates are ready (for all contents)
source code
 
accept_session(self)
Mark the session as accepted
source code
 
start_session(self)
Mark the session as ready to be started
source code
 
send_session_info(self) source code
 
send_content_accept(self, content) source code
 
send_transport_info(self, content) source code
 
send_description_info(self, content) source code
 
on_stanza(self, stanza)
A callback for ConnectionJingle.
source code
 
__ack(self, stanza, jingle, error, action)
Default callback for action stanzas -- simple ack and stop processing
source code
 
__on_error(self, stanza, jingle, error, action) source code
 
__on_transport_replace(self, stanza, jingle, error, action) source code
 
__on_session_info(self, stanza, jingle, error, action) source code
 
__on_content_remove(self, stanza, jingle, error, action) source code
 
__on_session_accept(self, stanza, jingle, error, action) source code
 
__on_content_accept(self, stanza, jingle, error, action)
Called when we get content-accept stanza or equivalent one (like session-accept)
source code
 
__on_content_add(self, stanza, jingle, error, action) source code
 
__on_session_initiate(self, stanza, jingle, error, action)
We got a jingle session request from other entity, therefore we are the receiver...
source code
 
__broadcast(self, stanza, jingle, error, action)
Broadcast the stanza contents to proper content handlers
source code
 
__on_session_terminate(self, stanza, jingle, error, action) source code
 
__broadcast_all(self, stanza, jingle, error, action)
Broadcast the stanza to all content handlers
source code
 
__parse_contents(self, jingle) source code
 
__dispatch_error(self, error=None, text=None, type_=None) source code
 
__reason_from_stanza(self, stanza) source code
 
__make_jingle(self, action, reason=None) source code
 
__send_error(self, stanza, error, jingle_error=None, text=None, type_=None) source code
 
__append_content(self, jingle, content)
Append <content/> element to <jingle/> element, with (full=True) or without (full=False) <content/> children
source code
 
__append_contents(self, jingle)
Append all <content/> elements to <jingle/>
source code
 
__session_initiate(self) source code
 
__session_accept(self) source code
 
__session_info(self, payload=None) source code
 
_session_terminate(self, reason=None) source code
 
__content_add(self, content) source code
 
__content_accept(self, content) source code
 
__content_reject(self, content) source code
 
__content_modify(self) source code
 
__content_remove(self, content, reason=None) source code
 
content_negotiated(self, media) source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, con, weinitiate, jid, sid=None)
(Constructor)

source code 
con -- connection object, weinitiate -- boolean, are we the initiator? jid - jid of the other entity
Overrides: object.__init__

approve_session(self)

source code 
Called when user accepts session in UI (when we aren't the initiator)

decline_session(self)

source code 
Called when user declines session in UI (when we aren't the initiator)

approve_content(self, media)

source code 

reject_content(self, media)

source code 

end_session(self)

source code 
Called when user stops or cancel session in UI

get_content(self, media=None)

source code 

add_content(self, name, content, creator='we')

source code 

Add new content to session. If the session is active, this will send proper stanza to update session

Creator must be one of ('we', 'peer', 'initiator', 'responder')

remove_content(self, creator, name, reason=None)

source code 
Remove the content name created by creator by sending content-remove, or by sending session-terminate if there is no content left.

modify_content(self, creator, name, *someother)

source code 
We do not need this now

on_session_state_changed(self, content=None)

source code 

is_ready(self)

source code 
Return True when all codecs and candidates are ready (for all contents)

accept_session(self)

source code 
Mark the session as accepted

start_session(self)

source code 
Mark the session as ready to be started

send_session_info(self)

source code 

send_content_accept(self, content)

source code 

send_transport_info(self, content)

source code 

send_description_info(self, content)

source code 

on_stanza(self, stanza)

source code 
A callback for ConnectionJingle. It gets stanza, then tries to send it to all internally registered callbacks. First one to raise xmpp.NodeProcessed breaks function

__ack(self, stanza, jingle, error, action)

source code 
Default callback for action stanzas -- simple ack and stop processing

__on_error(self, stanza, jingle, error, action)

source code 

__on_transport_replace(self, stanza, jingle, error, action)

source code 

__on_session_info(self, stanza, jingle, error, action)

source code 

__on_content_remove(self, stanza, jingle, error, action)

source code 

__on_session_accept(self, stanza, jingle, error, action)

source code 

__on_content_accept(self, stanza, jingle, error, action)

source code 
Called when we get content-accept stanza or equivalent one (like session-accept)

__on_content_add(self, stanza, jingle, error, action)

source code 

__on_session_initiate(self, stanza, jingle, error, action)

source code 
We got a jingle session request from other entity, therefore we are the receiver... Unpack the data, inform the user

__broadcast(self, stanza, jingle, error, action)

source code 
Broadcast the stanza contents to proper content handlers

__on_session_terminate(self, stanza, jingle, error, action)

source code 

__broadcast_all(self, stanza, jingle, error, action)

source code 
Broadcast the stanza to all content handlers

__parse_contents(self, jingle)

source code 

__dispatch_error(self, error=None, text=None, type_=None)

source code 

__reason_from_stanza(self, stanza)

source code 

__make_jingle(self, action, reason=None)

source code 

__send_error(self, stanza, error, jingle_error=None, text=None, type_=None)

source code 

__append_content(self, jingle, content)

source code 
Append <content/> element to <jingle/> element, with (full=True) or without (full=False) <content/> children

__append_contents(self, jingle)

source code 
Append all <content/> elements to <jingle/>

__session_initiate(self)

source code 

__session_accept(self)

source code 

__session_info(self, payload=None)

source code 

_session_terminate(self, reason=None)

source code 

__content_add(self, content)

source code 

__content_accept(self, content)

source code 

__content_reject(self, content)

source code 

__content_modify(self)

source code 

__content_remove(self, content, reason=None)

source code 

content_negotiated(self, media)

source code