/[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 5948 - (hide annotations) (download)
Fri Feb 17 15:30:16 2006 UTC (13 years, 9 months ago) by dworley
File MIME type: text/plain
File size: 10527 byte(s)
Setting more svn: properties, and adding EOLs to the ends of files
that need it.

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

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