//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project/CC
//
//File: cctstate_presentcall.cpp
//
//Version: $Revision: 1.8 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/06/30 15:11:04 $
//
//Organisation:
//      University of Technology
// 
//Author:
//      Pasi Nummisalo
//
//Description:
//      See header.
//
//Copyright:
//      Copyright 1999 Helsinki University of Technology
//      ALL RIGHTS RESERVED BETWEEN JANUARY 1996 AND JUNE 1999.
//      
//Licence:
//     
//
//History:
//

#include "ccprotocol.h"
#include "cctdp_answer.h"
#include "cctdp_callaccepted.h"
#include "cctstate_presentcall.h"
#include "cctstate_exception.h"
#include "iface/sigif/sigdownprimitives.h"

ccTstatePresentCall *ccTstatePresentCall :: _only = 0;

ccTstatePresentCall :: ccTstatePresentCall(void)
    : ccTstate()
{
    return;
}

ccTstatePresentCall :: ~ccTstatePresentCall(void)
{
    _only = 0;
    return;
}

ccTstatePresentCall *ccTstatePresentCall :: instance(void)
{
    if(_only == 0)
    {
        _only = new ccTstatePresentCall;
        assert(_only != 0);
    }
    return _only;
}

//
//Function: proceed
//
//Description:
//   Entry event: Facility Selected and Available event.   
//

void ccTstatePresentCall :: proceed(ccProtocol *)
{
#if CC_DEBUG
traceState(ccCCT,"Present Call");
#endif    
 
    // Stay in this state and wait for SETUPconf
    return;
}

//
//Function: sigSETUPconfAct
//
//Description:
//    Exit event: Call is accepted and answered by terminating party. 
//

void ccTstatePresentCall :: sigSETUPconfAct(sigSETUPconf *setupConf_,
                                            pfProtocol *protocol_)
{
#if CC_DEBUG
traceInput(ccDSS2T,ccCCT,"Present Call","SETUPconf");
#endif

    ccProtocol *ccprotocol = entryAction(protocol_);
    ccprotocol->saveData("setup", setupConf_);
    exitAction(ccprotocol, ccTdpAnswer::instance());
    
    return;
}

//
//Function: sigALERTINGindAct
//
//Description:
//    Exit event: Terminating party is being alerted  
//
//

/*
void ccTstatePresentCall :: sigALERTINGindAct(sigALERTINGind *,
                                              pfProtocol *protocol_)
{
#if CC_DEBUG
traceInput(ccDSS2T,ccCCT,"PresentCall","ALERTINGind");
#endif
    
    exitAction(protocol_, ccTdpCallAccepted::instance());

    return;
}
*/


