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

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

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

main/sip/resiprocate/dum/test/testIdentity.cxx revision 4601 by derek, Thu May 12 01:10:49 2005 UTC branches/b-directory-reorg/resip/dum/test/testIdentity.cxx revision 5276 by jason, Fri Aug 19 00:23:17 2005 UTC
# Line 1  Line 1 
1  #include "resiprocate/dum/ClientAuthManager.hxx"  #include "resip/dum/ClientAuthManager.hxx"
2  #include "resiprocate/dum/ClientRegistration.hxx"  #include "resip/dum/ClientRegistration.hxx"
3  #include "resiprocate/dum/DialogUsageManager.hxx"  #include "resip/dum/DialogUsageManager.hxx"
4  #include "resiprocate/dum/MasterProfile.hxx"  #include "resip/dum/MasterProfile.hxx"
5  #include "resiprocate/dum/Profile.hxx"  #include "resip/dum/Profile.hxx"
6  #include "resiprocate/dum/UserProfile.hxx"  #include "resip/dum/UserProfile.hxx"
7  #include "resiprocate/dum/RegistrationHandler.hxx"  #include "resip/dum/RegistrationHandler.hxx"
8  #include "resiprocate/dum/ClientPagerMessage.hxx"  #include "resip/dum/ClientPagerMessage.hxx"
9  #include "resiprocate/dum/ServerPagerMessage.hxx"  #include "resip/dum/ServerPagerMessage.hxx"
10    
11  #include "resiprocate/dum/DialogUsageManager.hxx"  #include "resip/dum/DialogUsageManager.hxx"
12  #include "resiprocate/dum/AppDialogSet.hxx"  #include "resip/dum/AppDialogSet.hxx"
13  #include "resiprocate/dum/AppDialog.hxx"  #include "resip/dum/AppDialog.hxx"
14  #include "resiprocate/dum/RegistrationHandler.hxx"  #include "resip/dum/RegistrationHandler.hxx"
15  #include "resiprocate/dum/PagerMessageHandler.hxx"  #include "resip/dum/PagerMessageHandler.hxx"
16  #include "resiprocate/PlainContents.hxx"  #include "resip/sip/PlainContents.hxx"
17    
18  #include "resiprocate/external/HttpGetMessage.hxx"  #include "resip/sip/external/HttpGetMessage.hxx"
19  #include "curlHttp/CurlHttpProvider.hxx"  #include "curlHttp/CurlHttpProvider.hxx"
20    
21  #include "resiprocate/os/Log.hxx"  #include "rutil/Log.hxx"
22  #include "resiprocate/os/Logger.hxx"  #include "rutil/Logger.hxx"
23  #include "resiprocate/os/Subsystem.hxx"  #include "rutil/Subsystem.hxx"
24    
25    #ifdef WIN32
26    #include "resip/sip/WinSecurity.hxx"
27    #endif
28    
29  #include <iostream>  #include <iostream>
30  #include <string>  #include <string>
# Line 66  Line 70 
70           InfoLog( << "ServerPagerMessageHandler::onMessageArrived: "           InfoLog( << "ServerPagerMessageHandler::onMessageArrived: "
71                    << *body << "\n" );                    << *body << "\n" );
72                    
73             const SecurityAttributes *attr = message.getSecurityAttributes();
74             InfoLog( << *attr );
75            
76           _rcvd = true;           _rcvd = true;
77        }        }
78    
# Line 140  Line 147 
147    
148     InfoLog(<< "user: " << userAor << ", passwd: " << passwd << "\n");     InfoLog(<< "user: " << userAor << ", passwd: " << passwd << "\n");
149    
150     Security* security = new Security("certs");  #ifdef WIN32
151       WinSecurity* security = new WinSecurity;
152     try  #else
153     {     Security* security = new Security;
154        assert(security != 0);  #endif
       security->preload();  
    }  
    catch( ... )  
    {  
       ErrLog( << "Got a exception loading certificates" );  
    }  
155    
156     assert( security );     assert( security );
157    
158     SipStack clientStack(security);     SipStack clientStack(security);
159     DialogUsageManager clientDum(clientStack);     DialogUsageManager clientDum(clientStack);
160     clientDum.addTransport(UDP, 10000 + rand()&0x7fff);     clientDum.addTransport(UDP, 10000 + rand()&0x7fff, V4);
161       clientDum.addTransport(TCP, 10000 + rand()&0x7fff, V4);
162       clientDum.addTransport(TLS, 10000 + rand()&0x7fff, V4);
163       // clientDum.addTransport(UDP, 10000 + rand()&0x7fff, V6);
164       // clientDum.addTransport(TCP, 10000 + rand()&0x7fff, V6);
165       // clientDum.addTransport(TLS, 10000 + rand()&0x7fff, V6);
166    
167     MasterProfile clientProfile;       SharedPtr<MasterProfile> clientProfile(new MasterProfile);  
168     auto_ptr<ClientAuthManager> clientAuth(new ClientAuthManager());       auto_ptr<ClientAuthManager> clientAuth(new ClientAuthManager());  
169     TestIdentityHandler clientHandler;     TestIdentityHandler clientHandler;
170    
171     clientDum.setMasterProfile(&clientProfile);     clientDum.setMasterProfile(clientProfile);
172     clientDum.setClientAuthManager(clientAuth);     clientDum.setClientAuthManager(clientAuth);
173     clientDum.setClientRegistrationHandler(&clientHandler);     clientDum.setClientRegistrationHandler(&clientHandler);
174     clientDum.setClientPagerMessageHandler(&clientHandler);     clientDum.setClientPagerMessageHandler(&clientHandler);
# Line 171  Line 177 
177     clientDum.getMasterProfile()->addSupportedMethod(MESSAGE);     clientDum.getMasterProfile()->addSupportedMethod(MESSAGE);
178     clientDum.getMasterProfile()->addSupportedMimeType(MESSAGE, Mime("text", "plain"));     clientDum.getMasterProfile()->addSupportedMimeType(MESSAGE, Mime("text", "plain"));
179    
180     clientProfile.setDefaultFrom(userAor);     clientProfile->setDefaultFrom(userAor);
181    
182     InfoLog( << userAor.uri().host() << " " << userAor.uri().user()     InfoLog( << userAor.uri().host() << " " << userAor.uri().user()
183              << " " << passwd );              << " " << passwd );
184    
185     clientProfile.setDigestCredential(userAor.uri().host(),     clientProfile->setDigestCredential(userAor.uri().host(),
186                                       userAor.uri().user(),                                       userAor.uri().user(),
187                                       passwd);                                       passwd);
188                    

Legend:
Removed from v.4601  
changed lines
  Added in v.5276

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27