📄 certsubscriptionhandler.cxx
字号:
#if defined(USE_SSL)#include "resip/stack/Security.hxx"#include "resip/stack/X509Contents.hxx"#include "repro/stateAgents/CertSubscriptionHandler.hxx"using namespace repro;using namespace resip;CertSubscriptionHandler::CertSubscriptionHandler(Security& security) : mSecurity(security){}void CertSubscriptionHandler::onNewSubscription(ServerSubscriptionHandle h, const SipMessage& sub){ if (!mSecurity.hasUserCert(h->getDocumentKey())) { // !jf! really need to do this async. send neutral state in the meantime, // blah blah blah mSecurity.generateUserCert(h->getDocumentKey()); } if (mSecurity.hasUserCert(h->getDocumentKey())) { X509Contents x509(mSecurity.getUserCertDER(h->getDocumentKey())); h->send(h->update(&x509)); } else { h->reject(404); }}void CertSubscriptionHandler::onPublished(ServerSubscriptionHandle associated, ServerPublicationHandle publication, const Contents* contents, const SecurityAttributes* attrs){ associated->send(associated->update(contents));}void CertSubscriptionHandler::onTerminated(ServerSubscriptionHandle){}void CertSubscriptionHandler::onError(ServerSubscriptionHandle, const SipMessage& msg){}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -