⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sipmsg.hxx

📁 SIP(Session Initiation Protocol)是由IETF定义
💻 HXX
📖 第 1 页 / 共 3 页
字号:
	///add another item into the via list.	void addVia(SipVia* via);	///copy the via list from the src to this object.	void copyViaList(const SipMsg& src);	///return the entire Via list.	SipViaList getViaList() const;	//Check for loop in Via list	bool isLoopInViaList(const Data& myHost, int myPort, int limit) const;	///delete the contents of the via list.	void flushViaList();	///return the encoded via list.	Data encodeViaList() const;	/** return if this object's via list objects are less than the	 * src object's via list objects. */	bool ltViaList(const SipMsg& src) const;	///return true if both the objects contain identical via lists.	bool compareViaList(const SipMsg& src) const;                  /// front of the via list is the most recent one        void viaPushFront(const SipVia& item);        ///        void viaPopFront();        ///        const SipVia& viaFront() const;        ///        bool viaEmpty() const;        //@}  	// ----------------- Also Header Methods ------------------	/// Get the current CallId header 	const SipAlso& getAlso() const; 	/// Set the CallId header 	void setAlso( const SipAlso& );     	/// Set the CallId header 	void setAlso( const Data& textData);     	/**@name Diversion Methods          */        //@{    	///return the number of diversion objects in the list.	int getNumDiversion() const;	///remove the item given by location index.	void removeDiversion(int index = -1);	///add another item into the Diversion list.	void addDiversion(SipDiversion* sipdiversion);	///copy the diversion list from srcMsg to this object	void copyDiversionList( const SipMsg& srcMsg); 	///return the entire diversion list.	SipDiversionList getDiversionList() const;	///remove all items from the diversion list.	void flushDiversionList();	/** check if this object's diversion list objects are less	 * than the src object's diversion list objects */	bool ltDiversionList(const SipMsg& src) const;	/// return the item at location given by index.	const SipDiversion& getDiversion( int index=-1) const;	/// set the item in location index in the diversion list.	void setDiversion(const SipDiversion& item, int index=-1);	/** set the number of diversion objects to be equal to	 * index. If index is greater than the total number of objects	 * already present, null diversion objects are introduced in	 * between. */	void setNumDiversion(int index);	///return the encoded diversion list.	Data encodeDiversionList() const;    	///	bool compareDiversionList(const SipMsg& src) const;        //@}    	/** this function is contained in every message sub class,	 * such as Invite, Ack.. */	virtual Data encode() const=0;	/// encode the body of the message	void encodeBody(Data* msg) const;	/** this function is contained in SipCommand, and Status Msg	 * to decode different headers.  data should not be a	 * reference as it is modified in the decoding process */	static SipMsg* decode( Data data );	///	void setVersion( const Data& version);	///	Data getVersion() const;	///	void setRetryAfter(const SipRetryAfter& newretry);	///	void setRetryAfter(const Data& newretry);	///	const SipRetryAfter& getRetryAfter() const;	///	bool isRetry() const;	///	const Data& getReceivedIPName() const;	///	void setReceivedIPName(const Data& ipName);	/// 	const Data& getReceivedIPPort();	///	void setReceivedIPPort(const Data& ipName);    	/**@name Transfer functions.          */        //@{        ///	const SipTransferTo& getTransferTo() const;	///	void setTransferTo(const SipTransferTo& transTo);    	///	void setTransferTo(const Data& transTo);        //@}	/**@name Refer functions.          */        //@{        ///        bool hasReferredBy() const;               /// 	const SipReferredBy& getReferredBy() const;	///	void setReferredBy(const SipReferredBy& newreferredBy);    	///	void setReferredBy(const Data& newreferredBy);    	///	const SipReferTo& getReferTo() const;	///	void setReferTo(const SipReferTo& newreferTo);    	///	void setReferTo(const Data& newreferTo);        //@}	///Replaces functions	const SipReplaces& getReplaces() const;	///	void setReplaces(const SipReplaces& newreplaces);    	///	void setReplaces(const Data& newreplaces);	// ----------------- UserAgent Header Methods ------------------        /// Get the current UserAgent header        const SipUserAgent& getUserAgent() const;        /// Set the UserAgent header        void setUserAgent( const SipUserAgent& );        ///         void setUserAgent( const Data& textData);	/**@name Allow Header Methods          */        //@{        /// get the number of Allow items        int getNumAllow() const;        /// Get the i'th Allow item. If i is -1, it gets the last one        const SipAllow& getAllow( int i = -1) const;        /** set or add another Allow item, if the index is -1, it is	 * appended to the current list */        void setAllow( const SipAllow& item, int index = -1);            /** set or add another Allow item, if the index is -1, it is	 * appended to the current list */        void setAllow(const Data& item, int index = -1);        /** Set number of Allow items.If i is less than current number	 * then the extras are deleted. */        void setNumAllow(int i);        ///remove all the allow list items        void flushAllowList();            /** remove an item from allow list            @param index the ith allow is to be removed        */        void removeAllow(int index );        ///return the entire allow list        const vector < SipAllow* > & getAllowList() const;        ///add an item into the list.        void addAllow(SipAllow* sipallow);        ///copy allow from src to this object        void copyAllowList(const SipMsg& src);        ///return the encoded allow list        Data encodeAllowList() const;        ///compare the allow list of src object to this object.        bool compareAllow(const SipMsg& src) const;             //@}	//Parser functions.	///	static void removeSpaces(Data* data);#if 0	/** return the method given the first "word"	 * (whitespace-delimited) of the message (either the method	 * name or "SIP/2.0" for status msgs.	 */	static Method getMethod (const Data& method);#endif	/// 	void sdpdecode(Data ghdata, Data contType=0);	///	Data  getMultipartBoundary(Data data);      	///	void singleMimeDecode(Data singleMimeData, Data contTypeData);  	/** iterates through the contentData list, and gets the	 * contentlength and adds it up to set length of the	 * ContentLength object in SipMsg.	 */	void setContentLengthValue();       	/** force the header / body to be parsed into objects	 * immediately (overriding lazy parsing)	 */	void forceParse();#if USE_HASH_MAP	size_t hashfn() const;#endif        /**Check to see if message is a candidate for retransmission         *Derived classes must define the behaviour         */        virtual bool toBeRetransmitted() const = 0;        const SipRawHeaderContainer& getHeaderList() const { return myHeaderList; }        ///        bool nextHopIsAProxy() const { return myNextHopIsAProxy; };        ///        void setNextHopIsProxy(bool p) { myNextHopIsAProxy = p; };        ///        void setSendAddress(NetworkAddress &);        ///        const NetworkAddress& getSendAddress() const;        ///        ostream& brief(ostream& strm) const;        ///        string briefString() const;        /// Make a copy of this and wrap it in a smart pointer        virtual Sptr<SipMsg> clone();            protected:	/// the version of SIP being used	Data myVersion;	/// the address the message has been received from	NetworkAddress myReceivedAddress;	/** the container holding all of the messages          * the address the message has been sent to           */        NetworkAddress mySendAddress;        /// the container holding all of the messages	SipRawHeaderContainer myHeaderList;        /// the container holding mime list        mutable SipContentDataContainer myMimeList;	/** method to parse the headers and insert them into the HeaderList            @return  returns true if there was an error         */	bool parseHeaders(Data& headers);        ///        void parseMime(Data mime);	/** method to parse the message headers (other than the first line of         *  the message) and the MIME bodies (if present)         *         *  @param msg   the message to be parsed (other than the first line)         *         *  @return returns true if there was an error         */        bool parse(Data msg);    private:	bool retry;	///	Data version;	/** maintained for authentication. This contains the received	 * IP Name, set by the transceiver, and used by the Marshal	 * for IP authentication. */	Data recvdIPName;	/** maintained for authentication. This contains the received	 * IP port, set by the transceiver, and used by the Marshal	 * for IP authentication */	Data recvdIPPort;    	///  	void mimeDecode( const Data& mimeData );        ///        bool myNextHopIsAProxy;};ostream&operator<<(ostream& s, const SipMsg &msg);#if USE_HASH_MAPstruct hash<SipMsg>{	size_t operator()(const SipMsg& s) const ;};#endif/// this is now a public function to copy a pointer to a smart pointerSptr<SipMsg> copyPtrtoSptr(SipMsg* sipMsg);   } // namespace Vocal/* Local Variables: *//* c-file-style: "stroustrup" *//* indent-tabs-mode: nil *//* c-file-offsets: ((access-label . -) (inclass . ++)) *//* c-basic-offset: 4 *//* End: */#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -