/[resiprocate]/main/resip/dum/test/testSMIMEInvite.cxx
ViewVC logotype

Diff of /main/resip/dum/test/testSMIMEInvite.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

branches/b-directory-reorg/resip/dum/test/testSMIMEInvite.cxx revision 5273 by jason, Thu Aug 18 23:50:54 2005 UTC main/resip/dum/test/testSMIMEInvite.cxx revision 8838 by sgodin, Sat Oct 30 00:28:04 2010 UTC
# Line 1  Line 1 
1  #include "resiprocate/dum/DialogUsageManager.hxx"  #include "resip/dum/DialogUsageManager.hxx"
2  #include "resiprocate/dum/ClientRegistration.hxx"  #include "resip/dum/ClientRegistration.hxx"
3  #include "resiprocate/dum/ClientInviteSession.hxx"  #include "resip/dum/ClientInviteSession.hxx"
4  #include "resiprocate/dum/ServerInviteSession.hxx"  #include "resip/dum/ServerInviteSession.hxx"
5  #include "resiprocate/dum/ClientAuthManager.hxx"  #include "resip/dum/ClientAuthManager.hxx"
6    
7  #include "resiprocate/dum/RegistrationHandler.hxx"  #include "resip/dum/RegistrationHandler.hxx"
8  #include "resiprocate/dum/InviteSessionHandler.hxx"  #include "resip/dum/InviteSessionHandler.hxx"
9  #include "resiprocate/dum/DumShutdownHandler.hxx"  #include "resip/dum/DumShutdownHandler.hxx"
10    
11  #include "resiprocate/dum/MasterProfile.hxx"  #include "resip/dum/MasterProfile.hxx"
12  #include "resiprocate/ShutdownMessage.hxx"  #include "resip/stack/ShutdownMessage.hxx"
13    
14  #include "resiprocate/SdpContents.hxx"  #include "resip/stack/SdpContents.hxx"
15  #include "resiprocate/Pkcs7Contents.hxx"  #include "resip/stack/Pkcs7Contents.hxx"
16  #include "resiprocate/MultipartSignedContents.hxx"  #include "resip/stack/MultipartSignedContents.hxx"
17  #include "resiprocate/MultipartAlternativeContents.hxx"  #include "resip/stack/MultipartAlternativeContents.hxx"
18  #include "resiprocate/Mime.hxx"  #include "resip/stack/Mime.hxx"
19    
20  #include "resiprocate/SecurityAttributes.hxx"  #include "resip/stack/SecurityAttributes.hxx"
21  #include "resiprocate/Helper.hxx"  #include "resip/stack/Helper.hxx"
22    
23  #include "resiprocate/os/Log.hxx"  #include "rutil/Log.hxx"
24  #include "resiprocate/os/Logger.hxx"  #include "rutil/Logger.hxx"
25    
26  #ifdef WIN32  #ifdef WIN32
27  #include "resiprocate/WinSecurity.hxx"  #include "resip/stack/ssl/WinSecurity.hxx"
28    #else
29    #include "resip/stack/ssl/Security.hxx"
30  #endif  #endif
31    
32  #include "TestDumHandlers.hxx"  #include "TestDumHandlers.hxx"
# Line 118  Line 120 
120           connected++;           connected++;
121        }        }
122    
123          using TestClientRegistrationHandler::onFailure;
124        virtual void onFailure(ClientInviteSessionHandle,        virtual void onFailure(ClientInviteSessionHandle,
125                               const SipMessage& msg)                               const SipMessage& msg)
126        {        {
# Line 125  Line 128 
128           callFailed = true;           callFailed = true;
129        }        }
130    
131          using TestInviteSessionHandler::onNewSession;
132        virtual void onNewSession(ServerInviteSessionHandle is,        virtual void onNewSession(ServerInviteSessionHandle is,
133                                  InviteSession::OfferAnswerType oat,                                  InviteSession::OfferAnswerType oat,
134                                  const SipMessage& msg)                                  const SipMessage& msg)
# Line 200  Line 204 
204           dumShutDown++;           dumShutDown++;
205        }        }
206    
207          virtual void onReferNoSub(InviteSessionHandle, const SipMessage& msg)
208          {
209             InfoLog(<< "InviteSessionHandler::onReferNoSub(): " << msg.brief());
210          }
211    
212     public:     public:
213        std::vector<ClientRegistrationHandle> handles;        std::vector<ClientRegistrationHandle> handles;
214        ServerInviteSessionHandle sis;        ServerInviteSessionHandle sis;
# Line 207  Line 216 
216     private:     private:
217        Security *security;        Security *security;
218        int registered;        int registered;
       int dumShutDown;  
219        int done;        int done;
220          int dumShutDown;
221        int connected;        int connected;
222        bool callFailed;        bool callFailed;
223                
# Line 220  Line 229 
229  {  {
230     if ( argc < 5 ) {     if ( argc < 5 ) {
231        cout << "usage: " << argv[0] << " sip:user1 passwd1 sip:user2 passwd2" << endl;        cout << "usage: " << argv[0] << " sip:user1 passwd1 sip:user2 passwd2" << endl;
232        return 0;        return 1;
233     }     }
234    
235     Log::initialize(Log::Cout, Log::Debug, argv[0]);     Log::initialize(Log::Cout, Log::Debug, argv[0]);
# Line 242  Line 251 
251     SipStack clientStack(security);     SipStack clientStack(security);
252     DialogUsageManager clientDum(clientStack);     DialogUsageManager clientDum(clientStack);
253     srand(time(NULL));     srand(time(NULL));
254     clientDum.addTransport(UDP, 10000 + rand()&0x7fff, V4);     clientDum.addTransport(UDP, 0, V4);
255     clientDum.addTransport(TCP, 10000 + rand()&0x7fff, V4);     clientDum.addTransport(TCP, 0, V4);
256     clientDum.addTransport(TLS, 10000 + rand()&0x7fff, V4);     clientDum.addTransport(TLS, 0, V4);
257  #ifdef USE_IPV6  #ifdef USE_IPV6
258     clientDum.addTransport(UDP, 10000 + rand()&0x7fff, V6);     clientDum.addTransport(UDP, 0, V6);
259     clientDum.addTransport(TCP, 10000 + rand()&0x7fff, V6);     clientDum.addTransport(TCP, 0, V6);
260     clientDum.addTransport(TLS, 10000 + rand()&0x7fff, V6);     clientDum.addTransport(TLS, 0, V6);
261  #endif  #endif
262    
263     SharedPtr<MasterProfile> clientProfile(new MasterProfile);       SharedPtr<MasterProfile> clientProfile(new MasterProfile);  
# Line 270  Line 279 
279     //set up UAS     //set up UAS
280     SipStack serverStack(security);     SipStack serverStack(security);
281     DialogUsageManager serverDum(serverStack);     DialogUsageManager serverDum(serverStack);
282     //serverDum.addTransport(UDP, 10000 + rand()&0x7fff, V4);     //serverDum.addTransport(UDP, 0, V4);
283     serverDum.addTransport(TCP, 10000 + rand()&0x7fff, V4);     serverDum.addTransport(TCP, 0, V4);
284     //serverDum.addTransport(TLS, 10000 + rand()&0x7fff, V4);     //serverDum.addTransport(TLS, 0, V4);
285    
286     SharedPtr<MasterProfile> serverProfile(new MasterProfile);     SharedPtr<MasterProfile> serverProfile(new MasterProfile);
287     std::auto_ptr<ClientAuthManager> serverAuth(new ClientAuthManager);     std::auto_ptr<ClientAuthManager> serverAuth(new ClientAuthManager);
# Line 303  Line 312 
312     time_t endTime;     time_t endTime;
313    
314     // register client and server     // register client and server
315     SipMessage& clientRegMessage = clientDum.makeRegistration(clientAor);     SharedPtr<SipMessage> clientRegMessage = clientDum.makeRegistration(clientAor);
316     clientDum.send(clientRegMessage);     clientDum.send(clientRegMessage);
317     SipMessage& serverRegMessage = serverDum.makeRegistration(serverAor);     SharedPtr<SipMessage> serverRegMessage = serverDum.makeRegistration(serverAor);
318     serverDum.send(serverRegMessage);     serverDum.send(serverRegMessage);
319     state = Registering;     state = Registering;
320    
# Line 416  Line 425 
425                
426     }     }
427    
428       return 0;
429    
430  }  }
431    
432  /* ====================================================================  /* ====================================================================

Legend:
Removed from v.5273  
changed lines
  Added in v.8838

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27