1 |
jason |
5276 |
#include "resip/dum/MergedRequestKey.hxx" |
2 |
derek |
5283 |
#include "resip/stack/SipMessage.hxx" |
3 |
|
|
#include "resip/stack/CSeqCategory.hxx" |
4 |
jason |
2879 |
|
5 |
|
|
using namespace resip; |
6 |
|
|
|
7 |
|
|
const MergedRequestKey MergedRequestKey::Empty; |
8 |
|
|
|
9 |
|
|
MergedRequestKey::MergedRequestKey() |
10 |
|
|
{ |
11 |
|
|
} |
12 |
|
|
|
13 |
|
|
MergedRequestKey::MergedRequestKey(const SipMessage& req) : |
14 |
|
|
mRequestUri(Data::from(req.header(h_RequestLine).uri())), |
15 |
jason |
4010 |
mCSeq(Data::from(req.header(h_CSeq))), |
16 |
derek |
3295 |
mTag(req.header(h_From).exists(p_tag) ? req.header(h_From).param(p_tag) : Data::Empty), |
17 |
jason |
2879 |
mCallId(req.header(h_CallID).value()) |
18 |
|
|
{ |
19 |
|
|
} |
20 |
|
|
|
21 |
|
|
bool |
22 |
|
|
MergedRequestKey::operator==(const MergedRequestKey& other) const |
23 |
|
|
{ |
24 |
|
|
return (mCallId == other.mCallId && |
25 |
|
|
mTag == other.mTag && |
26 |
jason |
4010 |
mCSeq == other.mCSeq && |
27 |
jason |
2879 |
mRequestUri == other.mRequestUri); |
28 |
|
|
} |
29 |
|
|
|
30 |
|
|
bool |
31 |
|
|
MergedRequestKey::operator!=(const MergedRequestKey& other) const |
32 |
|
|
{ |
33 |
|
|
return !(*this == other); |
34 |
|
|
} |
35 |
|
|
|
36 |
|
|
bool |
37 |
|
|
MergedRequestKey::operator<(const MergedRequestKey& other) const |
38 |
|
|
{ |
39 |
|
|
if ( mCallId < other.mCallId) |
40 |
|
|
{ |
41 |
|
|
return true; |
42 |
|
|
} |
43 |
|
|
else if (mCallId > other.mCallId) |
44 |
|
|
{ |
45 |
|
|
return false; |
46 |
|
|
} |
47 |
|
|
|
48 |
|
|
if (mTag < other.mTag) |
49 |
|
|
{ |
50 |
|
|
return true; |
51 |
|
|
} |
52 |
|
|
else if (mTag > other.mTag) |
53 |
|
|
{ |
54 |
|
|
return false; |
55 |
|
|
} |
56 |
|
|
|
57 |
jason |
4010 |
if (mCSeq < other.mCSeq) |
58 |
jason |
2879 |
{ |
59 |
|
|
return true; |
60 |
|
|
} |
61 |
jason |
4010 |
else if (mCSeq > other.mCSeq) |
62 |
jason |
2879 |
{ |
63 |
|
|
return false; |
64 |
|
|
} |
65 |
|
|
|
66 |
|
|
return (mRequestUri < other.mRequestUri); |
67 |
|
|
} |
68 |
|
|
|
69 |
jason |
4010 |
Data& MergedRequestKey::cseq() |
70 |
|
|
{ |
71 |
|
|
return mCSeq; |
72 |
|
|
} |
73 |
|
|
|
74 |
|
|
const Data& MergedRequestKey::cseq() const |
75 |
|
|
{ |
76 |
|
|
return mCSeq; |
77 |
|
|
} |
78 |
|
|
|
79 |
|
|
|
80 |
|
|
/* ==================================================================== |
81 |
|
|
* The Vovida Software License, Version 1.0 |
82 |
|
|
* |
83 |
|
|
* Copyright (c) 2000 Vovida Networks, Inc. All rights reserved. |
84 |
|
|
* |
85 |
|
|
* Redistribution and use in source and binary forms, with or without |
86 |
|
|
* modification, are permitted provided that the following conditions |
87 |
|
|
* are met: |
88 |
|
|
* |
89 |
|
|
* 1. Redistributions of source code must retain the above copyright |
90 |
|
|
* notice, this list of conditions and the following disclaimer. |
91 |
|
|
* |
92 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright |
93 |
|
|
* notice, this list of conditions and the following disclaimer in |
94 |
|
|
* the documentation and/or other materials provided with the |
95 |
|
|
* distribution. |
96 |
|
|
* |
97 |
|
|
* 3. The names "VOCAL", "Vovida Open Communication Application Library", |
98 |
|
|
* and "Vovida Open Communication Application Library (VOCAL)" must |
99 |
|
|
* not be used to endorse or promote products derived from this |
100 |
|
|
* software without prior written permission. For written |
101 |
|
|
* permission, please contact vocal@vovida.org. |
102 |
|
|
* |
103 |
|
|
* 4. Products derived from this software may not be called "VOCAL", nor |
104 |
|
|
* may "VOCAL" appear in their name, without prior written |
105 |
|
|
* permission of Vovida Networks, Inc. |
106 |
|
|
* |
107 |
|
|
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED |
108 |
|
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
109 |
|
|
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND |
110 |
|
|
* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA |
111 |
|
|
* NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES |
112 |
|
|
* IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL, |
113 |
|
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
114 |
|
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
115 |
|
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
116 |
|
|
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
117 |
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE |
118 |
|
|
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH |
119 |
|
|
* DAMAGE. |
120 |
|
|
* |
121 |
|
|
* ==================================================================== |
122 |
|
|
* |
123 |
|
|
* This software consists of voluntary contributions made by Vovida |
124 |
|
|
* Networks, Inc. and many individuals on behalf of Vovida Networks, |
125 |
|
|
* Inc. For more information on Vovida Networks, Inc., please see |
126 |
|
|
* <http://www.vovida.org/>. |
127 |
|
|
* |
128 |
|
|
*/ |