/[resiprocate]/main/resip/dum/NetworkAssociation.cxx
ViewVC logotype

Contents of /main/resip/dum/NetworkAssociation.cxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9050 - (show annotations) (download)
Sat Mar 5 17:06:07 2011 UTC (8 years, 8 months ago) by sgodin
File MIME type: text/plain
File size: 4171 byte(s)
-added client and server(repro) side support for RFC5626 (outbound) Flow-Timer header
-Server side (repro)
  -added new Header Flow-Timer to HeaderHash
  -two new InteropHelper settings: 
     -setFlowTimerSeconds - if set to greater than 0 then a Flow-Timer header is 
      added to local generated REGISTER/200 response or a proxied one if outbound 
      is being used (this is the edge proxy case)
     -setFlowTimerGracePeriodSeconds - this value is used by the stack to decide 
      when connections that are using a flow-timer have timed out.  Default is 10 seconds.
  -added a new ConnectionManager::EnableAgressiveGc static member setting - if enabled 
   this will cause the connection garbage collection to run every time a new connection 
   is formed, instead of just when we run out of FD's
  -added a new enableFlowTimer method on the SipStack - this takes a Tuple parameter 
   and will "tag" the specified connection as being one in which we want to implement 
   flow-timer timeout logic on
  -modified the connection manager to keep two LRU lists - one for flow-timer enabled 
   connections and another generic one - this is to facilitate fast timeouts of flow-timer 
   enabled connections (ones where we know it is safe to expect keepalives and ones where 
   we have provided the keepalive timer value to the farend in a Flow-Timer header), and 
   a different connection timeout for non flow-timer enabled connections
  -added IntrusiveListElement3 in order to support Connection being a member in 4 different
   Intrusive lists
  -new commandline option to repro --flow-timer=X - that will enable the following settings:
   - ConnectionManager::EnableAgressiveGc
   - InteropHelper::setFlowTimerSeconds(X)
   - ConnectionManager::MinimumGcAge = 7200000; // Timeout connections not related to a flow 
                                                // timer after 2 hours of inactivity
-Client side (dum)
  - The Flow-Timer header will be read from Registration responses that have an indication 
    that the first hop proxy supports outbound
  - Flow-Timer value is then used in place of the profile keepalive timeout settings
  - If a keepalive is for an "outbound" enabled connection, then the keepalives are sent
    sometime between 80% and 100% of either the Flow-Timer header (if present) or the 
    configured keepalive time - as specified in RFC5626


1 #include "rutil/Logger.hxx"
2 #include "resip/stack/SipMessage.hxx"
3 #include "resip/dum/DialogUsageManager.hxx"
4 #include "resip/dum/NetworkAssociation.hxx"
5 #include "resip/dum/KeepAliveManager.hxx"
6
7 using namespace resip;
8
9 #define RESIPROCATE_SUBSYSTEM Subsystem::DUM
10
11 bool
12 NetworkAssociation::update(const SipMessage& msg, int keepAliveInterval, bool targetSupportsOutbound)
13 {
14 if (mDum && mDum->mKeepAliveManager.get())
15 {
16 const Tuple& source = msg.getSource();
17 if(source.getType() != 0 && // if source is populated in message
18 (!(source == mTarget) || // and (target is different from current
19 source.mFlowKey != mTarget.mFlowKey || // or flow key is different
20 mTargetSupportsOutbound != targetSupportsOutbound || // or outbound support flag is different
21 mKeepAliveInterval != keepAliveInterval)) // or keepaliveinterval is different) -> add to keepalivemanager
22 {
23 mDum->mKeepAliveManager->remove(mTarget);
24 mTarget = source;
25 mTarget.onlyUseExistingConnection = true; // Ensure that keepalives never open up a new connection
26 mTargetSupportsOutbound = targetSupportsOutbound;
27 mDum->mKeepAliveManager->add(mTarget, keepAliveInterval, targetSupportsOutbound);
28 return true;
29 }
30 }
31 return false;
32 }
33
34 void
35 NetworkAssociation::clear()
36 {
37 if (mDum && mDum->mKeepAliveManager.get())
38 {
39 mDum->mKeepAliveManager->remove(mTarget);
40 mTarget = Tuple();
41 mTargetSupportsOutbound = false;
42 mKeepAliveInterval = 0;
43 }
44 }
45
46 NetworkAssociation::~NetworkAssociation()
47 {
48 if (mDum && mDum->mKeepAliveManager.get())
49 {
50 mDum->mKeepAliveManager->remove(mTarget);
51 }
52 }
53
54
55
56 /* ====================================================================
57 * The Vovida Software License, Version 1.0
58 *
59 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
60 *
61 * Redistribution and use in source and binary forms, with or without
62 * modification, are permitted provided that the following conditions
63 * are met:
64 *
65 * 1. Redistributions of source code must retain the above copyright
66 * notice, this list of conditions and the following disclaimer.
67 *
68 * 2. Redistributions in binary form must reproduce the above copyright
69 * notice, this list of conditions and the following disclaimer in
70 * the documentation and/or other materials provided with the
71 * distribution.
72 *
73 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
74 * and "Vovida Open Communication Application Library (VOCAL)" must
75 * not be used to endorse or promote products derived from this
76 * software without prior written permission. For written
77 * permission, please contact vocal@vovida.org.
78 *
79 * 4. Products derived from this software may not be called "VOCAL", nor
80 * may "VOCAL" appear in their name, without prior written
81 * permission of Vovida Networks, Inc.
82 *
83 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
84 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
85 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
86 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
87 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
88 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
89 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
90 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
91 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
92 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
93 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
94 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
95 * DAMAGE.
96 *
97 * ====================================================================
98 *
99 * This software consists of voluntary contributions made by Vovida
100 * Networks, Inc. and many individuals on behalf of Vovida Networks,
101 * Inc. For more information on Vovida Networks, Inc., please see
102 * <http://www.vovida.org/>.
103 *
104 */

Properties

Name Value
svn:eol-style native
svn:mime-type text/plain

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27