reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
QValueTarget.cxx
Go to the documentation of this file.
3
4
5namespace repro
6{
7
8static int DefaultPriorityMetric = 1000; // If no q-value is present, when we treat the target as having a 1.0 priority
9
11 Target(target)
12{
13 // Note: no neeed to call storePriorityMetric(), since q value parameter
14 // is a NameAddr parameter and all we have here is a URI
15}
16
18 Target(target)
19{
20 storePriorityMetric();
21}
22
24 Target(rec)
25{
26 storePriorityMetric();
27}
28
32
35{
36 return new QValueTarget(*this);
37}
38
39void
40QValueTarget::storePriorityMetric()
41{
42 if(mRec.mContact.exists(resip::p_q))
43 {
44 try
45 {
47 }
48 catch(resip::ParseBuffer::Exception& /*e*/)
49 {
51 }
52 }
53 else
54 {
56 }
57}
58
59}
60
61/* ====================================================================
62 * The Vovida Software License, Version 1.0
63 *
64 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
65 *
66 * Redistribution and use in source and binary forms, with or without
67 * modification, are permitted provided that the following conditions
68 * are met:
69 *
70 * 1. Redistributions of source code must retain the above copyright
71 * notice, this list of conditions and the following disclaimer.
72 *
73 * 2. Redistributions in binary form must reproduce the above copyright
74 * notice, this list of conditions and the following disclaimer in
75 * the documentation and/or other materials provided with the
76 * distribution.
77 *
78 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
79 * and "Vovida Open Communication Application Library (VOCAL)" must
80 * not be used to endorse or promote products derived from this
81 * software without prior written permission. For written
82 * permission, please contact vocal@vovida.org.
83 *
84 * 4. Products derived from this software may not be called "VOCAL", nor
85 * may "VOCAL" appear in their name, without prior written
86 * permission of Vovida Networks, Inc.
87 *
88 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
89 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
90 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
91 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
92 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
93 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
94 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
95 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
96 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
97 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
98 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
99 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
100 * DAMAGE.
101 *
102 * ====================================================================
103 */
virtual QValueTarget * clone() const
QValueTarget(const resip::Uri &target)
resip::ContactInstanceRecord mRec
Definition Target.hxx:74
int mPriorityMetric
Higher value denotes higher priority.
Definition Target.hxx:68
A single contact record, bound to an Aor during registration.
Represents the "name-addr" and the "addr-spec" elements in the RFC 3261 grammar.
Definition NameAddr.hxx:19
bool exists(const Param< NameAddr > &paramType) const
Definition NameAddr.cxx:477
const Data & param(const ExtensionParameter &param) const
Const accessor for non-natively-supported parameter types.
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Definition Uri.hxx:22
This Class is used to implement a primitive form of RPC using loose XML formatting.
static int DefaultPriorityMetric