//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project/CC
//
//File: ccostate_alerting.cpp
//
//Version: $Revision: 1.8 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/06/11 15:29:32 $
//
//Organisation:
//      University of Technology
// 
//Author:
//      Pasi Nummisalo
//
//Description:
//     Not in use.
//
//Copyright:
//     University of Technology
//     Laboratory of Telecommunications and Multimedia 
//      
//Licence:
//     
//
//History:
//

#include "protocol/cc/ccprotocol.h"
#include "iface/sigif/sigdownprimitives.h"
#include "ccodp_answer.h"
#include "ccostate_alerting.h"

ccOstateAlerting *ccOstateAlerting :: _only = 0;

ccOstateAlerting :: ccOstateAlerting(void)
{
    return;
}

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

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

//
//Function:
//
//Description:
//   Entry event: Term Seized event     
//
//

void ccOstateAlerting :: proceed(ccProtocol *)
{
#if CC_DEBUG
traceSend(ccCC,ccDSS2,"Alerting","ALERTINGreq");
#endif

    // An indication is sent from O_BCSM to User when
    // the called party is being alerted (4.2.4.1)

    //++TODO++
    // Alerting message is not supported in sigif.
    //sigALERTINGreq *alerting = new sigALERTINGreq;
   
    //protocol_->toDown(alerting);

    return;
}


//
//Functions: inputs for messages from terminating side.
//
//Description:
//
//
//

void ccOstateAlerting :: ccSETUPpduAct(ccSETUPpdu *messenger_,
                                       ccProtocol *protocol_)
{
#if CC_DEBUG
traceInput(ccCCT,ccCC,"Alerting","SETUP");
#endif

    protocol_->saveData("setup", messenger_);
    exitAction(protocol_, ccOdpAnswer::instance());
    
    return;
}

// ++TODO++ RELEASEresp
