2 |
# define usleep(t) Sleep(t) |
# define usleep(t) Sleep(t) |
3 |
#endif |
#endif |
4 |
|
|
|
#define HAVE_POPT_H |
|
|
|
|
5 |
#if defined (HAVE_POPT_H) |
#if defined (HAVE_POPT_H) |
6 |
#include <popt.h> |
#include <popt.h> |
7 |
#endif |
#endif |
19 |
#include "resiprocate/dum/DialogUsageManager.hxx" |
#include "resiprocate/dum/DialogUsageManager.hxx" |
20 |
#include "resiprocate/dum/DumShutdownHandler.hxx" |
#include "resiprocate/dum/DumShutdownHandler.hxx" |
21 |
#include "resiprocate/dum/OutOfDialogHandler.hxx" |
#include "resiprocate/dum/OutOfDialogHandler.hxx" |
22 |
#include "resiprocate/dum/Profile.hxx" |
#include "resiprocate/dum/MasterProfile.hxx" |
23 |
#include "resiprocate/dum/PublicationHandler.hxx" |
#include "resiprocate/dum/PublicationHandler.hxx" |
24 |
#include "resiprocate/dum/RegistrationHandler.hxx" |
#include "resiprocate/dum/RegistrationHandler.hxx" |
25 |
#include "resiprocate/dum/ServerPublication.hxx" |
#include "resiprocate/dum/ServerPublication.hxx" |
191 |
{ |
{ |
192 |
// !jf! really need to do this async. send neutral state in the meantime, |
// !jf! really need to do this async. send neutral state in the meantime, |
193 |
// blah blah blah |
// blah blah blah |
194 |
mSecurity.generateUserCert(h->getDocumentKey(), Data::Empty); |
mSecurity.generateUserCert(h->getDocumentKey()); |
195 |
} |
} |
196 |
|
|
197 |
if (mSecurity.hasUserCert(h->getDocumentKey())) |
if (mSecurity.hasUserCert(h->getDocumentKey())) |
275 |
class CertServer : public OutOfDialogHandler, public DialogUsageManager |
class CertServer : public OutOfDialogHandler, public DialogUsageManager |
276 |
{ |
{ |
277 |
public: |
public: |
278 |
CertServer(const resip::NameAddr& me) : |
CertServer(const resip::NameAddr& me, SipStack& stack) : |
279 |
DialogUsageManager(), |
DialogUsageManager(stack), |
280 |
mCertServer(getSecurity()), |
mCertServer(getSecurity()), |
281 |
mPrivateKeyServer(getSecurity()), |
mPrivateKeyServer(getSecurity()), |
282 |
mCertUpdater(getSecurity()), |
mCertUpdater(getSecurity()), |
283 |
mPrivateKeyUpdater(getSecurity()) |
mPrivateKeyUpdater(getSecurity()), |
284 |
|
mDone(false) |
285 |
{ |
{ |
286 |
addTransport(UDP, 5100); |
addTransport(UDP, 5100); |
287 |
addTransport(TCP, 5100); |
addTransport(TCP, 5100); |
292 |
mProfile.addSupportedMethod(SUBSCRIBE); |
mProfile.addSupportedMethod(SUBSCRIBE); |
293 |
mProfile.validateAcceptEnabled() = true; |
mProfile.validateAcceptEnabled() = true; |
294 |
mProfile.validateContentEnabled() = true; |
mProfile.validateContentEnabled() = true; |
295 |
mProfile.addSupportedMimeType(Pkcs8Contents::getStaticType()); |
mProfile.addSupportedMimeType(PUBLISH, Pkcs8Contents::getStaticType()); |
296 |
mProfile.addSupportedMimeType(X509Contents::getStaticType()); |
mProfile.addSupportedMimeType(SUBSCRIBE, Pkcs8Contents::getStaticType()); |
297 |
|
mProfile.addSupportedMimeType(PUBLISH, X509Contents::getStaticType()); |
298 |
|
mProfile.addSupportedMimeType(SUBSCRIBE, X509Contents::getStaticType()); |
299 |
|
|
300 |
mProfile.setDefaultFrom(me); |
mProfile.setDefaultFrom(me); |
301 |
setProfile(&mProfile); |
setMasterProfile(&mProfile); |
302 |
|
|
303 |
addServerSubscriptionHandler(Symbols::Credential, &mPrivateKeyServer); |
addServerSubscriptionHandler(Symbols::Credential, &mPrivateKeyServer); |
304 |
addServerSubscriptionHandler(Symbols::Certificate, &mCertServer); |
addServerSubscriptionHandler(Symbols::Certificate, &mCertServer); |
343 |
} |
} |
344 |
|
|
345 |
private: |
private: |
346 |
Profile mProfile; |
MasterProfile mProfile; |
347 |
CertSubscriptionHandler mCertServer; |
CertSubscriptionHandler mCertServer; |
348 |
PrivateKeySubscriptionHandler mPrivateKeyServer; |
PrivateKeySubscriptionHandler mPrivateKeyServer; |
349 |
CertPublicationHandler mCertUpdater; |
CertPublicationHandler mCertUpdater; |
396 |
#endif |
#endif |
397 |
|
|
398 |
NameAddr domain(myUrl); |
NameAddr domain(myUrl); |
399 |
CertServer server(domain); |
SipStack stack; |
400 |
|
CertServer server(domain, stack); |
401 |
server.run(); |
server.run(); |
402 |
return 0; |
return 0; |
403 |
} |
} |