reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
RedirectManager.hxx
Go to the documentation of this file.
1#if !defined(RESIP_REDIRECTMANAGER_HXX)
2#define RESIP_REDIRECTMANAGER_HXX
3
4
5#include <set>
6#include <queue>
7#include <functional>
8#include <vector>
9
10#include "resip/dum/Handles.hxx"
14#include "rutil/HashMap.hxx"
15
16//8.1.3.4
17//19.1.5
18
19namespace resip
20{
21
22class DialogSet;
23
25{
26 public:
28 {
29 public:
30 virtual ~Ordering() {}
31 virtual bool operator()(const NameAddr& lhs, const NameAddr& rhs) const;
32 };
33 virtual ~RedirectManager() {}
34 virtual bool handle(DialogSet& dSet, SipMessage& origRequest, const SipMessage& response);
35
36 //deafult is by q-value, no q-value treated as 1.0
37 void setOrdering(const Ordering& order);
38
40
41 //based on follows 8.1.3.4 of 3261. Overload to interject user decisions
42 //or to process 301, 305 or 380 reponses.
43// virtual void onRedirect(AppDialogSetHandle, const SipMessage& response);
44 //use a priority queue by q-value, and a list(linear, set too heavy?) of
45 //values that have been tried. Do q-values really have any meaning across
46 //different 3xx values? Or should the first 3xx always win.
47 protected:
49 {
50 public:
51 TargetSet(const SipMessage& request, const Ordering& order) :
52 mTargetQueue(order),
53 mRequest(request)
54 {}
55
56 void addTargets(const SipMessage& msg);
57 //pass in the message stored in the creator
58 bool makeNextRequest(SipMessage& request);
59 protected:
60 typedef std::set<NameAddr> EncounteredTargetSet;
61 typedef std::priority_queue<NameAddr, std::vector<NameAddr>, Ordering> TargetQueue;
62
65 //mLastRequest in creator is kept in sync with this, this is needed
66 //so that embedded information in a target uri does not migrate to
67 //the wrong attempt
69 };
70
71 typedef HashMap<DialogSetId, TargetSet*> RedirectedRequestMap;
74};
75
76
77}
78
79#endif
80
81/* ====================================================================
82 * The Vovida Software License, Version 1.0
83 *
84 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
85 *
86 * Redistribution and use in source and binary forms, with or without
87 * modification, are permitted provided that the following conditions
88 * are met:
89 *
90 * 1. Redistributions of source code must retain the above copyright
91 * notice, this list of conditions and the following disclaimer.
92 *
93 * 2. Redistributions in binary form must reproduce the above copyright
94 * notice, this list of conditions and the following disclaimer in
95 * the documentation and/or other materials provided with the
96 * distribution.
97 *
98 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
99 * and "Vovida Open Communication Application Library (VOCAL)" must
100 * not be used to endorse or promote products derived from this
101 * software without prior written permission. For written
102 * permission, please contact vocal@vovida.org.
103 *
104 * 4. Products derived from this software may not be called "VOCAL", nor
105 * may "VOCAL" appear in their name, without prior written
106 * permission of Vovida Networks, Inc.
107 *
108 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
109 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
110 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
111 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
112 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
113 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
114 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
115 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
116 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
117 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
118 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
119 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
120 * DAMAGE.
121 *
122 * ====================================================================
123 *
124 * This software consists of voluntary contributions made by Vovida
125 * Networks, Inc. and many individuals on behalf of Vovida Networks,
126 * Inc. For more information on Vovida Networks, Inc., please see
127 * <http://www.vovida.org/>.
128 *
129 */
Wraps your platform's implementation of hash_map, hash_multimap, and hash_set.
Represents the "name-addr" and the "addr-spec" elements in the RFC 3261 grammar.
Definition NameAddr.hxx:19
virtual bool operator()(const NameAddr &lhs, const NameAddr &rhs) const
bool makeNextRequest(SipMessage &request)
void addTargets(const SipMessage &msg)
TargetSet(const SipMessage &request, const Ordering &order)
std::priority_queue< NameAddr, std::vector< NameAddr >, Ordering > TargetQueue
std::set< NameAddr > EncounteredTargetSet
void removeDialogSet(DialogSetId id)
virtual bool handle(DialogSet &dSet, SipMessage &origRequest, const SipMessage &response)
HashMap< DialogSetId, TargetSet * > RedirectedRequestMap
void setOrdering(const Ordering &order)
RedirectedRequestMap mRedirectedRequestMap
Represents a SIP message.
dcm! – add UnusedChecking(_enum) below;