Files
resiprocate/tfm/RouteGuard.cxx
Scott Godin cbcf9f2077 -fixup tfm build for recent changes in code base
-fixup tfm bind calls to work with latest boost version
2017-10-31 16:20:34 -04:00

41 lines
1008 B
C++

#include "resip/stack/NameAddr.hxx"
#include "resip/stack/Uri.hxx"
#include "rutil/Logger.hxx"
#include "tfm/RouteGuard.hxx"
#include "tfm/TestProxy.hxx"
#define RESIPROCATE_SUBSYSTEM Cathay::Subsystem::TEST
using resip::Uri;
using resip::Data;
using resip::NameAddr;
RouteGuard::RouteGuard(TestProxy& proxy,
const resip::Data& matchingPattern,
const resip::Data& rewriteExpression,
const resip::Data& method,
const resip::Data& event,
int priority,
int weight)
: mProxy(proxy),
mMatchingPattern(matchingPattern),
mMethod(method),
mEvent(event),
mPriority(priority),
mWeight(weight)
{
cleanup();
mProxy.addRoute(matchingPattern, rewriteExpression, method, event, priority, weight);
}
void RouteGuard::cleanup()
{
mProxy.deleteRoute(mMatchingPattern, mMethod, mEvent, mPriority);
}
RouteGuard::~RouteGuard()
{
cleanup();
}