certsubscriptionhandler.cxx

来自「这是国外的resip协议栈」· CXX 代码 · 共 56 行

CXX
56
字号
#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 + =
减小字号Ctrl + -
显示快捷键?