1
#if !defined(RESIP_TUIM_HXX)
6
#include "resip/stack/DeprecatedDialog.hxx"
7
#include "resip/stack/SecurityTypes.hxx"
8
#include "resip/stack/Transport.hxx"
9
#include "resip/stack/SipStack.hxx"
10
#include "rutil/Timer.hxx"
28
virtual void receivedPage(const Data& msg,
31
SignatureStatus sigStatus,
32
bool wasEncryped ) = 0;
33
virtual void sendPageFailed(const Uri& dest, int respNumber ) =0;
34
virtual void receivePageFailed(const Uri& sender) =0;
35
virtual void registrationFailed(const Uri& dest, int respNumber ) =0;
36
virtual void registrationWorked(const Uri& dest ) =0;
37
virtual void presenceUpdate(const Uri& user, bool open, const Data& status ) =0;
38
virtual bool authorizeSubscription( const Uri& user ); // return
49
const int registrationTimeSeconds = 1*60*60,
50
const int subscriptionTimeSeconds = 10*60 );
53
void setOutboundProxy( const Uri& uri );
54
void setDefaultProtocol( TransportType protocol );
55
void setUAName( const Data& name );
57
bool haveCerts( bool sign, const Data& encryptFor );
58
void sendPage(const Data& text, const Uri& dest,
59
const bool sign=false, const Data& encryptFor = Data::Empty );
63
// Registration management
64
void registerAor( const Uri& uri,
65
const Data& password = Data::Empty );
67
// Buddy List management
68
int getNumBuddies() const;
69
const Uri getBuddyUri(const int index);
70
const Data getBuddyGroup(const int index);
71
bool getBuddyStatus(const int index, Data* status=NULL);
72
void addBuddy( const Uri& uri, const Data& group );
73
void removeBuddy( const Uri& name);
75
// Presence management
76
void setMyPresence( const bool open,
77
const Data& status = Data::Empty,
78
const Data& user = Data::Empty );
79
void addStateAgent( const Uri& uri );
80
void authorizeSubscription( const Data& user );
83
void processSipFrag(SipMessage* msg);
85
void processRequest(SipMessage* msg);
86
void processMessageRequest(SipMessage* msg);
87
void processSubscribeRequest(SipMessage* msg);
88
void processRegisterRequest(SipMessage* msg);
89
void processNotifyRequest(SipMessage* msg);
91
void processResponse(SipMessage* msg);
92
void processRegisterResponse(SipMessage* msg);
93
void processSubscribeResponse(SipMessage* msg, Buddy& buddy );
94
void processNotifyResponse(SipMessage* msg, DeprecatedDialog& d );
95
void processPublishResponse(SipMessage* msg, StateAgent& sa );
96
void processPageResponse(SipMessage* msg, Page& page );
98
void sendNotify(DeprecatedDialog* dialog);
99
void sendPublish(StateAgent& dialog);
101
void setOutbound( SipMessage& msg );
103
void subscribeBuddy( Buddy& buddy );
115
DeprecatedDialog* presDialog;
116
UInt64 mNextTimeToSubscribe;
121
Buddy(const Buddy& rhs)
125
presDialog = rhs.presDialog;
126
mNextTimeToSubscribe = rhs.mNextTimeToSubscribe;
132
// people I subscribe to
133
std::vector<Buddy> mBuddies;
134
typedef std::vector<Buddy>::iterator BuddyIterator;
140
DeprecatedDialog* dialog;
142
// people I publish to
143
std::list<StateAgent> mStateAgents;
144
typedef std::list<StateAgent>::iterator StateAgentIterator;
146
// people who subscribe to me
152
DeprecatedDialog* dialog;
154
std::list<Subscriber> mSubscribers;
155
typedef std::list<Subscriber>::iterator SubscriberIterator;
164
DeprecatedDialog* dialog;
166
// outstanding messages
167
std::list<Page> mPages;
168
typedef std::list<Page>::iterator PageIterator;
173
// registration information
174
DeprecatedDialog mRegistrationDialog;
175
UInt64 mNextTimeToRegister;
176
Data mRegistrationPassword;
177
unsigned int mLastAuthCSeq; // This is the CSeq of the last registration message
178
// sent that included digest authorization information
180
const int mRegistrationTimeSeconds; // this is the default time to request in
183
const int mSubscriptionTimeSeconds; // this is the default time to request in
188
TransportType mDefaultProtocol;
195
/* ====================================================================
196
* The Vovida Software License, Version 1.0
198
* Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
200
* Redistribution and use in source and binary forms, with or without
201
* modification, are permitted provided that the following conditions
204
* 1. Redistributions of source code must retain the above copyright
205
* notice, this list of conditions and the following disclaimer.
207
* 2. Redistributions in binary form must reproduce the above copyright
208
* notice, this list of conditions and the following disclaimer in
209
* the documentation and/or other materials provided with the
212
* 3. The names "VOCAL", "Vovida Open Communication Application Library",
213
* and "Vovida Open Communication Application Library (VOCAL)" must
214
* not be used to endorse or promote products derived from this
215
* software without prior written permission. For written
216
* permission, please contact vocal@vovida.org.
218
* 4. Products derived from this software may not be called "VOCAL", nor
219
* may "VOCAL" appear in their name, without prior written
220
* permission of Vovida Networks, Inc.
222
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
223
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
224
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
225
* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
226
* NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
227
* IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
228
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
229
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
230
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
231
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
232
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
233
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
236
* ====================================================================
238
* This software consists of voluntary contributions made by Vovida
239
* Networks, Inc. and many individuals on behalf of Vovida Networks,
240
* Inc. For more information on Vovida Networks, Inc., please see
241
* <http://www.vovida.org/>.