JGSession1 Class Reference

The version 1 of a jingle session. More...

#include <yatejingle.h>

Inheritance diagram for JGSession1:
JGSession RefObject Mutex GenObject Lockable

List of all members.

Public Member Functions

virtual ~JGSession1 ()
virtual XMLElementcheckJingle (XMLElement *xml)
virtual bool accept (const ObjList &contents, String *stanzaId=0)
virtual XMLElementcreateHoldXml ()
virtual XMLElementcreateActiveXml ()
virtual bool sendContent (Action action, const ObjList &contents, String *stanzaId=0)
virtual bool sendStreamHosts (const ObjList &hosts, String *stanzaId=0)
virtual bool sendStreamHostUsed (const char *jid, const char *stanzaId)

Protected Member Functions

 JGSession1 (JGEngine *engine, JBStream *stream, const String &callerJID, const String &calledJID, const char *msg=0)
 JGSession1 (JGEngine *engine, JBEvent *event, const String &id)
virtual bool initiate (const ObjList &contents, XMLElement *extra, const char *subject=0)
virtual JGEventdecodeJingle (JBEvent *jbev)
virtual XMLElementcreateJingle (Action action, XMLElement *element1=0, XMLElement *element2=0, XMLElement *element3=0)
virtual XMLElementcreateDtmf (const char *dtmf, unsigned int msDuration=0)
virtual void processJabberIqEvent (JBEvent &ev)

Friends

class JGEvent
class JGEngine

Detailed Description

The version 1 of a jingle session.

A session implementing the Jingle protocol including session transfer and file transfer


Constructor & Destructor Documentation

virtual ~JGSession1 (  )  [virtual]

Destructor

JGSession1 ( JGEngine engine,
JBStream stream,
const String callerJID,
const String calledJID,
const char *  msg = 0 
) [protected]

Constructor. Create an outgoing session

Parameters:
engine The engine that owns this session
stream The stream this session is bound to
callerJID The caller's full JID
calledJID The called party's full JID
msg Optional message to be sent before session initiate
JGSession1 ( JGEngine engine,
JBEvent event,
const String id 
) [protected]

Constructor. Create an incoming session.

Parameters:
engine The engine that owns this session
event A valid Jabber Jingle event with action session initiate
id Session id

Member Function Documentation

virtual bool accept ( const ObjList contents,
String stanzaId = 0 
) [virtual]

Accept a Pending incoming session. This method is thread safe

Parameters:
contents The list of accepted contents
stanzaId Optional string to be filled with sent stanza id (used to track the response)
Returns:
False if send failed

Reimplemented from JGSession.

virtual XMLElement* checkJingle ( XMLElement xml  )  [virtual]

Check if a given XML element is valid jingle one

Parameters:
xml Element to check
Returns:
The given element if it's a valid jingle element, 0 otherwise

Reimplemented from JGSession.

virtual XMLElement* createActiveXml (  )  [virtual]

Create an 'active' child to be added to a session-info element

Returns:
Valid XMLElement pointer or 0

Reimplemented from JGSession.

virtual XMLElement* createDtmf ( const char *  dtmf,
unsigned int  msDuration = 0 
) [protected, virtual]

Create a dtmf XML element

Parameters:
dtmf The dtmf string
msDuration The tone duration in miliseconds. Ignored if 0
Returns:
Valid XMLElement pointer or 0

Implements JGSession.

virtual XMLElement* createHoldXml (  )  [virtual]

Create a 'hold' child to be added to a session-info element

Returns:
Valid XMLElement pointer or 0

Reimplemented from JGSession.

virtual XMLElement* createJingle ( Action  action,
XMLElement element1 = 0,
XMLElement element2 = 0,
XMLElement element3 = 0 
) [protected, virtual]

Create an 'iq' of type 'set' with a 'jingle' child

Parameters:
action The action of the Jingle stanza
element1 Optional child element
element2 Optional child element
element3 Optional child element
Returns:
Valid XMLElement pointer

Implements JGSession.

virtual JGEvent* decodeJingle ( JBEvent jbev  )  [protected, virtual]

Decode a valid jingle set event. Set the event's data on success

Parameters:
jbev The event to decode
Returns:
JGEvent pointer or 0

Implements JGSession.

virtual bool initiate ( const ObjList contents,
XMLElement extra,
const char *  subject = 0 
) [protected, virtual]

Build and send the initial message on an outgoing session

Parameters:
contents The session contents to be sent with session initiate element
extra Optional extra child to be added to the session initiate element
subject Optional session subject
Returns:
True on success

Implements JGSession.

virtual void processJabberIqEvent ( JBEvent ev  )  [protected, virtual]
Parameters:
ev The event to process

Reimplemented from JGSession.

virtual bool sendContent ( Action  action,
const ObjList contents,
String stanzaId = 0 
) [virtual]

Send a stanza with session content(s) This method is thread safe

Parameters:
action Must be a transport- or content- action
contents Non empty list with content(s) to send
stanzaId Optional string to be filled with sent stanza id (used to track the response)
Returns:
False if send failed

Reimplemented from JGSession.

virtual bool sendStreamHosts ( const ObjList hosts,
String stanzaId = 0 
) [virtual]

Send a stanza with stream hosts This method is thread safe

Parameters:
hosts The list of hosts to send
stanzaId Optional string to be filled with sent stanza id (used to track the response)
Returns:
False if send failed

Reimplemented from JGSession.

virtual bool sendStreamHostUsed ( const char *  jid,
const char *  stanzaId 
) [virtual]

Send a stanza with a stream host used. If the jid is empty, send an item-not-found error response This method is thread safe

Parameters:
jid The stream host to send
stanzaId The id of the stanza to confirm
Returns:
False if send failed

Reimplemented from JGSession.


The documentation for this class was generated from the following file:
Generated on Thu Apr 8 18:19:44 2010 for Yate by  doxygen 1.6.3