Click here to Skip to main content
15,880,608 members
Articles / Programming Languages / Visual C++ 10.0

SIP Stack (1 of 3)

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
20 Aug 2012CPOL3 min read 30K   1.7K   4  
SIP Stack Implementation on the basis of RFC SIP 3261 Specification
#pragma once

#ifndef CSIPURIParser_h
	#define CSIPURIParser_h

	#include "ASIPParser.h"
	#include "HHCoreInclude\CMessageData.h"
	#include "CSIPParamListParser.h"

	namespace SIPParserFW
	{
		class SIP_PARSER_DLL_DECLARATION_SPECIFIER CSIPURIParser : public ASIPParser 
		{
			friend class CPoolObject<CSIPURIParser> ;

		protected:
			CSIPURIParser() ;
			CSIPURIParser( const CSIPURIParser &SIPURIParser ) ;
			
			virtual ~CSIPURIParser() ;

			CSIPURIParser& operator=( const CSIPURIParser &SIPURIParser ) ;

		public:
			void Release() ;
			ASIPParser* Copy() ;

			FW_RETURN_TYPE Parse( const std::string &strStringToParse ) ;
			std::string ToString() const ;

		public:
			void SetScheme( const std::string &strScheme ) ;
			const std::string& GetScheme() const ;

			void SetUserName( const std::string &strUserName ) ;
			std::string GetUserName() const ;

			void SetPassword( const std::string &strPassword ) ;
			std::string GetPassword() const ;

			void SetHostName( const std::string &strHostName ) ;
			const std::string& GetHostName() const ;

			void SetPort( const std::string &strPort ) ;
			std::string GetPort() const ;

			FW_RETURN_TYPE QuerySIPURIParameters( CSIPParamListParser **pSIPURIParameters ) ;
			FW_RETURN_TYPE QuerySIPURIHeaders( CSIPParamListParser **pSIPURIHeaders ) ;

			CSIPParamListParser* GetSIPURIParameters() ;
			CSIPParamListParser* GetSIPURIHeaders() ;

		public:
			static CSIPURIParser* GetAvailable() ;

		private:
			void ReleaseParameters() ;
			
			void ReleaseCSIPURIParserData() ;
			void CopyCSIPURIParserData( const CSIPURIParser &SIPURIParser ) ;

		private:
			std::string m_strScheme ;
			CMessageData *m_pUserNameData ;
			CMessageData *m_pPasswordData ;
			std::string m_strHostName ;
			CMessageData *m_pPortData ;
			CSIPParamListParser *m_pSIPURIParameters ;
			CSIPParamListParser *m_pSIPURIHeaders ;
		} ;

		inline CSIPParamListParser* CSIPURIParser::GetSIPURIParameters()
		{
			return m_pSIPURIParameters ;
		}

		inline CSIPParamListParser* CSIPURIParser::GetSIPURIHeaders()
		{
			return m_pSIPURIHeaders ;
		}

		inline void CSIPURIParser::SetScheme( const std::string &strScheme )
		{
			m_strScheme = strScheme ;
		}

		inline const std::string& CSIPURIParser::GetScheme() const
		{
			return m_strScheme ;
		}

		inline void CSIPURIParser::SetHostName( const std::string &strHostName )
		{
			m_strHostName = strHostName ;
		}

		inline const std::string& CSIPURIParser::GetHostName() const
		{
			return m_strHostName ;
		}
		
	} // End namespace

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
India India
Hatim Haidry

VC++, Technical Architect

India

haidryhatim@gmail.com

Comments and Discussions