/[resiprocate]/main/resip/dum/test/TestDumHandlers.hxx
ViewVC logotype

Annotation of /main/resip/dum/test/TestDumHandlers.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5276 - (hide annotations) (download)
Fri Aug 19 00:23:17 2005 UTC (14 years, 3 months ago) by jason
Original Path: branches/b-directory-reorg/resip/dum/test/TestDumHandlers.hxx
File size: 9899 byte(s)
compiles now
1 jason 5276 #include "resip/dum/ServerPagerMessage.hxx"
2 greg 5016
3 jason 5276 #include "resip/dum/RegistrationHandler.hxx"
4     #include "resip/dum/InviteSessionHandler.hxx"
5     #include "resip/dum/DumShutdownHandler.hxx"
6     #include "resip/dum/PagerMessageHandler.hxx"
7 greg 5016
8 jason 5276 #include "rutil/Logger.hxx"
9 greg 5016
10     #define RESIPROCATE_SUBSYSTEM Subsystem::TEST
11    
12     namespace resip
13     {
14    
15    
16     class TestClientRegistrationHandler : public ClientRegistrationHandler
17     {
18     public:
19     TestClientRegistrationHandler()
20     {
21     }
22    
23     virtual ~TestClientRegistrationHandler()
24     {
25     }
26    
27     virtual void onSuccess(ClientRegistrationHandle,
28     const SipMessage& response)
29     {
30     InfoLog( << "TestClientRegistrationHandler::onSuccess" );
31     }
32    
33     virtual void onRemoved(ClientRegistrationHandle)
34     {
35     InfoLog( << "TestClientRegistrationHander::onRemoved" );
36     exit(-1);
37     }
38    
39     virtual void onFailure(ClientRegistrationHandle,
40     const SipMessage& response)
41     {
42     InfoLog( << "TestClientRegistrationHandler::onFailure" );
43     exit(-1);
44     }
45    
46     virtual int onRequestRetry(ClientRegistrationHandle,
47     int retrySeconds,
48     const SipMessage& response)
49     {
50     InfoLog( << "TestClientRegistrationHandler::onRequestRetry" );
51     exit(-1);
52     }
53     };
54    
55    
56     class TestInviteSessionHandler : public InviteSessionHandler
57     {
58     public:
59     TestInviteSessionHandler()
60     {
61     }
62    
63     virtual ~TestInviteSessionHandler()
64     {
65     }
66    
67     virtual void onNewSession(ClientInviteSessionHandle,
68     InviteSession::OfferAnswerType oat,
69     const SipMessage& msg)
70     {
71     InfoLog( << "TestInviteSessionHandler::onNewSession" );
72     }
73    
74     virtual void onFailure(ClientInviteSessionHandle,
75     const SipMessage& msg)
76     {
77     InfoLog( << "TestInviteSessionHander::onFailure" );
78     }
79    
80     virtual void onProvisional(ClientInviteSessionHandle,
81     const SipMessage& msg)
82     {
83     InfoLog( << "TestInviteSessionHandler::onProvisional" );
84     }
85    
86     virtual void onConnected(ClientInviteSessionHandle,
87     const SipMessage& msg)
88     {
89     InfoLog( << "TestInviteSessionHandler::onConnected" );
90     }
91    
92     virtual void onStaleCallTimeout(ClientInviteSessionHandle)
93     {
94     InfoLog( << "TestInviteSessionHandler::onStaleCallTimeout" );
95     }
96    
97     virtual void onRedirected(ClientInviteSessionHandle,
98     const SipMessage& msg)
99     {
100     InfoLog( << "TestInviteSessionHandler::onRedirected");
101     }
102    
103     virtual void onEarlyMedia(ClientInviteSessionHandle,
104     const SipMessage& msg,
105     const SdpContents& sdp)
106     {
107     InfoLog( << "TestInviteSessionHandler::onEarlyMedia" );
108     }
109    
110     virtual void onForkDestroyed(ClientInviteSessionHandle)
111     {
112     InfoLog( << "TestInviteSessionHandler::onForkDestroyed" );
113     }
114    
115     virtual void onNewSession(ServerInviteSessionHandle is,
116     InviteSession::OfferAnswerType oat,
117     const SipMessage& msg)
118     {
119     InfoLog( << "TestInviteSessionHandler::onNewSession" );
120     // is->provisional(180);
121     }
122    
123     virtual void onConnected(InviteSessionHandle, const SipMessage& msg)
124     {
125     InfoLog( << "TestInviteSessionHandler::onConnected()" );
126     }
127    
128     virtual void onTerminated(InviteSessionHandle,
129     InviteSessionHandler::TerminatedReason reason,
130     const SipMessage* msg)
131     {
132     InfoLog( << "TestInviteSessionHandler::onTerminated");
133     }
134    
135     virtual void onOffer(InviteSessionHandle is,
136     const SipMessage& msg, const SdpContents& sdp)
137     {
138     InfoLog( << "TestInviteSessionHandler::onOffer");
139     }
140    
141     virtual void onOfferRequired(InviteSessionHandle,
142     const SipMessage& msg)
143     {
144     InfoLog( << "TestInviteSessionHandler::onOfferRequired" );
145     }
146    
147     virtual void onOfferRejected(InviteSessionHandle,
148     const SipMessage& msg)
149     {
150     InfoLog( << "TestInviteSessionHandler::onOfferRejected" );
151     }
152    
153     virtual void onAnswer(InviteSessionHandle,
154     const SipMessage& msg,
155     const SdpContents& sdp)
156     {
157     InfoLog( << "TestInviteSessionHandler::onAnswer");
158     }
159    
160     virtual void onRefer(InviteSessionHandle,
161     ServerSubscriptionHandle,
162     const SipMessage& msg)
163     {
164     InfoLog( << "TestInviteSessionHandler::onRefer" );
165     }
166    
167     virtual void onReferAccepted(InviteSessionHandle,
168     ClientSubscriptionHandle,
169     const SipMessage& msg)
170     {
171     InfoLog( << "TestInviteSessionHandler::onReferAccepted" );
172     }
173    
174     virtual void onReferRejected(InviteSessionHandle,
175     const SipMessage& msg)
176     {
177     InfoLog( << "TestInviteSessionHandler::onReferRejected" );
178     }
179    
180     virtual void onInfo(InviteSessionHandle,
181     const SipMessage& msg)
182     {
183     InfoLog( << "TestInviteSessionHandler::onInfo" );
184     }
185    
186     virtual void onInfoSuccess(InviteSessionHandle,
187     const SipMessage& msg)
188     {
189     InfoLog( << "TestInviteSessionHandler::onInfoSuccess" );
190     }
191    
192     virtual void onInfoFailure(InviteSessionHandle,
193     const SipMessage& msg)
194     {
195     InfoLog( << "TestInviteSessionHandler::onInfoFailure" );
196     }
197     };
198    
199    
200     class TestDumShutdownHandler : public DumShutdownHandler
201     {
202     public:
203     TestDumShutdownHandler()
204     {
205     }
206    
207     virtual ~TestDumShutdownHandler()
208     {
209     }
210    
211     virtual void onDumCanBeDeleted()
212     {
213     InfoLog( << "TestDumShutdownHandler::onDumCanBeDeleted" );
214     }
215     };
216    
217    
218     class TestClientPagerMessageHandler : public ClientPagerMessageHandler
219     {
220     public:
221     TestClientPagerMessageHandler()
222     {
223     }
224    
225     virtual ~TestClientPagerMessageHandler()
226     {
227     }
228    
229     virtual void onSuccess(ClientPagerMessageHandle,
230     const SipMessage& status)
231     {
232     InfoLog( << "TestClientMessageHandler::onSuccess" );
233     }
234    
235     virtual void onFailure(ClientPagerMessageHandle,
236     const SipMessage& status,
237     std::auto_ptr<Contents> contents)
238     {
239     InfoLog( << "TestClientMessageHandler::onFailure" );
240     }
241     };
242    
243     class TestServerPagerMessageHandler : public ServerPagerMessageHandler
244     {
245     public:
246     TestServerPagerMessageHandler()
247     {
248     }
249    
250     virtual ~TestServerPagerMessageHandler()
251     {
252     }
253    
254     virtual void onMessageArrived(ServerPagerMessageHandle handle,
255     const SipMessage& message)
256     {
257     InfoLog( << "TestServerPagerMessageHandler::onMessageArrived" );
258    
259     SipMessage ok = handle->accept();
260     handle->send(ok);
261    
262     InfoLog( << "received type " << message.header(h_ContentType) );
263    
264     const SecurityAttributes *attr = message.getSecurityAttributes();
265     InfoLog( << *attr );
266     }
267     };
268    
269     }
270    
271     /*
272     * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
273     *
274     * Redistribution and use in source and binary forms, with or without
275     * modification, are permitted provided that the following conditions
276     * are met:
277     *
278     * 1. Redistributions of source code must retain the above copyright
279     * notice, this list of conditions and the following disclaimer.
280     *
281     * 2. Redistributions in binary form must reproduce the above copyright
282     * notice, this list of conditions and the following disclaimer in
283     * the documentation and/or other materials provided with the
284     * distribution.
285     *
286     * 3. The names "VOCAL", "Vovida Open Communication Application Library",
287     * and "Vovida Open Communication Application Library (VOCAL)" must
288     * not be used to endorse or promote products derived from this
289     * software without prior written permission. For written
290     * permission, please contact vocal@vovida.org.
291     *
292     * 4. Products derived from this software may not be called "VOCAL", nor
293     * may "VOCAL" appear in their name, without prior written
294     * permission of Vovida Networks, Inc.
295     *
296     * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
297     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
298     * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
299     * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
300     * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
301     * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
302     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
303     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
304     * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
305     * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
306     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
307     * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
308     * DAMAGE.
309     *
310     * ====================================================================
311     *
312     * This software consists of voluntary contributions made by Vovida
313     * Networks, Inc. and many individuals on behalf of Vovida Networks,
314     * Inc. For more information on Vovida Networks, Inc., please see
315     * <http://www.vovida.org/>.
316     *
317     */

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27