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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

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

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