reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
ClientPagerMessage.hxx
Go to the documentation of this file.
1#if !defined(RESIP_CLIENTPAGERMESSAGE_HXX)
2#define RESIP_CLIENTPAGERMESSAGE_HXX
3
8#include <deque>
9#include <memory>
10
11namespace resip
12{
13class SipMessage;
14
16{
17 public:
21
24
26
27 //allow the user to adorn the MESSAGE message if desired
29 //I don't know how this would interact with the queuing mechanism.
30 //Will come back to re-visit this in the future.
31 SipMessage& getMessageRequest() noexcept;
32 std::shared_ptr<SipMessage> getMessageRequestSharedPtr() const noexcept { return mRequest; }
33
35 //queues the message if there is one sent but not yet received a response
36 //for it.
37 //asserts if contents->get() is NULL.
38 virtual void page(std::unique_ptr<Contents> contents, DialogUsageManager::EncryptionLevel level=DialogUsageManager::None);
39 void end() override;
40
41 // Use this API if the application has ongoing pending messages and it is using
42 // getMessageRequest to modify the target routing information for messages (ie:
43 // requestUri or Route headers). This will cause the current pending message to
44 // be re-sent immediately using the new information that the application just set.
45 // Any onSuccess or onFailure callbacks that might result from the active pending
46 // message at the time this is called will be suppressed. Any messages queued
47 // behind that message will be dispatched sequentially to the new target.
48 void newTargetInfoSet();
49
53 virtual void endCommand();
54 virtual void pageCommand(std::unique_ptr<Contents> contents, DialogUsageManager::EncryptionLevel level=DialogUsageManager::None);
55
56 void dispatch(const SipMessage& msg) override;
57 void dispatch(const DumTimeout& timer) override;
58
59 size_t msgQueued() const;
60
61 EncodeStream& dump(EncodeStream& strm) const override;
62
63 protected:
64 virtual ~ClientPagerMessage();
65
66 private:
67 friend class DialogSet;
68
69 //uses memory from creator
70 //SipMessage& mRequest;
71 std::shared_ptr<SipMessage> mRequest;
72
73 typedef struct
74 {
76 Contents* contents;
77 } Item;
78
79 typedef std::deque<Item> MsgQueue;
80 MsgQueue mMsgQueue;
81 bool mEnded;
82
83 void pageFirstMsgQueued();
84 void clearMsgQueued();
85};
86
87}
88
89#endif
90
91/* ====================================================================
92 * The Vovida Software License, Version 1.0
93 *
94 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
95 *
96 * Redistribution and use in source and binary forms, with or without
97 * modification, are permitted provided that the following conditions
98 * are met:
99 *
100 * 1. Redistributions of source code must retain the above copyright
101 * notice, this list of conditions and the following disclaimer.
102 *
103 * 2. Redistributions in binary form must reproduce the above copyright
104 * notice, this list of conditions and the following disclaimer in
105 * the documentation and/or other materials provided with the
106
107 * distribution.
108 *
109 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
110 * and "Vovida Open Communication Application Library (VOCAL)" must
111 * not be used to endorse or promote products derived from this
112 * software without prior written permission. For written
113 * permission, please contact vocal@vovida.org.
114 *
115 * 4. Products derived from this software may not be called "VOCAL", nor
116 * may "VOCAL" appear in their name, without prior written
117 * permission of Vovida Networks, Inc.
118 *
119 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
120 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
121 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
122 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
123 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
124 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
125 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
126 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
127 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
128 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
129 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
130 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
131 * DAMAGE.
132 *
133 * ====================================================================
134 *
135 * This software consists of voluntary contributions made by Vovida
136 * Networks, Inc. and many individuals on behalf of Vovida Networks,
137 * Inc. For more information on Vovida Networks, Inc., please see
138 * <http://www.vovida.org/>.
139 *
140 */
virtual void endCommand()
Provide asynchronous method access by using command.
ClientPagerMessage & operator=(ClientPagerMessage &&)=delete
EncodeStream & dump(EncodeStream &strm) const override
ClientPagerMessage(const ClientPagerMessage &)=delete
ClientPagerMessageHandle getHandle()
virtual void pageCommand(std::unique_ptr< Contents > contents, DialogUsageManager::EncryptionLevel level=DialogUsageManager::None)
void dispatch(const SipMessage &msg) override
SipMessage & getMessageRequest() noexcept
kh!
ClientPagerMessage & operator=(const ClientPagerMessage &)=delete
ClientPagerMessage(ClientPagerMessage &&)=delete
virtual void page(std::unique_ptr< Contents > contents, DialogUsageManager::EncryptionLevel level=DialogUsageManager::None)
kh!
std::shared_ptr< SipMessage > getMessageRequestSharedPtr() const noexcept
Base class for all SIP body types.
Definition Contents.hxx:51
Represents a SIP message.
dcm! – add UnusedChecking(_enum) below;
#define EncodeStream