reSIProcate/repro  9694
RRDecorator.hxx
Go to the documentation of this file.
00001 #ifndef RRDecorator_Include_Guard
00002 #define RRDecorator_Include_Guard
00003 
00004 #include "resip/stack/MessageDecorator.hxx"
00005 #include "resip/stack/Tuple.hxx"
00006 
00007 
00008 namespace resip
00009 {
00010 class Transport;
00011 }
00012 
00013 namespace repro
00014 {
00015 class Proxy;
00016 
00017 class RRDecorator : public resip::MessageDecorator
00018 {
00019    public:
00020       RRDecorator(const Proxy& proxy,
00021                   const resip::Transport* receivedTransport,
00022                   bool alreadySingleRecordRouted,
00023                   bool hasInboundFlowToken,
00024                   bool forceRecordRouteEnabled,
00025                   bool doPath=false,
00026                   bool isOriginalSenderBehindNAT=false);
00027       virtual ~RRDecorator();
00028 
00029 /////////////////// Must implement unless abstract ///
00030 
00031       virtual void decorateMessage(resip::SipMessage &msg, 
00032                                     const resip::Tuple &source,
00033                                     const resip::Tuple &destination,
00034                                     const resip::Data& sigcompId) ;
00035       virtual void rollbackMessage(resip::SipMessage& msg) ;
00036       virtual MessageDecorator* clone() const ;
00037 
00038    private:
00039       void singleRecordRoute(resip::SipMessage &msg, 
00040                                     const resip::Tuple &source,
00041                                     const resip::Tuple &destination,
00042                                     const resip::Data& sigcompId);
00043       void doubleRecordRoute(resip::SipMessage &msg, 
00044                                     const resip::Tuple &source,
00045                                     const resip::Tuple &destination,
00046                                     const resip::Data& sigcompId);
00047       bool isTransportSwitch(const resip::Tuple& sendingFrom);
00048       bool outboundFlowTokenNeeded(resip::SipMessage &msg, 
00049                                     const resip::Tuple &source,
00050                                     const resip::Tuple &destination,
00051                                     const resip::Data& sigcompId);
00052       const Proxy& mProxy;
00053       int mAddedRecordRoute;
00054       bool mAlreadySingleRecordRouted;
00055       bool mHasInboundFlowToken;
00056       bool mForceRecordRouteEnabled;
00057       bool mDoPath;
00058       const bool mIsOriginalSenderBehindNAT;
00059       const resip::Transport* mReceivedTransport;
00060 
00061       //disabled
00062       RRDecorator();
00063 }; // class RRDecorator
00064 
00065 } // namespace resip
00066 
00067 #endif // include guard