MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / sipIsStuck

Method sipIsStuck

SIP/SIPBase.cpp:155–182  ·  view source on GitHub ↗

Should we cancel a transaction based on the SIP state?

Source from the content-addressed store, hash-verified

153
154// Should we cancel a transaction based on the SIP state?
155bool SipBaseProtected::sipIsStuck() const
156{
157 switch (getDialogType()) {
158 case SIPDTUndefined:
159 LOG(ERR) << "undefined dialog type?"; return false;
160 case SIPDTRegister:
161 case SIPDTUnregister:
162 return false; // The registrar dialogs are immortal.
163 default:
164 break; // Call and Message dialogs should either proceed to Active or eventually die on their own.
165 }
166 unsigned age = mStateAge.elapsed();
167 // These ages were copied from the old pre-l3-rewrite code in TransactionTable.cpp
168 switch (getSipState()) {
169 case Active:
170 return false; // Things are copascetic. Let this SIP dialog run.
171 case SSFail:
172 case HandoverInbound:
173 case Proceeding:
174 case Canceled:
175 case Cleared:
176 // Stuck in these states longer than 30 seconds? Grounds for terminating the transaction.
177 return age > 30*1000;
178 default:
179 // Stuck in any other state longer than 180 seconds? Grounds for terminating the transaction.
180 return age > 180*1000;
181 }
182}
183
184void SipRtp::rtpStop()
185{

Callers 1

deadOrRemovedMethod · 0.80

Calls 1

elapsedMethod · 0.80

Tested by

no test coverage detected