
#ifndef INAP_IDL
#define INAP_IDL

#include "TcSignaling.idl"

#pragma prefix "idl.tove"

module toveinap
{
    // Data types -------------------------------------------------------------
    // Created from ASN.1 module:
    // IN-CS2-datatypes
    // {ccitt recommendation q 1228 modules(0) in-cs2-datatypes (0) version1(0)}

    typedef ASN1_Integer minCalledPartyNumberLengthType;
    typedef ASN1_Integer maxCalledPartyNumberLengthType;
    typedef ASN1_Integer minCallingPartyNumberLengthType;
    typedef ASN1_Integer maxCallingPartyNumberLengthType;

    const minCalledPartyNumberLengthType minCalledPartyNumberLength = 5;
    const maxCalledPartyNumberLengthType maxCalledPartyNumberLength = 24;
    const minCallingPartyNumberLengthType minCallingPartyNumberLength = 5;
    const maxCallingPartyNumberLengthType maxCallingPartyNumberLength = 24;

    typedef sequence<octet,1> CallingPartysCategoryType;
    // Indicates the type of calling party (e.g. operator, payphone, ordinary
    // subscriber). Refer to Q.763 for encoding.

    union CallingPartysCategoryTypeOpt switch(boolean)
    {
        case TRUE: CallingPartysCategoryType callingPartysCategory;
    };

    typedef sequence<octet,maxCalledPartyNumberLength> CalledPartyNumberType;
    // Indicates the Called Party Number. Refer to Q.763 for encoding.

    union CalledPartyNumberTypeOpt switch(boolean)
    {
        case TRUE: CalledPartyNumberType calledPartyNumber;
    };

    typedef sequence<octet,maxCallingPartyNumberLength> CallingPartyNumberType;

    union CallingPartyNumberTypeOpt switch(boolean)
    {
        case TRUE: CallingPartyNumberType callingPartyNumber;
    };

    typedef sequence<CalledPartyNumberType,3> DestinationRoutingAddressType;
    // Indicates the list of Called Party Numbers (primary and alternates).

    typedef sequence<octet,2> CauseType;
    // Indicates the cause for interface related information. Refer to the Q.763
    // Cause parameter for encoding. For the use of cause and location values
    // refer to Q.850

    enum TaskRefusedType
    {
      generic,
      unobtainable,
      congestion
    };

    enum EventTypeBCSMType
    {
        origAttemptAuthorized,
        collectedInfo,
        analysedInformation,
        routeSelectFailure,
        oCalledPartyBusy,
        oNoAnswer,
        oAnswer,
        oMidCall,
        oDisconnect,
        oAbandon,
        termAttemptAuthorized,
        tBusy,
        tNoAnswer,
        tAnswer,
        tMidCall,
        tDisconnect,
        tAbandon,
        oTermSeized,
        oSuspended,
        tSuspended
   };
   // Indicates the BCSM detection point event. Refer to 4.2.2.2/Q.1214 for
   // additional information on the events.

   union EventTypeBCSMTypeOpt switch(boolean)
   {
      case TRUE: EventTypeBCSMType eventTypeBCSM;
   };

   enum MonitorModeType
   {
      interrupted,
      notifyAndContinue,
      transparent
   };
   // Indicates the event is relayed and/or processed by the SSP.

   struct BCSMEventType
   {
      EventTypeBCSMType	eventTypeBCSM;
      MonitorModeType	monitorMode;
   };
   // Indicates the BCSM Event information for monitoring.

   typedef sequence<BCSMEventType, 24> BCSMEventsType;

   enum UnavailableNetworkResourceType
   {
      unavailableResources,
      componentFailure,
      basicCallProcessingException,
      resourceStatusFailure,
      endUserFailure
   };
   // Indicates the network resource that failed.

   typedef ASN1_Integer ServiceKeyType;
   // Information that allows the SCF to choose the appropriate service logic.

   enum MessageTypeType
   {
      request,
      notification
   };

   enum DPAssignmentType
   {
      individualLine,
      groupBased,
      officeBased
   };

   struct MiscCallInfoType
   {
      MessageTypeType 	messageType;
      DPAssignmentType	dpAssignment;
   };
   // Indicates detection point related information.

   union MiscCallInfoTypeOpt switch(boolean)
   {
      case TRUE: MiscCallInfoType miscCallInfo;
   };

   enum TriggerTypeType
   {
      trigger_featureActivation,
      trigger_verticalServiceCode,
      trigger_customizedAccess,
      trigger_customizedIntercom,
      trigger_emergencyService,
      trigger_aFR,
      trigger_sharedIOTrunk,
      trigger_offHookDelay,
      trigger_channelSetupPRI,
      trigger_tNoAnswer,
      trigger_tBusy,
      trigger_oCalledPartyBusy,
      trigger_oNoAnswer,
      trigger_originationAttemptAuthorized,
      trigger_oAnswer,
      trigger_oDisconnect,
      trigger_termAttemptAuthorized,
      trigger_tAnswer,
      trigger_tDisconnect
   };
   // The type of trigger which caused call suspension.

   union TriggerTypeTypeOpt switch(boolean)
   {
      case TRUE: TriggerTypeType triggerType;
   };

   // Operation arguments -----------------------------------------------------
   // Created from ASN.1 module:
   // IN-CS2-SSF-SCF-ops-args
   // {ccitt recommendation q 1228 modules(0) in-cs2-ssf-scf-ops-args (5)
   //  version1(0)}

   struct ConnectArgType
   {
      DestinationRoutingAddressType destinationRoutingAddress;
   };

   struct RequestReportBCSMEventArgType
   {
      BCSMEventsType bcsmEvents;
   };

   struct SelectRouteArgType
   {
      DestinationRoutingAddressType destinationRoutingAddress;
   };

   struct ReleaseCallArgType
   {
      CauseType cause;
   };

   struct InitialDPArgType
   {
      ServiceKeyType 	     	      serviceKey;
      CalledPartyNumberTypeOpt    	calledPartyNumber;
      CallingPartyNumberTypeOpt	   callingPartyNumber;
      CallingPartysCategoryTypeOpt	callingPartysCategory;
      MiscCallInfoTypeOpt 	         miscCallInfo;
      TriggerTypeTypeOpt            triggerType;
      EventTypeBCSMTypeOpt	         eventTypeBCSM;
   };

   struct EventReportBCSMArgType
   {
      EventTypeBCSMType 	 eventTypeBCSM;
      MiscCallInfoType 	 miscCallInfo;
   };

   // Exceptions --------------------------------------------------------------
   // Created from ASN.1 module:
   // IN-CS2-errortypes
   // {ccitt recommendation q 1228 modules(0) in-cs2-errortypes (1) version1(0)}

   exception missingCustomerRecord {TcSignaling::DialogFlowCtr dfc;};
   // The Service Logic Program could not be found in the SCF.
   // Error code: localValue : 6

   exception missingParameter {TcSignaling::DialogFlowCtr dfc;};
   // An expected optional parameter was not received.
   // Error code: localValue : 7

   exception parameterOutOfRange {TcSignaling::DialogFlowCtr dfc;};
   // The parameter was not as expected (e.g. missing or out of range).
   // Error code: localValue : 8

   exception systemFailure
   {
      UnavailableNetworkResourceType error_param;
      TcSignaling::DialogFlowCtr dfc;
   };
   // The operation could not be completed due to a system failure at the
   // serving physical entity.
   // Error code: localValue : 11

   exception taskRefused
   {
      TaskRefusedType error_param;
      TcSignaling::DialogFlowCtr dfc;
   };
   // An entity normally capable of the task requested cannot or chooses not to
   // perform the task at this time.  This includes error situations like
   // congestion and unobtainable address as used in e.g. the connect operation.
   // Error code: localValue : 12

   exception unexpectedComponentSequence {TcSignaling::DialogFlowCtr dfc;};
   // An incorrect sequence of Components was received
   // (e.g. "DisconnectForwardConnection" followed by "PlayAnnouncement").
   // Error code: localValue : 14

   exception unexpectedDataValue {TcSignaling::DialogFlowCtr dfc;};
   // The data value was not as expected (e.g. routing number expected but
   // billing number received)
   // Error code: localValue : 15

   exception unexpectedParameter {TcSignaling::DialogFlowCtr dfc;};
   // A parameter received was not expected.
   // Error code: localValue : 16

   // Operations --------------------------------------------------------------
   // Created from ASN.1 module:
   // IN-CS2-SSF-SCF-ops-args
   // {ccitt recommendation q 1228 modules(0) in-cs2-ssf-scf-ops-args (5)
   //  version1(0)}

   interface SSF_SCF_initiator : TcSignaling::TcUser
   {
      void connect(in ConnectArgType ConnectArg,
         inout TcSignaling::TcContext ctext)
            raises (missingParameter, parameterOutOfRange, systemFailure,
            taskRefused, unexpectedComponentSequence, unexpectedDataValue,
            unexpectedParameter);
      // This operation is used to request the SSF to perform the call
      // processing actions to route or forward a call to a specified
      // destination. To do so, the SSF may or may not use destination
      // information from the calling party (e.g. dialed digits) and existing
      // call setup information (e.g. route index to a list of -- trunk groups),
      // depending on the information provided by the SCF.
      // - When address information is only included in the Connect operation,
      //   call processing resumes at PIC3 in  the O-BCSM.
      // - When address information and routing information is included, call
      //   processing resumes at PIC4.
      // Operation code: localValue : 20

      void releaseCall(in ReleaseCallArgType releaseCallArg,
         inout TcSignaling::TcContext ctext);
      // This operation is used to tear down an existing call at any phase of
      // the call for all parties involved in the call.
      // Operation code: localValue : 22

      void requestReportBCSMEvent(in RequestReportBCSMEventArgType
         requestReportBCSMEventArg, inout TcSignaling::TcContext ctext)
            raises (missingParameter, parameterOutOfRange, systemFailure,
            taskRefused, unexpectedComponentSequence, unexpectedDataValue,
            unexpectedParameter);
      // This operation is used to request the SSF to monitor for a call-related
      // event (e.g. BCSM events such as busy or no answer), then send a
      // notification back to the SCF when the event is detected.
      // Operation code: localValue : 23

      void selectRoute(in SelectRouteArgType selectRouteArg,
         inout TcSignaling::TcContext ctext)
	         raises(missingParameter, parameterOutOfRange, systemFailure,
            taskRefused, unexpectedComponentSequence, unexpectedDataValue,
            unexpectedParameter);
      // This operation is used to request the SSF to perform the originating
      // basic call processing actions to determine routing information and
      // select a route for a call, based either on call information available
      // to the SSF, or on call information provided by the SCF
      // (e.g. for alternate routing), to include the called party address,
      // type of call, carrier, route index, and one or more alternate route
      // indices. Based on the routing information, the SSF attempts to select
      // a primary route for the call, and if the route is busy, attempts to
      // select an alternate route. The SSF may fail to select a route for the
      // call if all routes are busy.
      // Operation code: localValue : 29

      void continue(inout TcSignaling::TcContext ctext);
      // This operation is used to request the SSF to proceed with call
      // processing at the DP at which it previously suspended call processing
      // to await SCF instructions (i.e. proceed to the next point in call in
      // the BCSM). The SSF continues call processing without substituting new
      // data from SCF.
      // Operation code: localValue : 31
   };

   interface SSF_SCF_responder : TcSignaling::TcUser
   {
      void initialDP(in InitialDPArgType initialDPArg,
         inout TcSignaling::TcContext ctext)
            raises (missingCustomerRecord, missingParameter,
               parameterOutOfRange, systemFailure, taskRefused,
               unexpectedComponentSequence, unexpectedDataValue,
               unexpectedParameter);
      // This operation is used after a TDP to indicate request for service.
      // Operation code: localValue : 0

      void eventReportBCSM(in EventReportBCSMArgType eventReportBCSMArg,
         inout TcSignaling::TcContext ctext);
      // This operation is used to notify the SCF of a call-related event
      // (e.g. BCSM events such as busy or no answer) previously requested by
      // the SCF in a RequestReportBCSMEvent operation.
      // Operation code: localValue : 24
   };

   // Factory interface -------------------------------------------------------
   // Defines creation operations for application contexts.

   interface TcUserFactory : TcSignaling::TcUserGenericFactory
   {
         SSF_SCF_responder create_SSF_SCF_responder(
            in SSF_SCF_initiator initiator,
            in TcSignaling::AssociationId a_id,
            in TcSignaling::TcContextSetting tc_context_setting)
               raises(TcSignaling::NoMoreAssociations,
                  TcSignaling::UnsupportedTcContext);

         SSF_SCF_responder create_SSF_SCF_responder_with_dialogdata(
            in SSF_SCF_initiator initiator,
            in TcSignaling::AssociationId a_id,
            in TcSignaling::TcContextSetting tc_context_setting,
            in string protocol_version,
            in TcSignaling::DialogUserData d_u_d)
               raises (TcSignaling::NoMoreAssociations,
                  TcSignaling::InvalidParameter,
                  TcSignaling::UnsupportedTcContext);

         SSF_SCF_initiator create_SSF_SCF_initiator();
   };

}; // module inap

#endif // INAP_IDL
