Yate
|
A Jingle engine. More...
#include <yatejingle.h>
Public Member Functions | |
JGEngine (const char *name="jgengine") | |
virtual | ~JGEngine () |
int | sessionFlags () const |
u_int64_t | stanzaTimeout () const |
u_int64_t | pingInterval () const |
virtual void | initialize (const NamedList ¶ms) |
virtual bool | sendStanza (JGSession *session, XmlElement *&stanza) |
virtual bool | sendMessage (JGSession *session, const char *body) |
JGEvent * | getEvent (u_int64_t time) |
JGSession * | call (JGSession::Version ver, const JabberID &caller, const JabberID &called, const ObjList &contents, XmlElement *extra=0, const char *msg=0, const char *subject=0, const char *line=0, int *flags=0) |
bool | acceptIq (XMPPUtils::IqType type, const JabberID &from, const JabberID &to, const String &id, XmlElement *xml, const char *line, XMPPError::Type &error, String &text) |
void | defProcessEvent (JGEvent *event) |
virtual void | processEvent (JGEvent *event) |
Static Public Member Functions | |
static int | decodeFlags (const String &list, const TokenDict *dict) |
static void | encodeFlags (String &buf, int flags, const TokenDict *dict) |
Friends | |
class | JGSession |
A Jingle engine.
This class holds a Jingle service for the Jabber engine. Handle jingle stanzas, stanza write fail events and stream termination events
JGEngine | ( | const char * | name = "jgengine" | ) |
Constructor
name | Debug name |
virtual ~JGEngine | ( | ) | [virtual] |
Destructor. Terminates all active sessions
bool acceptIq | ( | XMPPUtils::IqType | type, |
const JabberID & | from, | ||
const JabberID & | to, | ||
const String & | id, | ||
XmlElement * | xml, | ||
const char * | line, | ||
XMPPError::Type & | error, | ||
String & | text | ||
) |
Ask this engine to accept an incoming xml 'iq' element
type | Iq type as enumeration |
from | The sender |
to | The recipient |
id | Element id attribute |
xml | The received element |
line | Account receiving the stanza (may be empty) |
error | XMPPError result. This value should be check if false is returned. Any value different from NoError indicate an invalid element |
text | Error text |
JGSession* call | ( | JGSession::Version | ver, |
const JabberID & | caller, | ||
const JabberID & | called, | ||
const ObjList & | contents, | ||
XmlElement * | extra = 0 , |
||
const char * | msg = 0 , |
||
const char * | subject = 0 , |
||
const char * | line = 0 , |
||
int * | flags = 0 |
||
) |
Make an outgoing call. 'media' and 'transport' will be invalid on exit. Don't delete them
ver | The session version to use |
caller | The caller |
called | The called |
contents | The list of session content(s) |
extra | Optional extra child for session initiate element |
msg | Optional message to send before call |
subject | Optional session subject |
line | Optional session account |
flags | Optional session flags to set |
static int decodeFlags | ( | const String & | list, |
const TokenDict * | dict | ||
) | [static] |
Decode a comma separated list of flags
list | The list of flags |
dict | Dictionary to use |
void defProcessEvent | ( | JGEvent * | event | ) |
Default event processor. Delete event.
event | The event to process |
static void encodeFlags | ( | String & | buf, |
int | flags, | ||
const TokenDict * | dict | ||
) | [static] |
Encode (append) flags to a comma separated list
buf | Destination buffer |
flags | Flags to encode |
dict | Dictionary to use |
Call getEvent() for each session list until an event is generated or the end is reached This method is thread safe
time | Current time in miliseconds |
virtual void initialize | ( | const NamedList & | params | ) | [virtual] |
Initialize this service
params | Service's parameters |
u_int64_t pingInterval | ( | ) | const [inline] |
Get the ping interval used by jingle sessions
virtual void processEvent | ( | JGEvent * | event | ) | [virtual] |
Process events from the sessions. Default action: Delete event. Descendants must override this method to process generated events
event | The event to process |
virtual bool sendMessage | ( | JGSession * | session, |
const char * | body | ||
) | [virtual] |
Send a chat message on behalf of a session
session | The session requesting the operation |
body | Message body |
virtual bool sendStanza | ( | JGSession * | session, |
XmlElement *& | stanza | ||
) | [virtual] |
Send a session's stanza. This method should be re-implemented
session | The session requesting the operation |
stanza | The stanza to send. Will be consumed and zeroed |
int sessionFlags | ( | ) | const [inline] |
Retrieve the default session flags value
u_int64_t stanzaTimeout | ( | ) | const [inline] |
Get the timeout interval of a sent stanza