class MgAgent

This class represents a transport connection between the gateway and the agent from the gateway's perspective

Public Fields

bool debugFlag
map sentMessages
map sentMessages;

Public Methods

MgAgentHandle addAgent(const char* address, int portRemote=DEFAULT_MGCP_PORT_FOR_CALLAGENT)
void addToFdSet( fd_set* set )
add the appropriate FDs to the fd_set for the stack (for select)
void asyncProcess()
process timeouts and resends if the non-blocking APIs are called
Sptr <MgCommand> asyncReceive()
non-blocking receive of a message
bool asyncReply(const Sptr<MgCommand>& command, MgAgentHandle handle=0)
non-blocking reply to a message
bool asyncSend(MgCommand& command, MgAgentHandle handle=0)
non-blocking send of a message
bool checkIfSet( fd_set* set )
check if any of the appropriate FDs are set for the stack (post-select)
bool checkMsgReady( fd_set* set )
check if any messages are waiting to be receive()'d.
bool commandPending()
void flushMessages()
int getFd()
Sptr <MgCommand> getNextMessage()
private function gets data from the network (cleanly?)
void handleTimeouts(struct timeval* tv)
MgAgent( const char* address, int portRemote=DEFAULT_MGCP_PORT_FOR_CALLAGENT, int portLocal=DEFAULT_MGCP_PORT_FOR_GATEWAY )
constructor
MgAgent( int portLocal=DEFAULT_MGCP_PORT_FOR_GATEWAY )
this constructor does not take any outgoing agents initially -- all of them must be constructed on the fly
string getNCSLinePackageItemTypeEncoding()
NCS Profile
MgcpNCSLinePackageItemType decodeNCSLinePackageItemType( const string& s )
NCS Profile
MgcpNCSLinePackageItemType getNCSLinePackageType()
NCS Profile
MgcpNCSLinePackageItemType myNCSLineType
NCS Profile
void processPending()
Sptr <MgCommand> receive()
blocking receive of a message
bool reply(const Sptr<MgCommand>& command, MgAgentHandle handle=0)
blocking reply of a message
bool send(MgCommand& command, MgAgentHandle handle=0)
blocking send of a message
void setAsync()
void setSync()
void threadProcess()

Public

blocking reply of a message

Private Fields

vector > callAgentList
list of agents to transmit to
VCondition* msgPending
condition variable for a pending message
bool msgWaiting
true if a message is waiting
VMutex* networkMutex
mutex for network
deque < Sptr<MgCommand> > pendingMessages
enqueueing thing
VMutex* queueMutex
mutex for the queue
VCondition* respPending
condition variable for a response pending
bool respWaiting
a response is waiting
map > sentResponses
sent responses
Sptr server
data for receiving from the call agent
Timer timeoutMsgs
time out system for sentMessages
Timer timeoutResp
time out system for sentResponses
map < UniqueId, int > TransWaiting
a map of requests currently waiting for processing
bool useAsync
true if using async

Private Methods

void processRangeInRespAck( const string& s, const NetworkAddress& srcAddr )
process response acknowledgement attribute and set flags for confirmed responses in sentResponses

Private

sent message information

Documentation

This class represents a transport connection between the gateway and the agent from the gateway's perspective
MgAgent( int portLocal=DEFAULT_MGCP_PORT_FOR_GATEWAY )
this constructor does not take any outgoing agents initially -- all of them must be constructed on the fly.
Parameters:
portLocal - the local port to listen for the agent on.

string getNCSLinePackageItemTypeEncoding()
NCS Profile

MgcpNCSLinePackageItemType decodeNCSLinePackageItemType( const string& s )
NCS Profile

MgcpNCSLinePackageItemType getNCSLinePackageType()
NCS Profile

MgcpNCSLinePackageItemType myNCSLineType
NCS Profile

MgAgent( const char* address, int portRemote=DEFAULT_MGCP_PORT_FOR_CALLAGENT, int portLocal=DEFAULT_MGCP_PORT_FOR_GATEWAY )
constructor.
Parameters:
address - the address/hostname of the agent
portRemote - The port of the agent
portLocal - the local port to listen for the agent on.

MgAgentHandle addAgent(const char* address, int portRemote=DEFAULT_MGCP_PORT_FOR_CALLAGENT)

bool send(MgCommand& command, MgAgentHandle handle=0)
blocking send of a message

blocking reply of a message

bool reply(const Sptr<MgCommand>& command, MgAgentHandle handle=0)
blocking reply of a message

Sptr <MgCommand> receive()
blocking receive of a message

void setAsync()

void setSync()

bool asyncSend(MgCommand& command, MgAgentHandle handle=0)
non-blocking send of a message

bool asyncReply(const Sptr<MgCommand>& command, MgAgentHandle handle=0)
non-blocking reply to a message

Sptr <MgCommand> asyncReceive()
non-blocking receive of a message

void asyncProcess()
process timeouts and resends if the non-blocking APIs are called

void addToFdSet( fd_set* set )
add the appropriate FDs to the fd_set for the stack (for select)

bool checkIfSet( fd_set* set )
check if any of the appropriate FDs are set for the stack (post-select)

bool checkMsgReady( fd_set* set )
check if any messages are waiting to be receive()'d.

bool debugFlag

bool commandPending()

int getFd()

Sptr <MgCommand> getNextMessage()
private function gets data from the network (cleanly?)

void flushMessages()

void threadProcess()

void processPending()

void handleTimeouts(struct timeval* tv)

void processRangeInRespAck( const string& s, const NetworkAddress& srcAddr )
process response acknowledgement attribute and set flags for confirmed responses in sentResponses

vector > callAgentList
list of agents to transmit to

Sptr server
data for receiving from the call agent

deque < Sptr<MgCommand> > pendingMessages
enqueueing thing

map < UniqueId, int > TransWaiting
a map of requests currently waiting for processing

bool msgWaiting
true if a message is waiting

bool respWaiting
a response is waiting

VMutex* queueMutex
mutex for the queue

VMutex* networkMutex
mutex for network

VCondition* msgPending
condition variable for a pending message

VCondition* respPending
condition variable for a response pending

sent message information

map sentMessages
map sentMessages;

Timer timeoutMsgs
time out system for sentMessages

map > sentResponses
sent responses

Timer timeoutResp
time out system for sentResponses

bool useAsync
true if using async


This class has no child classes.

alphabetic index hierarchy of classes


generated by doc++