/[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 8425 - (hide annotations) (download)
Mon Mar 2 23:20:11 2009 UTC (10 years, 9 months ago) by adam
File MIME type: text/plain
File size: 10664 byte(s)
Made to compile and link with SunPro toolchain through skillful application of a crowbar. Untested -- and the compilation is rife with warnings (some quite dire) that need to be addressed.

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 adam 8425 return -1;
53 greg 5016 }
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 derek 5356 const SipMessage* msg)
149 greg 5016 {
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 greg 5308
198     virtual void onMessage(InviteSessionHandle,
199     const SipMessage& msg)
200     {
201     InfoLog( << "TestInviteSessionHandler::onMessage" );
202     }
203    
204     virtual void onMessageSuccess(InviteSessionHandle,
205     const SipMessage& msg)
206     {
207     InfoLog( << "TestInviteSessionHandler::onMessageSuccess" );
208     }
209    
210     virtual void onMessageFailure(InviteSessionHandle,
211     const SipMessage& msg)
212     {
213     InfoLog( << "TestInviteSessionHandler::onMessageFailure" );
214     }
215    
216 greg 5016 };
217    
218    
219     class TestDumShutdownHandler : public DumShutdownHandler
220     {
221     public:
222     TestDumShutdownHandler()
223     {
224     }
225    
226     virtual ~TestDumShutdownHandler()
227     {
228     }
229    
230     virtual void onDumCanBeDeleted()
231     {
232     InfoLog( << "TestDumShutdownHandler::onDumCanBeDeleted" );
233     }
234     };
235    
236    
237     class TestClientPagerMessageHandler : public ClientPagerMessageHandler
238     {
239     public:
240     TestClientPagerMessageHandler()
241     {
242     }
243    
244     virtual ~TestClientPagerMessageHandler()
245     {
246     }
247    
248     virtual void onSuccess(ClientPagerMessageHandle,
249     const SipMessage& status)
250     {
251     InfoLog( << "TestClientMessageHandler::onSuccess" );
252     }
253    
254     virtual void onFailure(ClientPagerMessageHandle,
255     const SipMessage& status,
256     std::auto_ptr<Contents> contents)
257     {
258     InfoLog( << "TestClientMessageHandler::onFailure" );
259     }
260     };
261    
262     class TestServerPagerMessageHandler : public ServerPagerMessageHandler
263     {
264     public:
265     TestServerPagerMessageHandler()
266     {
267     }
268    
269     virtual ~TestServerPagerMessageHandler()
270     {
271     }
272    
273     virtual void onMessageArrived(ServerPagerMessageHandle handle,
274     const SipMessage& message)
275     {
276     InfoLog( << "TestServerPagerMessageHandler::onMessageArrived" );
277    
278 daniel 5759 SharedPtr<SipMessage> ok = handle->accept();
279 greg 5016 handle->send(ok);
280    
281     InfoLog( << "received type " << message.header(h_ContentType) );
282    
283     const SecurityAttributes *attr = message.getSecurityAttributes();
284     InfoLog( << *attr );
285     }
286 greg 5308
287 greg 5016 };
288    
289 greg 5308 } // namespace
290    
291 adam 8374 /* ====================================================================
292     * The Vovida Software License, Version 1.0
293     *
294 greg 5016 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
295     *
296     * Redistribution and use in source and binary forms, with or without
297     * modification, are permitted provided that the following conditions
298     * are met:
299     *
300     * 1. Redistributions of source code must retain the above copyright
301     * notice, this list of conditions and the following disclaimer.
302     *
303     * 2. Redistributions in binary form must reproduce the above copyright
304     * notice, this list of conditions and the following disclaimer in
305     * the documentation and/or other materials provided with the
306     * distribution.
307     *
308     * 3. The names "VOCAL", "Vovida Open Communication Application Library",
309     * and "Vovida Open Communication Application Library (VOCAL)" must
310     * not be used to endorse or promote products derived from this
311     * software without prior written permission. For written
312     * permission, please contact vocal@vovida.org.
313     *
314     * 4. Products derived from this software may not be called "VOCAL", nor
315     * may "VOCAL" appear in their name, without prior written
316     * permission of Vovida Networks, Inc.
317     *
318     * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
319     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
320     * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
321     * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
322     * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
323     * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
324     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
325     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
326     * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
327     * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
328     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
329     * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
330     * DAMAGE.
331     *
332     * ====================================================================
333     *
334     * This software consists of voluntary contributions made by Vovida
335     * Networks, Inc. and many individuals on behalf of Vovida Networks,
336     * Inc. For more information on Vovida Networks, Inc., please see
337     * <http://www.vovida.org/>.
338     *
339     */

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