MGCPTransaction Class Reference
An MGCP transaction.
More...
#include <yatemgcp.h>
List of all members.
|
Public Types |
enum | State {
Invalid = 0,
Initiated = 1,
Trying = 2,
Responded = 3,
Ack = 4,
Destroying = 5
} |
Public Member Functions |
| MGCPTransaction (MGCPEngine *engine, MGCPMessage *msg, bool outgoing, const SocketAddr &address) |
virtual | ~MGCPTransaction () |
State | state () const |
unsigned int | id () const |
bool | outgoing () const |
const String & | ep () const |
const SocketAddr & | addr () const |
MGCPEngine * | engine () |
const MGCPMessage * | initial () const |
const MGCPMessage * | msgProvisional () const |
const MGCPMessage * | msgResponse () const |
const MGCPMessage * | msgAck () const |
bool | timeout () const |
void * | userData () const |
void | userData (void *data) |
MGCPEvent * | getEvent (u_int64_t time=Time()) |
bool | sendProvisional (int code=100, const char *comment=0) |
bool | setResponse (int code, const char *comment=0) |
bool | setResponse (int code, const NamedList *params, MimeSdpBody *sdp1=0, MimeSdpBody *sdp2=0) |
bool | setResponse (MGCPMessage *msg) |
Protected Member Functions |
virtual void | destroyed () |
void | processMessage (MGCPMessage *msg) |
MGCPEvent * | checkTimeout (u_int64_t time) |
void | eventTerminated (MGCPEvent *event) |
void | changeState (State newState) |
void | setProvisional (int code=100) |
void | send (MGCPMessage *msg) |
Friends |
class | MGCPEngine |
class | MGCPEvent |
Detailed Description
An MGCP transaction.
This class implements an MGCP transaction
Member Enumeration Documentation
Transaction state enumeration
Constructor & Destructor Documentation
Constructor. Construct a transaction from its first message
- Parameters:
-
| engine | The engine owning this transaction |
| msg | The command creating this transaction |
| outgoing | The direction of this transaction |
| address | Remote enpoint's address |
Member Function Documentation
Get the remote endpoint's IP address
- Returns:
- The remote endpoint's IP address
void changeState |
( |
State |
newState |
) |
[protected] |
Change transaction's state if the new state is a valid one
- Parameters:
-
| newState | The new state of this transaction |
MGCPEvent* checkTimeout |
( |
u_int64_t |
time |
) |
[protected] |
Check timeouts. Manage retransmissions
- Parameters:
-
| time | Current time in milliseconds |
- Returns:
- MGCPEvent pointer if timeout
virtual void destroyed |
( |
|
) |
[protected, virtual] |
Gracefully terminate this transaction. Release memory
Reimplemented from RefObject.
Get the engine owning this transaction
- Returns:
- The engine owning this transaction
const String& ep |
( |
|
) |
const [inline] |
Get the id of the endpoint owning this transaction
- Returns:
- The id of the endpoint owning this transaction
void eventTerminated |
( |
MGCPEvent * |
event |
) |
[protected] |
Event termination notification
- Parameters:
-
Get an event from this transaction. Check timeouts
- Parameters:
-
| time | Current time in microseconds |
- Returns:
- MGCPEvent pointer or 0 if none
unsigned int id |
( |
|
) |
const [inline] |
Get the id of this transaction
- Returns:
- The id of this transaction
Get the initial command message sent or received by this transaction
- Returns:
- The transaction's initial message
Get the response aknowledgement message sent or received by this transaction
- Returns:
- The transaction's response aknowledgement message
Get the provisional response message sent or received by this transaction
- Returns:
- The transaction's provisional response message
Get the final response message sent or received by this transaction
- Returns:
- The transaction's final response message
bool outgoing |
( |
|
) |
const [inline] |
Get the direction of this transaction
- Returns:
- True if this is an outgoing transaction
Consume (process) a received message, other then the initiating one
- Parameters:
-
(Re)send one the initial, provisional or final response. Change transaction's state
- Parameters:
-
bool sendProvisional |
( |
int |
code = 100 , |
|
|
const char * |
comment = 0 | |
|
) |
| | |
Explicitely transmits a provisional code
- Parameters:
-
| code | Provisional response code to send, must be in range 100-199 |
| comment | Optional response comment text |
- Returns:
- True if the provisional response was sent
void setProvisional |
( |
int |
code = 100 |
) |
[protected] |
Set and send the provisional response (codes between 100 and 199)
- Parameters:
-
Transmits a final response (code must at least 200) message if this is an incoming transaction
- Parameters:
-
| msg | The message to transmit |
- Returns:
- True if the message was queued for transmission
Creates and transmits a final response (code must at least 200) message if this is an incoming transaction. The SDP(s) will be consumed (appended to the message or destroyed)
- Parameters:
-
| code | Response code to send |
| params | Parameters to set in response, name will be set as comment |
| sdp1 | Optional SDP to be added to the response |
| sdp2 | Optional second SDP to be added to the response if the first one is not 0 |
- Returns:
- True if the message was queued for transmission
bool setResponse |
( |
int |
code, |
|
|
const char * |
comment = 0 | |
|
) |
| | [inline] |
Creates and transmits a final response (code must at least 200) message if this is an incoming transaction
- Parameters:
-
| code | Response code to send |
| comment | Optional response comment text |
- Returns:
- True if the message was queued for transmission
References MGCPTransaction::setResponse().
Referenced by MGCPTransaction::setResponse().
State state |
( |
|
) |
const [inline] |
Get the current transaction's state
- Returns:
- The transaction state as enumeration
bool timeout |
( |
|
) |
const [inline] |
Check if this transaction timed out
- Returns:
- True if this transaction timed out
void userData |
( |
void * |
data |
) |
[inline] |
Set the private user data of this transaction
- Parameters:
-
| data | The new private user data of this transaction |
void* userData |
( |
|
) |
const [inline] |
Get the private user data of this transaction
- Returns:
- The private user data of this transaction
The documentation for this class was generated from the following file: