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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9890 - (show annotations) (download)
Wed Oct 24 13:08:48 2012 UTC (7 years ago) by sgodin
File MIME type: text/plain
File size: 4586 byte(s)
-add additional accessor to ClientPagerMessage to retrieve the stored request message as a
 SharedPtr instead of a reference.  This allows the caller to adorn the message and then call 
 DialogUsageManager::send safely (if queueing and/or message bodies are not desired when sending 
 a SIP MESSAGE request)
1 #if !defined(RESIP_CLIENTPAGERMESSAGE_HXX)
2 #define RESIP_CLIENTPAGERMESSAGE_HXX
3
4 #include "resip/dum/NonDialogUsage.hxx"
5 #include "resip/stack/CSeqCategory.hxx"
6 #include "resip/stack/SipMessage.hxx"
7 #include "resip/dum/DialogUsageManager.hxx"
8 #include <deque>
9 #include <memory>
10
11 namespace resip
12 {
13 class SipMessage;
14
15 class ClientPagerMessage : public NonDialogUsage
16 {
17 public:
18 ClientPagerMessage(DialogUsageManager& dum, DialogSet& dialogSet);
19 ClientPagerMessageHandle getHandle();
20
21 //allow the user to adorn the MESSAGE message if desired
22 //!kh!
23 //I don't know how this would interact with the queuing mechanism.
24 //Will come back to re-visit this in the future.
25 SipMessage& getMessageRequest();
26 SharedPtr<SipMessage> getMessageRequestSharedPtr() { return mRequest; }
27
28 //!kh!
29 //queues the message if there is one sent but not yet received a response
30 //for it.
31 //asserts if contents->get() is NULL.
32 virtual void page(std::auto_ptr<Contents> contents, DialogUsageManager::EncryptionLevel level=DialogUsageManager::None);
33 virtual void end();
34
35 /**
36 * Provide asynchronous method access by using command
37 */
38 virtual void endCommand();
39 virtual void pageCommand(std::auto_ptr<Contents> contents, DialogUsageManager::EncryptionLevel level=DialogUsageManager::None);
40
41 virtual void dispatch(const SipMessage& msg);
42 virtual void dispatch(const DumTimeout& timer);
43
44 size_t msgQueued () const;
45
46 virtual EncodeStream& dump(EncodeStream& strm) const;
47
48 protected:
49 virtual ~ClientPagerMessage();
50
51 private:
52 friend class DialogSet;
53
54 //uses memory from creator
55 //SipMessage& mRequest;
56 SharedPtr<SipMessage> mRequest;
57
58 typedef struct
59 {
60 DialogUsageManager::EncryptionLevel encryptionLevel;
61 Contents* contents;
62 } Item;
63
64 typedef std::deque<Item> MsgQueue;
65 MsgQueue mMsgQueue;
66 bool mEnded;
67
68 // disabled
69 ClientPagerMessage(const ClientPagerMessage&);
70 ClientPagerMessage& operator=(const ClientPagerMessage&);
71
72 void pageFirstMsgQueued ();
73 void clearMsgQueued ();
74 };
75
76 }
77
78 #endif
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
96 * distribution.
97 *
98 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
99 * and "Vovida Open Communication Application Library (VOCAL)" must
100 * not be used to endorse or promote products derived from this
101 * software without prior written permission. For written
102 * permission, please contact vocal@vovida.org.
103 *
104 * 4. Products derived from this software may not be called "VOCAL", nor
105 * may "VOCAL" appear in their name, without prior written
106 * permission of Vovida Networks, Inc.
107 *
108 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
109 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
110 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
111 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
112 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
113 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
114 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
115 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
116 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
117 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
118 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
119 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
120 * DAMAGE.
121 *
122 * ====================================================================
123 *
124 * This software consists of voluntary contributions made by Vovida
125 * Networks, Inc. and many individuals on behalf of Vovida Networks,
126 * Inc. For more information on Vovida Networks, Inc., please see
127 * <http://www.vovida.org/>.
128 *
129 */

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