mirror of
https://github.com/resiprocate/resiprocate.git
synced 2026-01-12 00:05:02 +08:00
41 lines
1008 B
C++
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();
|
|
}
|