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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8983 - (show annotations) (download)
Wed Jan 19 19:50:02 2011 UTC (8 years, 9 months ago) by bcampen
File MIME type: text/plain
File size: 4237 byte(s)
Fixing another crash, and getting a number of other tests to pass.

1 #include "resip/dum/AppDialog.hxx"
2 #include "resip/dum/AppDialogSet.hxx"
3 #include "resip/dum/DialogUsage.hxx"
4 #include "resip/dum/Dialog.hxx"
5 #include "resip/dum/DialogSet.hxx"
6 #include "resip/dum/DialogUsageManager.hxx"
7 #include "rutil/Logger.hxx"
8
9 #define RESIPROCATE_SUBSYSTEM Subsystem::DUM
10
11 using namespace resip;
12
13 DialogUsage::Exception::Exception(const Data& msg,const Data& file,int line)
14 : BaseException(msg, file, line)
15 {
16 }
17
18 const char*
19 DialogUsage::Exception::name() const
20 {
21 return "DialogUsage::Exception";
22 }
23
24 DialogUsage::DialogUsage(DialogUsageManager& dum, Dialog& dialog) :
25 BaseUsage(dum),
26 mDialog(dialog)
27 {
28 }
29
30 DialogUsage::~DialogUsage()
31 {
32 mDialog.possiblyDie();
33 }
34
35 AppDialogSetHandle
36 DialogUsage::getAppDialogSet()
37 {
38 return mDialog.mDialogSet.mAppDialogSet->getHandle();
39 }
40
41 AppDialogHandle
42 DialogUsage::getAppDialog()
43 {
44 return mDialog.mAppDialog->getHandle();
45 }
46
47 const NameAddr&
48 DialogUsage::myAddr() const
49 {
50 return mDialog.mLocalNameAddr;
51 }
52
53 const NameAddr&
54 DialogUsage::peerAddr() const
55 {
56 return mDialog.mRemoteNameAddr;
57 }
58
59 const NameAddr&
60 DialogUsage::remoteTarget() const
61 {
62 return mDialog.mRemoteTarget;
63 }
64
65 const DialogId&
66 DialogUsage::getDialogId() const
67 {
68 return mDialog.getId();
69 }
70
71 const Data&
72 DialogUsage::getCallId() const
73 {
74 return mDialog.getId().getCallId();
75 }
76
77 SharedPtr<UserProfile>
78 DialogUsage::getUserProfile()
79 {
80 return mDialog.mDialogSet.getUserProfile();
81 }
82
83 void
84 DialogUsage::send(SharedPtr<SipMessage> msg)
85 {
86 // give app an chance to adorn the message.
87 onReadyToSend(*msg);
88 mDialog.send(msg);
89 }
90
91 void
92 DialogUsage::sendCommand(SharedPtr<SipMessage> message)
93 {
94 mDum.post(new DialogUsageSendCommand(*this, message));
95 }
96
97
98 /*
99 void
100 DialogUsage::send(SipMessage& msg)
101 {
102 assert(msg.isResponse() || msg.header(h_RequestLine).method() == ACK);
103 mDialog.send(msg);
104 }
105 */
106
107 /* ====================================================================
108 * The Vovida Software License, Version 1.0
109 *
110 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
111 *
112 * Redistribution and use in source and binary forms, with or without
113 * modification, are permitted provided that the following conditions
114 * are met:
115 *
116 * 1. Redistributions of source code must retain the above copyright
117 * notice, this list of conditions and the following disclaimer.
118 *
119 * 2. Redistributions in binary form must reproduce the above copyright
120 * notice, this list of conditions and the following disclaimer in
121 * the documentation and/or other materials provided with the
122
123 * distribution.
124 *
125 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
126 * and "Vovida Open Communication Application Library (VOCAL)" must
127 * not be used to endorse or promote products derived from this
128 * software without prior written permission. For written
129 * permission, please contact vocal@vovida.org.
130 *
131 * 4. Products derived from this software may not be called "VOCAL", nor
132 * may "VOCAL" appear in their name, without prior written
133 * permission of Vovida Networks, Inc.
134 *
135 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
136 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
137 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
138 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
139 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
140 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
141 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
142 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
143 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
144 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
145 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
146 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
147 * DAMAGE.
148 *
149 * ====================================================================
150 *
151 * This software consists of voluntary contributions made by Vovida
152 * Networks, Inc. and many individuals on behalf of Vovida Networks,
153 * Inc. For more information on Vovida Networks, Inc., please see
154 * <http://www.vovida.org/>.
155 *
156 */

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