#include <yatejingle.h>

Public Types | |
| enum | State { Idle = 0, Pending = 1, Active = 2, Ending = 3, Destroy = 4 } |
| enum | Action { ActAccept, ActInitiate, ActReject, ActTerminate, ActTransport, ActTransportInfo, ActTransportCandidates, ActTransportAccept, ActContentInfo, ActDtmf, ActDtmfMethod, ActCount } |
| enum | TransportType { TransportUnknown, TransportInfo, TransportCandidates } |
Public Member Functions | |
| virtual | ~JGSession () |
| bool | outgoing () const |
| const String & | sid () const |
| const JabberID & | local () const |
| const JabberID & | remote () const |
| State | state () const |
| const JBStream * | stream () const |
| void * | userData () |
| void | userData (void *userdata) |
| bool | accept (XMLElement *description) |
| bool | hangup (bool reject=false, const char *msg=0) |
| bool | confirm (XMLElement *xml, XMPPError::Type error=XMPPError::NoError, const char *text=0, XMPPError::ErrorType type=XMPPError::TypeModify) |
| bool | sendDtmf (const char *dtmf, bool buttonUp=true) |
| bool | sendDtmfMethod (const char *method) |
| bool | denyDtmfMethod (XMLElement *element) |
| bool | acceptTransport (JGTransport *transport=0) |
| bool | sendTransport (JGTransport *transport) |
| bool | sendMessage (const char *msg) |
Protected Member Functions | |
| JGSession (JGEngine *engine, JBStream *stream, const String &callerJID, const String &calledJID, XMLElement *media, XMLElement *transport, bool sid, const char *msg=0) | |
| JGSession (JGEngine *engine, JBEvent *event, const String &id, bool sid) | |
| virtual void | destroyed () |
| void | enqueue (JBEvent *event) |
| JGEvent * | getEvent (u_int64_t time) |
| bool | sendStanza (XMLElement *stanza, bool confirmation=true) |
| JGEvent * | decodeJingle (JBEvent *jbev) |
| XMLElement * | createJingle (Action action, XMLElement *element1=0, XMLElement *element2=0) |
| bool | sendTransport (JGTransport *transport, Action act) |
Static Protected Member Functions | |
| static const char * | lookupState (int state) |
Friends | |
| class | JGEvent |
| class | JGEngine |
This class does the management of a Jingle session
| enum Action |
Jingle action enumeration
| enum State |
Session state enumeration
| enum TransportType |
Jingle transport type enumeration
| virtual ~JGSession | ( | ) | [virtual] |
Destructor. Hangup if Pending or Active
| JGSession | ( | JGEngine * | engine, | |
| JBStream * | stream, | |||
| const String & | callerJID, | |||
| const String & | calledJID, | |||
| XMLElement * | media, | |||
| XMLElement * | transport, | |||
| bool | sid, | |||
| const char * | msg = 0 | |||
| ) | [protected] |
Constructor. Create an outgoing session
| 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 | |
| media | The session media description | |
| transport | The session transport method(s) | |
| sid | True to used 'sid' instead of 'id' as session id attribute | |
| msg | Optional message to be sent before session initiate |
Constructor. Create an incoming session.
| engine | The engine that owns this session | |
| event | A valid Jabber Jingle event with action session initiate | |
| id | Session id | |
| sid | True to used 'sid' instead of 'id' as session id attribute |
| bool accept | ( | XMLElement * | description | ) |
Accept a Pending incoming session. This method is thread safe
| description | The media description element to send |
| bool acceptTransport | ( | JGTransport * | transport = 0 |
) | [inline] |
Send a 'transport-accept' element to the remote peer. This method is thread safe
| transport | Optional transport data to send |
| bool confirm | ( | XMLElement * | xml, | |
| XMPPError::Type | error = XMPPError::NoError, |
|||
| const char * | text = 0, |
|||
| XMPPError::ErrorType | type = XMPPError::TypeModify | |||
| ) |
Confirm a received element. If the error is NoError a result stanza will be sent. Otherwise, an error stanza will be created and sent and the received element is consumed (attached to the sent error stanza)
| xml | The element to confirm | |
| error | The error condition | |
| text | Optional text to add to the error element | |
| type | Error type |
| XMLElement* createJingle | ( | Action | action, | |
| XMLElement * | element1 = 0, |
|||
| XMLElement * | element2 = 0 | |||
| ) | [protected] |
Create an 'iq' of type 'set' with a 'jingle' child
| action | The action of the Jingle stanza | |
| element1 | Optional child element | |
| element2 | Optional child element |
Decode a valid jingle set event. Set the event's data on success
| jbev | The event to decode |
| bool denyDtmfMethod | ( | XMLElement * | element | ) |
Deny a dtmf method request from remote peer
| element | The received 'iq' element with the method |
| virtual void destroyed | ( | ) | [protected, virtual] |
Release this session and its memory
Reimplemented from RefObject.
| void enqueue | ( | JBEvent * | event | ) | [protected] |
Enqueue a Jabber engine event. This method is thread safe
| event | The event event to process |
| JGEvent* getEvent | ( | u_int64_t | time | ) | [protected] |
Get a Jingle event from the queue. This method is thread safe
| time | Current time in miliseconds |
| bool hangup | ( | bool | reject = false, |
|
| const char * | msg = 0 | |||
| ) |
Close a Pending or Active session This method is thread safe
| reject | True to reject. False to terminate gracefully | |
| msg | Optional message to send before hangup |
| const JabberID& local | ( | ) | const [inline] |
Get the local peer's JID
| static const char* lookupState | ( | int | state | ) | [inline, static, protected] |
| bool outgoing | ( | ) | const [inline] |
Get the session direction
| const JabberID& remote | ( | ) | const [inline] |
Get the remote peer's JID
| bool sendDtmf | ( | const char * | dtmf, | |
| bool | buttonUp = true | |||
| ) |
Send a dtmf string to remote peer. If the string's lenght is greater then 1, each character is added as a 'dtmf' child of the jingle element
| dtmf | The dtmf string | |
| buttonUp | True to send button-up action. False to send button-down |
| bool sendDtmfMethod | ( | const char * | method | ) |
Send a dtmf method to remote peer
| method | The method to send |
| bool sendMessage | ( | const char * | msg | ) | [inline] |
Send a message to the remote peer. This method is thread safe
| msg | The message to send |
References JBMessage::createMessage().
| bool sendStanza | ( | XMLElement * | stanza, | |
| bool | confirmation = true | |||
| ) | [protected] |
Send a stanza to the remote peer
| stanza | The stanza to send | |
| confirmation | True if the stanza needs confirmation (add 'id' attribute) |
| bool sendTransport | ( | JGTransport * | transport, | |
| Action | act | |||
| ) | [protected] |
Send a transport related element to the remote peer
| transport | Transport data to send | |
| act | The element's type (info, accept, etc) |
| bool sendTransport | ( | JGTransport * | transport | ) | [inline] |
Send a 'transport-info' element to the remote peer. This method is thread safe
| transport | The transport data |
References JGSession::sendTransport().
Referenced by JGSession::sendTransport().
| const String& sid | ( | ) | const [inline] |
Get the session id
| State state | ( | ) | const [inline] |
Get the session state.
| const JBStream* stream | ( | ) | const [inline] |
Get the stream this session is bound to
| void userData | ( | void * | userdata | ) | [inline] |
Set the arbitrary user data of this session
| userdata | The new arbitrary user data's value |
| void* userData | ( | ) | [inline] |
Get the arbitrary user data of this session
1.5.7.1