// -----------------------------------------------------------------------------
// CSIPExSIPServerOfferingState::AcceptInviteL()
// (other items were commented in a header).
// -----------------------------------------------------------------------------
void CSIPExSIPServerOfferingState::AcceptInviteL( CSIPExSIPEngine& aEngine)
	{
	_LIT8( KMediaType, "application" );
	_LIT8( KMediaSubType, "sdp" );
	_LIT8( KLogEntry, "200 OK sent" );

	// Get the current transaction
	CSIPServerTransaction& tx = aEngine.ServerTx();
	// Create the Response Elements object
    CSIPResponseElements* respElem =
    	CSIPResponseElements::NewLC( 
    	    200, SIPStrings::StringF( SipStrConsts::EPhraseOk ) );
    
    // Set the message body - we need to communicate our IP Address
    CSIPMessageElements& msgElem = respElem->MessageElements();

	CSdpDocument* sdpDocument = aEngine.SdpDocumentLC();
	HBufC8* sdpBody = aEngine.SdpBodyL( sdpDocument );
	CleanupStack::PushL( sdpBody );

   	CSIPContentTypeHeader* ct =
   		CSIPContentTypeHeader::NewLC( KMediaType, KMediaSubType );
	msgElem.SetContentL( sdpBody, ct );

	// Use the transaction to send 200 (OK)
	tx.SendResponseL( respElem );

	CleanupStack::Pop( ct );
	CleanupStack::Pop( sdpBody );
	CleanupStack::PopAndDestroy( sdpDocument );
	CleanupStack::Pop( respElem );

	aEngine.SetCurrentState( iServerEstablishingState );
	aEngine.Observer()->WriteLog( KLogEntry );
	}
// -----------------------------------------------------------------------------
// CSIPExSIPServerOfferingState::DeclineInviteL()
// (other items were commented in a header).
// -----------------------------------------------------------------------------
void CSIPExSIPServerOfferingState::DeclineInviteL( CSIPExSIPEngine& aEngine )
	{
	// Get the current transaction
	CSIPServerTransaction& tx = aEngine.ServerTx();
	// Create the Response Elements object
    CSIPResponseElements* elem =
    	CSIPResponseElements::NewLC( 486, 
    	    SIPStrings::StringF( SipStrConsts::EPhraseBusyHere ) );

	// Use the transaction to send 486 (Busy Here)
	tx.SendResponseL( elem );

	CleanupStack::Pop( elem );
	aEngine.Observer()->SessionEnded();
	aEngine.SetCurrentState( iTerminatedState );
	}