1#if defined(HAVE_CONFIG_H)
31#define RESIPROCATE_SUBSYSTEM Subsystem::TRANSACTION
33#if defined(WIN32) && !defined (__GNUC__)
34#pragma warning( disable : 4355 )
44 mDiscardStrayResponses(true),
45 mFixBadDialogIdentifiers(true),
46 mFixBadCSeqNumbers(true),
47 mStateMacFifo(handler),
48 mStateMacFifoOutBuffer(mStateMacFifo),
49 mCongestionManager(0),
50 mTuSelector(stack.mTuSelector),
51 mTransportSelector(mStateMacFifo,
54 stack.getCompression(),
58 mStatsManager(stack.mStatsManager),
59 mHostname(
DnsUtil::getLocalHostName())
61 mStateMacFifo.setDescription(
"TransactionController::mStateMacFifo");
64#if defined(WIN32) && !defined(__GNUC__)
65#pragma warning( default : 4355 )
70 if(mClientTransactionMap.
size())
72 WarningLog(<<
"On shutdown, there are Client TransactionStates remaining!");
75 if(mServerTransactionMap.
size())
77 WarningLog(<<
"On shutdown, there are Server TransactionStates remaining!");
100 !mStateMacFifoOutBuffer.messageAvailable() &&
101 !mStack.mTUFifo.messageAvailable() &&
112 timeout=
resipMin((
int)nextTimer, timeout);
121 if(mStack.mStatisticsManagerEnabled)
136 if(!message || nextTimer==0)
140 while ((timer=mTimerFifo.getNext(-1)))
158 message = mStateMacFifoOutBuffer.getNext(-1);
161 mTransportSelector.
poke();
169 if ( mStateMacFifoOutBuffer.messageAvailable() )
185 resp->
header(h_RetryAfter).value()=(
uint32_t)mStateMacFifo.expectedWaitTimeMilliSec()/1000;
191 mStateMacFifo.add(msg);
198 return mTuSelector.
size();
212 return mStateMacFifo.size();
218 return mClientTransactionMap.
size();
224 return mServerTransactionMap.
size();
230 return mTimers.
size();
271 mStateMacFifo.add(
new AddTransport(std::move(transport)));
295 mStateMacFifo.setInterruptor(handler);
#define WarningLog(args_)
@ NORMAL
Not rejecting any work.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Provides a collection of utility functions for manipulating DNS names and IP addresses and discoverin...
static void makeResponse(SipMessage &response, const SipMessage &request, int responseCode, const Data &reason=Data::Empty, const Data &hostname=Data::Empty, const Data &warning=Data::Empty)
Make a response to a provided request.
TransactionUser * getTransactionUser()
void setTransactionUser(TransactionUser *t)
Represents a SIP message.
bool isRequest() const
Returns true if message is a request, false otherwise.
const RequestLine & header(const RequestLineType &l) const
Returns the RequestLine. This is only valid for request messages.
resip::MethodTypes method() const
returns the method type of the message
This is the primary point of interaction between the app-layer and the stack.
unsigned int msTillNextTimer()
provides the time in milliseconds before the next timer will fire
virtual uint64_t process()
gets the set of timers that have fired, and inserts TimerMsg into the state machine fifo and applicat...
void invokeAfterSocketCreationFunc(TransportType type)
void addTransport(std::unique_ptr< Transport > transport)
void send(SipMessage *msg)
void cancelClientInviteTransaction(const Data &tid, const resip::Tokens *reasons)
unsigned int getTransactionFifoSize() const
TransactionController(SipStack &stack, AsyncProcessHandler *handler, bool useDnsVip)
void process(int timeout=0)
CongestionManager::RejectionBehavior getRejectionBehavior() const
unsigned int getTimeTillNextProcessMS()
unsigned int getTuFifoSize() const
static unsigned int MaxTUFifoTimeDepthSecs
unsigned int getNumClientTransactions() const
void abandonServerTransaction(const Data &tid)
void enableFlowTimer(const resip::Tuple &flow)
unsigned int getNumServerTransactions() const
void removeTransport(unsigned int transportKey)
bool isTUOverloaded() const
unsigned int sumTransportFifoSizes() const
unsigned int getTimerQueueSize() const
static unsigned int MaxTUFifoSize
void registerMarkListener(MarkListener *listener)
void unregisterMarkListener(MarkListener *listener)
void terminateFlow(const resip::Tuple &flow)
void setInterruptor(AsyncProcessHandler *handler)
static void processTimer(TransactionController &controller, TimerMessage *timer)
static void process(TransactionController &controller, TransactionMessage *message)
void registerMarkListener(MarkListener *listener)
unsigned int sumTransportFifoSizes() const
void poke()
Causes transport process loops to be interrupted if there is stuff in their transmit fifos.
bool isFinished() const
Returns true if all Transports have their buffers cleared, false otherwise.
void shutdown()
Shuts down all transports.
void unregisterMarkListener(MarkListener *listener)
bool wouldAccept(TimeLimitFifo< Message >::DepthUsage usage) const
void add(Message *msg, TimeLimitFifo< Message >::DepthUsage usage)
unsigned int size() const
Represents a network address.
dcm! – add UnusedChecking(_enum) below;
const _Tp & resipMin(const _Tp &__a, const _Tp &__b)
TransportType
An enumeration of transport protocols.