Click here to Skip to main content
15,883,901 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
#include "SIPParserInclude\CSIPInReplyToParser.h"

#include "SIPParserInclude\CSIPCallIDParser.h"

namespace SIPParserFW
{
	CSIPInReplyToParser::CSIPInReplyToParser()
	{
		ReleaseCSIPInReplyToParserData() ;
	}

	CSIPInReplyToParser::CSIPInReplyToParser( const CSIPInReplyToParser &SIPInReplyToParser )
		: ASIPParserListParser( SIPInReplyToParser )
	{
		ReleaseCSIPInReplyToParserData() ;

		CopyCSIPInReplyToParserData( SIPInReplyToParser ) ;
	}

	CSIPInReplyToParser::~CSIPInReplyToParser()
	{
		ReleaseCSIPInReplyToParserData() ;
	}

	CSIPInReplyToParser& CSIPInReplyToParser::operator=( const CSIPInReplyToParser &SIPInReplyToParser )
	{
		ReleaseCSIPInReplyToParserData() ;

		ASIPParserListParser::operator=( SIPInReplyToParser ) ;

		CopyCSIPInReplyToParserData( SIPInReplyToParser ) ;

		return *this ;
	}

	void CSIPInReplyToParser::ReleaseCSIPInReplyToParserData()
	{
	}

	void CSIPInReplyToParser::CopyCSIPInReplyToParserData( const CSIPInReplyToParser &SIPInReplyToParser )
	{
	}

	CSIPInReplyToParser* CSIPInReplyToParser::GetAvailable()
	{
		CSIPInReplyToParser *pSIPInReplyToParser = CPoolObject<CSIPInReplyToParser>::GetAvailable() ;
		return pSIPInReplyToParser ;
	}

	void CSIPInReplyToParser::Release()
	{
		ReleaseParameters() ;

		CPoolObject<CSIPInReplyToParser>::Release( this ) ;
	}

	void CSIPInReplyToParser::ReleaseParameters()
	{
		ReleaseCSIPInReplyToParserData() ;
		
		ASIPParserListParser::ReleaseParameters() ;
	}

	ASIPParserListParser* CSIPInReplyToParser::Copy()
	{
		CSIPInReplyToParser *pSIPInReplyToParser = CSIPInReplyToParser::GetAvailable() ;
		if( pSIPInReplyToParser == NULL )
			return NULL ;

		*pSIPInReplyToParser = *this ;

		return pSIPInReplyToParser ;
	}

	// Grammer
	//In-Reply-To = "In-Reply-To" HCOLON callid *(COMMA callid)
	//callid = word [ "@" word ]

	// Please see RFC3261, Pages from 172 to 173
	// Please see RFC3261, Pages from 219 to 232 for ABNF forms
	// Please see file ..\Document\SIPInReplyTo Parsing Logic.txt for parsing algorithm
	
	FW_RETURN_TYPE CSIPInReplyToParser::QueryAvailableParser( ASIPParser **pSIPParser )
	{
		*pSIPParser = NULL ;

		CSIPCallIDParser *pSIPCallIDParser = CSIPCallIDParser::GetAvailable() ;
		if( pSIPCallIDParser == NULL )
			return SIP_PARSE_ERR_SIP_CALL_ID_PARSER_OBJECT_NOT_CREATED ;

		*pSIPParser = pSIPCallIDParser ;

		return SIP_ERR_SUCCESS ;
	}

	std::string CSIPInReplyToParser::GetHeaderName() const
	{
		return GetRuntimeHeaderName( SIP_HEADER_IN_REPLY_TO ) ;
	}

} // End namespace

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