📄 invitesession.hxx
字号:
On1xxAnswer, // UAC On2xx, On2xxOffer, On2xxAnswer, On422Invite, On487Invite, On491Invite, OnInviteFailure, OnAck, OnAckAnswer, On200Cancel, // UAC OnCancelFailure, // UAC OnUpdate, OnUpdateOffer, OnUpdateRejected, On422Update, On491Update, On200Update, OnPrack, // UAS On200Prack, // UAC Unknown } Event; typedef enum { NitComplete, NitProceeding } NitState; InviteSession(DialogUsageManager& dum, Dialog& dialog); virtual ~InviteSession(); virtual void dialogDestroyed(const SipMessage& msg); virtual void onReadyToSend(SipMessage& msg); virtual void dispatch(const SipMessage& msg); virtual void dispatch(const DumTimeout& timer); // Utility methods (one for each State) void dispatchConnected(const SipMessage& msg); void dispatchSentUpdate(const SipMessage& msg); void dispatchSentReinvite(const SipMessage& msg); void dispatchSentReinviteNoOffer(const SipMessage& msg); void dispatchSentReinviteAnswered(const SipMessage& msg); void dispatchGlare(const SipMessage& msg); void dispatchReinviteNoOfferGlare(const SipMessage& msg); void dispatchReceivedUpdateOrReinvite(const SipMessage& msg); void dispatchReceivedReinviteSentOffer(const SipMessage& msg); void dispatchAnswered(const SipMessage& msg); void dispatchWaitingToOffer(const SipMessage& msg); void dispatchWaitingToRequestOffer(const SipMessage& msg); void dispatchWaitingToTerminate(const SipMessage& msg); void dispatchWaitingToHangup(const SipMessage& msg); void dispatchTerminated(const SipMessage& msg); void dispatchBye(const SipMessage& msg); void startRetransmit200Timer(); void start491Timer(); void startStaleReInviteTimer(); void setSessionTimerHeaders(SipMessage& msg); void sessionRefresh(); void setSessionTimerPreferences(); void startSessionTimer(); void handleSessionTimerResponse(const SipMessage& msg); void handleSessionTimerRequest(SipMessage &response, const SipMessage& request); static Data toData(State state); void transition(State target); std::auto_ptr<SdpContents> getSdp(const SipMessage& msg); bool isReliable(const SipMessage& msg); static std::auto_ptr<SdpContents> makeSdp(const SdpContents& sdp); static std::auto_ptr<Contents> makeSdp(const SdpContents& sdp, const SdpContents* alternative); static void setSdp(SipMessage& msg, const SdpContents& sdp, const SdpContents* alternative = 0); static void setSdp(SipMessage& msg, const Contents* sdp); void provideProposedOffer(); void storePeerCapabilities(const SipMessage& msg); bool updateMethodSupported() const; void sendAck(const SdpContents *sdp=0); void sendBye(); DialogUsageManager::EncryptionLevel getEncryptionLevel(const SipMessage& msg); void setCurrentLocalSdp(const SipMessage& msg); void referNoSub(const SipMessage& msg); Tokens mPeerSupportedMethods; Tokens mPeerSupportedOptionTags; Mimes mPeerSupportedMimeTypes; Tokens mPeerSupportedEncodings; Tokens mPeerSupportedLanguages; Tokens mPeerAllowedEvents; Data mPeerUserAgent; NameAddrs mPeerPAssertedIdentities; Event toEvent(const SipMessage& msg, const SdpContents* sdp); State mState; NitState mNitState; std::auto_ptr<SdpContents> mCurrentLocalSdp; std::auto_ptr<Contents> mProposedLocalSdp; std::auto_ptr<SdpContents> mCurrentRemoteSdp; std::auto_ptr<SdpContents> mProposedRemoteSdp; SharedPtr<SipMessage> mLastLocalSessionModification; // last UPDATE or reINVITE sent SharedPtr<SipMessage> mLastRemoteSessionModification; // last UPDATE or reINVITE received SharedPtr<SipMessage> mInvite200; // 200 OK for reINVITE for retransmissions SharedPtr<SipMessage> mLastNitResponse; // //?dcm? -- ptr, delete when not needed? SipMessage mLastReferNoSubRequest; unsigned long mCurrentRetransmit200; unsigned int mStaleReInviteTimerSeq; // Session Timer settings UInt32 mSessionInterval; UInt32 mMinSE; bool mSessionRefresher; unsigned int mSessionTimerSeq; bool mSessionRefreshReInvite; class QueuedNIT { public: QueuedNIT(SharedPtr<SipMessage> NIT, bool referSub=false) : mNIT(NIT), mReferSubscription(referSub) {} SharedPtr<SipMessage>& getNIT() { return mNIT; } bool referSubscription() { return mReferSubscription; } private: SharedPtr<SipMessage> mNIT; bool mReferSubscription; }; std::queue<QueuedNIT*> mNITQueue; void nitComplete(); bool mReferSub; DialogUsageManager::EncryptionLevel mCurrentEncryptionLevel; DialogUsageManager::EncryptionLevel mProposedEncryptionLevel; // UPDATE or RE-INVITE EndReason mEndReason; // Used to respond to 2xx retransmissions. typedef HashMap<Data, SharedPtr<SipMessage> > AckMap; AckMap mAcks; private: friend class Dialog; friend class DialogUsageManager; // disabled InviteSession(const InviteSession&); InviteSession& operator=(const InviteSession&); // Utility methods for handling particular methods void dispatchOthers(const SipMessage& msg); void dispatchUnhandledInvite(const SipMessage& msg); void dispatchPrack(const SipMessage& msg); void dispatchCancel(const SipMessage& msg); void dispatchInfo(const SipMessage& msg); void dispatchMessage(const SipMessage& msg);};}#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 + -