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

#include "protocol/cc/ccprotocol.h"
#include "cctdp_answer.h"
#include "cctstate_alerting.h"

ccTstateAlerting *ccTstateAlerting :: _only = 0;


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

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

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

//
//Function: proceed
//
//Description:
//    Entry event: Terminating party is being alerted of
//    incoming call.
//

void ccTstateAlerting :: proceed(ccProtocol *protocol_)
{
#if CC_DEBUG
traceSend(ccCCT,ccCC,"Alerting","ALERTING");
#endif
     
     ccALERTINGpdu *alerting = new ccALERTINGpdu;
   
     protocol_->toOtherSide(alerting);

     return;
}

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

void ccTstateAlerting :: sigSETUPconfAct(sigSETUPconf *,
                                         pfProtocol *)
{
#if CC_DEBUG
traceInput(ccDSS2T,ccCCT,"Alerting","SETUPconf");
#endif

    return;
}
