|
reSIProcate/repro
9694
|
#include <OutboundTargetHandler.hxx>


Public Member Functions | |
| OutboundTargetHandler (resip::RegistrationPersistenceManager &store) | |
| virtual | ~OutboundTargetHandler () |
| virtual processor_action_t | process (RequestContext &) |
Private Attributes | |
| resip::RegistrationPersistenceManager & | mRegStore |
Definition at line 10 of file OutboundTargetHandler.hxx.
| repro::OutboundTargetHandler::OutboundTargetHandler | ( | resip::RegistrationPersistenceManager & | store | ) |
Definition at line 15 of file OutboundTargetHandler.cxx.
| repro::OutboundTargetHandler::~OutboundTargetHandler | ( | ) | [virtual] |
Definition at line 21 of file OutboundTargetHandler.cxx.
{
}
| Processor::processor_action_t repro::OutboundTargetHandler::process | ( | RequestContext & | rc | ) | [virtual] |
RjS! This doesn't look exception safe - need guards
Implements repro::Processor.
Definition at line 26 of file OutboundTargetHandler.cxx.
{
resip::Message* msg = rc.getCurrentEvent();
ResponseContext& rsp = rc.getResponseContext();
if(!msg)
{
return Processor::Continue;
}
// !bwc! Check to see whether we need to move on to another reg-id
resip::SipMessage* sip = dynamic_cast<resip::SipMessage*>(msg);
if(sip && sip->isResponse() && sip->header(resip::h_StatusLine).responseCode() > 299)
{
const resip::Data& tid=sip->getTransactionId();
DebugLog(<<"Looking for tid " << tid);
Target* target = rsp.getTarget(tid);
assert(target);
OutboundTarget* ot = dynamic_cast<OutboundTarget*>(target);
if(ot)
{
int flowDeadCode;
if(resip::InteropHelper::getOutboundVersion() >= 5)
{
flowDeadCode=430;
}
else
{
flowDeadCode=410;
}
if(sip->header(resip::h_StatusLine).responseCode()==flowDeadCode || // Remote or locally(stack) generate 430
(sip->getReceivedTransport() == 0 &&
(sip->header(resip::h_StatusLine).responseCode()==408 || // Locally (stack) generated 408 or 503
sip->header(resip::h_StatusLine).responseCode()==503)))
{
// Flow is dead remove contact from Location Database
resip::Uri inputUri(ot->getAor());
//!RjS! This doesn't look exception safe - need guards
mRegStore.lockRecord(inputUri);
mRegStore.removeContact(inputUri,ot->rec());
mRegStore.unlockRecord(inputUri);
std::auto_ptr<Target> newTarget(ot->nextInstance());
if(newTarget.get())
{
// Try next reg-id
rsp.addTarget(newTarget);
return Processor::SkipAllChains;
}
}
}
}
return Processor::Continue;
}
Definition at line 19 of file OutboundTargetHandler.hxx.
1.7.5.1