class MGCPMessage

An MGCP command or response. More...

Full nameTelEngine::MGCPMessage
Definition#include <libs/ymgcp/yatemgcp.h>
InheritsTelEngine::RefObject [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Static Methods

Public Members

Protected Methods


Detailed Description

This class holds an MGCP message, either command or response, along with its parameters. The

 MGCPMessage (MGCPEngine* engine, const char* name, const char* ep, const char* ver = "MGCP 1.0")

MGCPMessage

Constructor. Construct an outgoing command message. A transaction id will be requested from the endpoint's engine. The message will be invalidated if failed to get a transaction id or the command name is unknown

Parameters:
engineThe engine sending this message
nameCommand name
epThe id of the endpoint issuing this command
verThe protocol version to use

 MGCPMessage (MGCPTransaction* trans, unsigned int code, const char* comment = 0)

MGCPMessage

Constructor. Construct an outgoing response message The message will be invalidated if failed to get a transaction id or the code is greater then 999

Parameters:
transThe transaction to respond
codeThe response code ranging from 0 to 999
commentOptional response comment

 ~MGCPMessage ()

~MGCPMessage

[virtual]

Destructor

inline bool  valid ()

valid

[const]

Check if this is a valid message

Returns: True if this is a valid message

inline const String&  name ()

name

[const]

Get the command name or response code text representation of this message

Returns: The command name or response text representation of this message

inline int  code ()

code

[const]

Get the response code if this is a response message

Returns: The response code contained in this message

inline const String&  version ()

version

[const]

Get the protocol version of a command message

Returns: The protocol version of this message

inline const String&  comment ()

comment

[const]

Get the comment from a response message

Returns: The comment of this message

inline bool  isCommand ()

isCommand

[const]

Check if this is a command (code is a negative value)

Returns: True if this message is a command

inline bool  isResponse ()

isResponse

[const]

Check if this is a response message (code is greater then or equal to 100)

Returns: True if this message is a response

inline bool  isAck ()

isAck

[const]

Check if this message is a response ACK (code is between 0 and 99, including the margins)

Returns: True if this message is a response ACK

inline unsigned int  transactionId ()

transactionId

[const]

Get the message's transaction id

Returns: The message's transaction id

inline const String&  endpointId ()

endpointId

[const]

Get the message's endpoint id if this is a command

Returns: The message's endpoint id if this is a command

void  toString (String& dest)

toString

[const]

Convert this message to a string representation to be sent to the remote endpoint or printed to output

Parameters:
destDestination string

Reimplemented from GenObject.

bool  parse (MGCPEngine* engine, ObjList& dest, const unsigned char* buffer, unsigned int len, const char* sdpType = "application/sdp")

parse

[static]

Parse a received buffer according to RFC 3435. Command and protocol names are converted to upper case. The enpoint id is converted to lower case. Message parameter names are converted to lower case if the engine's flag is set. Message parameter values and SDP(s) are stored unchanged

Parameters:
engineThe receiving engine
destThe list of received messages
bufferThe buffer to parse
lenThe buffer length
sdpTypeThe MIME SDP content type if the message contains any SDP body

Returns: False on failure, true on success. If failed, the destination list may contain a response message to be sent

NamedList params

params

ObjList sdp

sdp

 MGCPMessage (MGCPEngine* engine, const char* name, int code, unsigned int transId, const char* epId, const char* ver)

MGCPMessage

[protected]

Constructor. Used by the parser to construct an incoming message

Parameters:
engineThe engine receiving this message
nameCommand name or response comment
codeThe response code in the range 0 to 999 or -1 if the received message is a command
transIdThe id of the transaction owning this message
epIdThe id of the endpoint issuing this command
verThe protocol version


Generated by: paulc on bussard on Mon Feb 10 13:15:47 2014, using kdoc 2.0a54.