reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
DialogUsage.cxx
Go to the documentation of this file.
7#include "rutil/ResipAssert.h"
8#include "rutil/Logger.hxx"
9
10#define RESIPROCATE_SUBSYSTEM Subsystem::DUM
11
12using namespace resip;
13
14DialogUsage::Exception::Exception(const Data& msg, const Data& file, const int line)
15 : BaseException(msg, file, line)
16{
17}
18
19const char*
21{
22 return "DialogUsage::Exception";
23}
24
26 BaseUsage(dum),
27 mDialog(dialog)
28{
29}
30
32{
33 mDialog.possiblyDie();
34}
35
38{
39 if (mDialog.mDialogSet.mAppDialogSet == nullptr)
40 {
41 ErrLog(<< "mDialog.mDialogSet.mAppDialogSet is NULL!!!");
42 return AppDialogSetHandle();
43 }
44 return mDialog.mDialogSet.mAppDialogSet->getHandle();
45}
46
49{
50 return mDialog.mAppDialog->getHandle();
51}
52
53const NameAddr&
54DialogUsage::myAddr() const noexcept
55{
56 return mDialog.mLocalNameAddr;
57}
58
59const NameAddr&
60DialogUsage::peerAddr() const noexcept
61{
62 return mDialog.mRemoteNameAddr;
63}
64
65const NameAddr&
67{
68 return mDialog.mRemoteTarget;
69}
70
71const NameAddr&
73{
74 return mDialog.mPendingRemoteTarget;
75}
76
77const NameAddrs&
79{
80 return mDialog.mRouteSet;
81}
82
83const DialogId&
85{
86 return mDialog.getId();
87}
88
89const Data&
91{
92 return mDialog.getId().getCallId();
93}
94
95std::shared_ptr<UserProfile>
97{
98 return mDialog.mDialogSet.getUserProfile();
99}
100
101void
102DialogUsage::send(std::shared_ptr<SipMessage> msg)
103{
104 // give app an chance to adorn the message.
105 onReadyToSend(*msg);
106 mDialog.send(msg);
107}
108
109void
110DialogUsage::sendCommand(std::shared_ptr<SipMessage> message)
111{
112 mDum.post(new DialogUsageSendCommand(*this, message));
113}
114
115
116/*
117void
118DialogUsage::send(SipMessage& msg)
119{
120 resip_assert(msg.isResponse() || msg.header(h_RequestLine).method() == ACK);
121 mDialog.send(msg);
122}
123*/
124
125/* ====================================================================
126 * The Vovida Software License, Version 1.0
127 *
128 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
129 *
130 * Redistribution and use in source and binary forms, with or without
131 * modification, are permitted provided that the following conditions
132 * are met:
133 *
134 * 1. Redistributions of source code must retain the above copyright
135 * notice, this list of conditions and the following disclaimer.
136 *
137 * 2. Redistributions in binary form must reproduce the above copyright
138 * notice, this list of conditions and the following disclaimer in
139 * the documentation and/or other materials provided with the
140
141 * distribution.
142 *
143 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
144 * and "Vovida Open Communication Application Library (VOCAL)" must
145 * not be used to endorse or promote products derived from this
146 * software without prior written permission. For written
147 * permission, please contact vocal@vovida.org.
148 *
149 * 4. Products derived from this software may not be called "VOCAL", nor
150 * may "VOCAL" appear in their name, without prior written
151 * permission of Vovida Networks, Inc.
152 *
153 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
154 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
155 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
156 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
157 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
158 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
159 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
160 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
161 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
162 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
163 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
164 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
165 * DAMAGE.
166 *
167 * ====================================================================
168 *
169 * This software consists of voluntary contributions made by Vovida
170 * Networks, Inc. and many individuals on behalf of Vovida Networks,
171 * Inc. For more information on Vovida Networks, Inc., please see
172 * <http://www.vovida.org/>.
173 *
174 */
#define ErrLog(args_)
Definition Logger.hxx:137
AppDialogSetHandle getHandle()
AppDialogHandle getHandle()
Definition AppDialog.cxx:18
The abstract base-class for all exceptions thrown by resip code.
DialogUsageManager & mDum
Definition BaseUsage.hxx:43
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
const Data & getCallId() const
Definition DialogId.cxx:99
std::shared_ptr< UserProfile > getUserProfile() const
Exception(const Data &msg, const Data &file, int line)
const char * name() const noexcept override
virtual void sendCommand(std::shared_ptr< SipMessage > msg)
const NameAddr & remoteTarget() const noexcept
std::shared_ptr< UserProfile > getUserProfile() const
const NameAddr & myAddr() const noexcept
virtual void onReadyToSend(SipMessage &)
AppDialogSetHandle getAppDialogSet() const
AppDialogHandle getAppDialog() const
const NameAddr & pendingRemoteTarget() const
const DialogId & getDialogId() const
DialogUsage(DialogUsageManager &dum, Dialog &dialog)
const NameAddrs & getRouteSet() const noexcept
virtual void send(std::shared_ptr< SipMessage > msg)
const NameAddr & peerAddr() const noexcept
const Data & getCallId() const
dcm! – kill typedef std::list<DialogId> DialogIdSet;
Definition Dialog.hxx:29
const DialogId & getId() const noexcept
Definition Dialog.cxx:325
void send(std::shared_ptr< SipMessage > msg)
Definition Dialog.cxx:1198
Represents the "name-addr" and the "addr-spec" elements in the RFC 3261 grammar.
Definition NameAddr.hxx:19
void post(Message *msg)
Posts a Message to this TransactionUser's fifo.
dcm! – add UnusedChecking(_enum) below;
Handle< AppDialogSet > AppDialogSetHandle
Definition Handles.hxx:27
Handle< AppDialog > AppDialogHandle
Definition Handles.hxx:28