reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
RequestContext.hxx
Go to the documentation of this file.
1#if !defined(RESIP_REQUEST_CONTEXT_HXX)
2#define RESIP_REQUEST_CONTEXT_HXX
3
4#include <memory>
5#include <vector>
6#include <iosfwd>
7#include "resip/stack/Uri.hxx"
11#include "resip/stack/Token.hxx"
16
17namespace resip
18{
19class SipMessage;
20class TransactionTerminated;
21}
22
23
24namespace repro
25{
26class Proxy;
27
29{
30 public:
32 ProcessorChain& requestP, // monkeys
33 ProcessorChain& responseP, // lemurs
34 ProcessorChain& targetP); // baboons
35 virtual ~RequestContext();
36
37 virtual void process(resip::TransactionTerminated& msg);
38 virtual void process(std::unique_ptr<resip::SipMessage> sip);
39 virtual void process(std::unique_ptr<resip::ApplicationMessage> app);
40
42 virtual bool handleMissingResponseVias(resip::SipMessage* response); // return true to continue processing
43 virtual void cancelClientTransaction(const resip::Data& tid, const resip::Tokens* reasons = 0);
44
49
53 const resip::Message* getCurrentEvent() const;
54
55 void setDigestIdentity (const resip::Data&);
56 const resip::Data& getDigestIdentity() const;
57
58 Proxy& getProxy();
60
65
66 virtual void send(resip::SipMessage& msg);
68
69 virtual void forwardAck200(const resip::SipMessage& ack);
70 void postAck200Done();
71
74
75 void postTimedMessage(std::unique_ptr<resip::ApplicationMessage> msg,int seconds);
76
77 // Accessor for per-requset extensible state storage for monkeys
79
81 protected:
88
97
102 bool mTopRouteFlowTupleSet; // Provided so caller can avoid needing to compare mTopRouteFlowTuple to and empty Tuple() to check if set or not
103 resip::Tuple mTopRouteFlowTuple; // extracted from mTopRoute if valid Flow-Token is present
104 std::unique_ptr<ResponseContext> mResponseContext;
108
109 typedef std::vector<ProcessorChain::Chain::iterator>
110
116
117 virtual void fixStrictRouterDamage();
118 virtual void removeTopRouteIfSelf();
119
120 friend class ResponseContext;
122};
123
126
127
128}
129
130#endif
131
132/* ====================================================================
133 * The Vovida Software License, Version 1.0
134 *
135 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
136 *
137 * Redistribution and use in source and binary forms, with or without
138 * modification, are permitted provided that the following conditions
139 * are met:
140 *
141 * 1. Redistributions of source code must retain the above copyright
142 * notice, this list of conditions and the following disclaimer.
143 *
144 * 2. Redistributions in binary form must reproduce the above copyright
145 * notice, this list of conditions and the following disclaimer in
146 * the documentation and/or other materials provided with the
147 * distribution.
148 *
149 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
150 * and "Vovida Open Communication Application Library (VOCAL)" must
151 * not be used to endorse or promote products derived from this
152 * software without prior written permission. For written
153 * permission, please contact vocal@vovida.org.
154 *
155 * 4. Products derived from this software may not be called "VOCAL", nor
156 * may "VOCAL" appear in their name, without prior written
157 * permission of Vovida Networks, Inc.
158 *
159 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
160 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
161 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
162 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
163 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
164 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
165 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
166 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
167 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
168 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
169 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
170 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
171 * DAMAGE.
172 *
173 * ====================================================================
174 *
175 * This software consists of voluntary contributions made by Vovida
176 * Networks, Inc. and many individuals on behalf of Vovida Networks,
177 * Inc. For more information on Vovida Networks, Inc., please see
178 * <http://www.vovida.org/>.
179 *
180 */
virtual void handleSelfAimedStrayAck(resip::SipMessage *sip)
resip::Tuple mTopRouteFlowTuple
resip::SipMessage & getOriginalRequest()
Returns the SipMessage associated with the server transaction.
resip::SipMessage * mAck200ToRetransmit
ChainIteratorStack mChainIteratorStack
resip::KeyValueStore mKeyValueStore
void doPostResponseProcessing(resip::SipMessage *msg)
ProcessorChain & mRequestProcessorChain
bool processResponseNonInviteTransaction(resip::SipMessage *msg)
void postTimedMessage(std::unique_ptr< resip::ApplicationMessage > msg, int seconds)
virtual void removeTopRouteIfSelf()
Pops the topmost route if it's us.
virtual void process(resip::TransactionTerminated &msg)
virtual bool handleMissingResponseVias(resip::SipMessage *response)
void setDigestIdentity(const resip::Data &)
const resip::Data & getDigestRealm()
resip::Message * getCurrentEvent()
Returns the event that we are currently working on.
std::unique_ptr< ResponseContext > mResponseContext
void doPostRequestProcessing(resip::SipMessage *msg, bool original)
void processRequestAckTransaction(resip::SipMessage *msg, bool original)
resip::Message * mCurrentEvent
virtual void cancelClientTransaction(const resip::Data &tid, const resip::Tokens *reasons=0)
virtual void fixStrictRouterDamage()
resip::NameAddr mTopRoute
ResponseContext & getResponseContext()
ProcessorChain & mTargetProcessorChain
std::vector< ProcessorChain::Chain::iterator > ChainIteratorStack
Stack of iterators used to keep track of where we are in the request processor chain(s) for async pro...
virtual void send(resip::SipMessage &msg)
void processResponseAckTransaction(resip::SipMessage *msg)
resip::SipMessage * mOriginalRequest
virtual void forwardAck200(const resip::SipMessage &ack)
resip::Tuple & getTopRouteFlowTuple()
bool processResponseInviteTransaction(resip::SipMessage *msg)
bool processRequestNonInviteTransaction(resip::SipMessage *msg, bool original)
const resip::Data & getDigestIdentity() const
void sendResponse(resip::SipMessage &response)
resip::NameAddr & getTopRoute()
bool processRequestInviteTransaction(resip::SipMessage *msg, bool original)
ProcessorChain & mResponseProcessorChain
resip::KeyValueStore & getKeyValueStore()
resip::Data getTransactionId() const
friend EncodeStream & operator<<(EncodeStream &strm, const repro::RequestContext &rc)
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
The base-class used for message-passing.
Definition Message.hxx:21
Represents the "name-addr" and the "addr-spec" elements in the RFC 3261 grammar.
Definition NameAddr.hxx:19
Represents a SIP message.
Represents a network address.
Definition Tuple.hxx:59
This Class is used to implement a primitive form of RPC using loose XML formatting.
EncodeStream & operator<<(EncodeStream &os, const repro::Processor &rp)
Definition Processor.cxx:69
dcm! – add UnusedChecking(_enum) below;
Replaces STL streams for general encoding purposes.
#define EncodeStream
void list()
Definition userAdmin.cxx:66