📄 dialogusagemanager.hxx
字号:
{ ServerSubscriptionHandle h = i->second->getHandle(); applyFn(h); } return applyFn; } //DUM will delete features in its destructor. Feature manipulation should //be done before any processing starts. //ServerAuthManager is now a DumFeature; setServerAuthManager is a special //case of addFeature; the ServerAuthManager should always be the first //feature in the chain. void addIncomingFeature(resip::SharedPtr<DumFeature> feat); void addOutgoingFeature(resip::SharedPtr<DumFeature> feat); void setOutgoingMessageInterceptor(resip::SharedPtr<DumFeature> feat); TargetCommand::Target& dumIncomingTarget(); TargetCommand::Target& dumOutgoingTarget(); //exposed so DumThread variants can be written Message* getNext(int ms) { return mFifo.getNext(ms); } void internalProcess(std::auto_ptr<Message> msg); bool messageAvailable(void) { return mFifo.messageAvailable(); } void applyToAllClientSubscriptions(ClientSubscriptionFunctor*); void applyToAllServerSubscriptions(ServerSubscriptionFunctor*); /// Note: Implementations of Postable must delete the message passed via post void registerForConnectionTermination(Postable*); void unRegisterForConnectionTermination(Postable*); protected: virtual void onAllHandlesDestroyed(); //TransactionUser virtuals virtual const Data& name() const; friend class DumThread; DumFeatureChain::FeatureList mIncomingFeatureList; DumFeatureChain::FeatureList mOutgoingFeatureList; SharedPtr<DumFeature> mOutgoingMessageInterceptor; typedef std::map<Data, DumFeatureChain*> FeatureChainMap; FeatureChainMap mIncomingFeatureChainMap; FeatureChainMap mOutgoingFeatureChainMap; private: friend class Dialog; friend class DialogSet; friend class ClientInviteSession; friend class ClientOutOfDialogReq; friend class ClientPublication; friend class ClientRegistration; friend class ClientSubscription; friend class InviteSession; friend class ServerInviteSession; friend class ServerOutOfDialogReq; friend class ServerPublication; friend class ServerRegistration; friend class ServerSubscription; friend class BaseUsage; friend class ClientPagerMessage; friend class ServerPagerMessage; friend class KeepAliveAssociation; friend class NetworkAssociation; friend class MergedRequestRemovalCommand; friend class TargetCommand::Target; class IncomingTarget : public TargetCommand::Target { public: IncomingTarget(DialogUsageManager& dum) : TargetCommand::Target(dum) { } virtual void post(std::auto_ptr<Message> msg) { mDum.incomingProcess(msg); } }; class OutgoingTarget : public TargetCommand::Target { public: OutgoingTarget(DialogUsageManager& dum) : TargetCommand::Target(dum) { } virtual void post(std::auto_ptr<Message> msg) { mDum.outgoingProcess(msg); } }; DialogSet* makeUacDialogSet(BaseCreator* creator, AppDialogSet* appDs); SharedPtr<SipMessage> makeNewSession(BaseCreator* creator, AppDialogSet* appDs); // makes a proto response to a request void makeResponse(SipMessage& response, const SipMessage& request, int responseCode, const Data& reason = Data::Empty) const; // May call a callback to let the app adorn void sendResponse(const SipMessage& response); void sendUsingOutboundIfAppropriate(UserProfile& userProfile, std::auto_ptr<SipMessage> msg); void addTimer(DumTimeout::Type type, unsigned long durationSeconds, BaseUsageHandle target, unsigned int seq, unsigned int altseq=0); void addTimerMs(DumTimeout::Type type, unsigned long duration, BaseUsageHandle target, unsigned int seq, unsigned int altseq=0, const Data &transactionId = Data::Empty); Dialog& findOrCreateDialog(const SipMessage* msg); Dialog* findDialog(const DialogId& id); DialogSet* findDialogSet(const DialogSetId& id); // return 0, if no matching BaseCreator BaseCreator* findCreator(const DialogId& id); void processRequest(const SipMessage& request); void processResponse(const SipMessage& response); bool validateRequestURI(const SipMessage& request); bool validateRequiredOptions(const SipMessage& request); bool validateContent(const SipMessage& request); bool validateAccept(const SipMessage& request); bool validateTo(const SipMessage& request); bool validate100RelSuport(const SipMessage& request); bool mergeRequest(const SipMessage& request); void processPublish(const SipMessage& publish); void removeDialogSet(const DialogSetId& ); bool checkEventPackage(const SipMessage& request); bool queueForIdentityCheck(SipMessage* msg); void processIdentityCheckResponse(const HttpGetMessage& msg); void incomingProcess(std::auto_ptr<Message> msg); void outgoingProcess(std::auto_ptr<Message> msg); void processExternalMessage(ExternalMessageBase* externalMessage); // For delayed delete of a Usage void destroy(const BaseUsage* usage); void destroy(DialogSet*); void destroy(Dialog*); void requestMergedRequestRemoval(const MergedRequestKey&); void removeMergedRequest(const MergedRequestKey&); typedef std::set<MergedRequestKey> MergedRequests; MergedRequests mMergedRequests; typedef std::map<Data, DialogSet*> CancelMap; CancelMap mCancelMap; typedef HashMap<DialogSetId, DialogSet*> DialogSetMap; DialogSetMap mDialogSetMap; SharedPtr<MasterProfile> mMasterProfile; SharedPtr<UserProfile> mMasterUserProfile; std::auto_ptr<RedirectManager> mRedirectManager; std::auto_ptr<ClientAuthManager> mClientAuthManager; //std::auto_ptr<ServerAuthManager> mServerAuthManager; InviteSessionHandler* mInviteSessionHandler; ClientRegistrationHandler* mClientRegistrationHandler; ServerRegistrationHandler* mServerRegistrationHandler; RedirectHandler* mRedirectHandler; DialogSetHandler* mDialogSetHandler; RegistrationPersistenceManager *mRegistrationPersistenceManager; OutOfDialogHandler* getOutOfDialogHandler(const MethodTypes type); std::map<Data, ClientSubscriptionHandler*> mClientSubscriptionHandlers; std::map<Data, ServerSubscriptionHandler*> mServerSubscriptionHandlers; std::map<Data, ClientPublicationHandler*> mClientPublicationHandlers; std::map<Data, ServerPublicationHandler*> mServerPublicationHandlers; std::map<MethodTypes, OutOfDialogHandler*> mOutOfDialogHandlers; std::auto_ptr<KeepAliveManager> mKeepAliveManager; bool mIsDefaultServerReferHandler; ClientPagerMessageHandler* mClientPagerMessageHandler; ServerPagerMessageHandler* mServerPagerMessageHandler; std::vector<ExternalMessageHandler*> mExternalMessageHandlers; std::auto_ptr<AppDialogSetFactory> mAppDialogSetFactory; SipStack& mStack; DumShutdownHandler* mDumShutdownHandler; typedef enum { Running, ShutdownRequested, // while ending usages RemovingTransactionUser, // while removing TU from stack Shutdown, // after TU has been removed from stack Destroying // while calling destructor } ShutdownState; ShutdownState mShutdownState; // from ETag -> ServerPublication typedef std::map<Data, ServerPublication*> ServerPublications; ServerPublications mServerPublications; typedef std::map<Data, SipMessage*> RequiresCerts; RequiresCerts mRequiresCerts; // from Event-Type+document-aor -> ServerSubscription // Managed by ServerSubscription typedef std::multimap<Data, ServerSubscription*> ServerSubscriptions; ServerSubscriptions mServerSubscriptions; IncomingTarget* mIncomingTarget; OutgoingTarget* mOutgoingTarget; EventDispatcher<ConnectionTerminated> mConnectionTerminatedEventDispatcher;};}#endif/* ==================================================================== * The Vovida Software License, Version 1.0 * * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The names "VOCAL", "Vovida Open Communication Application Library", * and "Vovida Open Communication Application Library (VOCAL)" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact vocal@vovida.org. * * 4. Products derived from this software may not be called "VOCAL", nor * may "VOCAL" appear in their name, without prior written * permission of Vovida Networks, Inc. * * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * ==================================================================== * * This software consists of voluntary contributions made by Vovida * Networks, Inc. and many individuals on behalf of Vovida Networks, * Inc. For more information on Vovida Networks, Inc., please see * <http://www.vovida.org/>. * */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -