OpenSS7: ISUP Codec Example

OpenSS7 | Brian F. G. Bidulock, © Copyright 2000, Brian F. G. Bidulock, All Rights Reserved.
All OpenSS7 website, www.openss7.org resources have provided as a courtesy of the OpenSwitch Project and Herlein Engineering.

# ISUP Codec Example

Following is an example of the specification of ANSI 1992 ISUP for the SS7 encoder/decoder which is included in the package. There are two files:

ISUP_Codec.H,
  which provides a specification of the field, parameter and message classes, derived from SS7 encoder/decoder base classes, and the
ISUP_Codec.C,
  which provides the constructors for the ISUP derived classes based on the SS7 encoder/decoder base class constructors.

The entire specification of the ISUP syntax is less than 2000 lines long.

## ISUP_Codec.H

Following is the C++ header file for ANSI 1992 ISUP. The file provides declarations of the field, parameter and message types for ANSI ISUP. The classes are declared as deriving from the SS7 encode/decode base classes which provide the principle behaviour for the items (such as encode and decode methods).

    /******************************************************************************

     $Id: isup_codec.html,v 0.7.2.1 2000/10/04 03:52:24 brian Exp $

     Copyright (C) 1997, 1998, 1999  Brian Bidulock <bidulock@dallas.net>

     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.

     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.

     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

     ******************************************************************************/

    #ifndef __SS7_ISUP_CODEC_H__
    #define __SS7_ISUP_CODEC_H__

    #include "SS7_Codec.H"

    class Codec_INN     : public Set { public: Codec_INN    (); };
    class Codec_SCR     : public Set { public: Codec_SCR    (); };
    class Codec_PRES    : public Set { public: Codec_PRES   (); };
    class Codec_CPNI    : public Set { public: Codec_CPNI   (); };
    class Codec_EEM     : public Set { public: Codec_EEM    (); };
    class Codec_IW      : public Set { public: Codec_IW     (); };
    class Codec_EEI     : public Set { public: Codec_EEI    (); };
    class Codec_ISUPI   : public Set { public: Codec_ISUPI  (); };
    class Codec_NETPLAN : public Set { public: Codec_NETPLAN(); };
    class Codec_NETTYPE : public Set { public: Codec_NETTYPE(); };

    class Codec_CLRF   : public Parameter {
        public:
            Field*          CLID;
            Codec_PC*       PCODE;
            Codec_CLRF   ();
        };

    class Codec_ATP    : public Parameter {
        public:
            OctetString*    DATA;
            Codec_ATP    ();
        };

    class Codec_CDPN   : public Parameter {
        public:
            Set*            NAI;
            Set*            OE;
            Field*          SCR;
            Field*          PRES;
            Set*            NPLAN;
            Set*            INN;
            DigitString*    ADDI;
            Codec_CDPN   ();
        };

    class Codec_NCI    : public Parameter {
        public:
            Set*            SATI;
            Set*            CCI;
            Set*            OECHO;
            Field*          SPARE;
            Codec_NCI    ();
        };

    class Codec_FCI    : public Parameter {
        public:
            Set*            NIC;
            Set*            EEM;
            Set*            IW;
            Set*            EEI;
            Set*            ISUPI;
            Set*            ISUPPREF;
            Set*            ISDNOA;
            Field*          SPARE;
            Codec_FCI    ();
        };

    class Codec_OFCI   : public Parameter {
        public:
            Set*            CUGCI;
            Field*          SPARE1;
            Set*            CCBS;
            Field*          SPARE2;
            Set*            CNI;
            Set*            CNAR;
            Codec_OFCI   ();
        };

    class Codec_CPC    : public Parameter {
        public:
            Set*            CPC;
            Codec_CPC    ();
        };

    class Codec_CGPN   : public Parameter {
        public:
            Set*            NAI;
            Set*            OE;
            Set*            SCR;
            Set*            PRES;
            Set*            NPLAN;
            Set*            CPNI;
            DigitString*    ADDI;
            Codec_CGPN   ();
        };

    class Codec_RDGN   : public Parameter {
        public:
            Set*            NAI;
            Set*            OE;
            Set*            SCR;
            Set*            PRES;
            Set*            NPLAN;
            Field*          INN;
            DigitString*    ADDI;
            Codec_RDGN   ();
        };

    class Codec_RDNN   : public Parameter {
        public:
            Set*            NAI;
            Set*            OE;
            Field*          SCR;
            Set*            PRES;
            Set*            NPLAN;
            Set*            INN;
            DigitString*    ADDI;
            Codec_RDNN   ();
        };

    class Codec_CONR   : public Parameter {
        public:
            Field*          LREF;
            Codec_PC*       PCODE;
            Field*          PCLASS;
            Field*          CREDIT;
            Codec_CONR   ();
        };

    class Codec_INRI   : public Parameter {
        public:
            Set*            CPA;
            Set*            CPAH;
            Set*            CNA;
            Set*            CPC;
            Set*            CRG;
            Set*            RDA;
            Set*            INX;
            Set*            MCI;
            Set*            MCIH;
            Field*          SPARE;
            Set*            MLBG;
            Codec_INRI   ();
        };

    class Codec_INFI   : public Parameter {
        public:
            Set*            CPA;
            Set*            CPAH;
            Set*            CNA;
            Set*            CPC;
            Set*            CRG;
            Set*            RDA;
            Set*            INX;
            Set*            SOLINF;
            Field*          SPARE;
            Set*            MLBG;
            Codec_INFI   ();
        };

    class Codec_COTI   : public Parameter {
        public:
            Set*            COTI;
            Codec_COTI   ();
        };

    class Codec_BCI    : public Parameter {
        public:
            Set*            CRGI;
            Set*            CPS;
            Set*            CPCI;
            Set*            EEM;
            Set*            IW;
            Set*            EEI;
            Set*            ISUPI;
            Set*            HOLDR;
            Set*            ISDNTA;
            Set*            IECHO;
            Set*            SCCPMD;
            Codec_BCI    ();
        };

    class Codec_CAUS   : public Parameter {
        public:
            Set*            LOC;
            Set*            CODING;
            Field*          CODING_X;
            Bra*            CODING_X_B;
            Set*            CAUSV;
            Set*            REC;
            Codec_NULL*     NOREC;
            Codec_CAUS   ();
        };

    class Codec_RDI    : public Parameter {
        public:
            Set*            RDGI;
            Set*            CFNR;
            Set*            ORGRR;
            Field*          COUNT;
            Set*            RDGR;
            Codec_RDI    ();
        };

    class Codec_CGI    : public Parameter {
        public:
            Set*            TYPE;
            Codec_CGI    ();
        };

    class Codec_RnS    : public Parameter {
        public:
            Field*          RANGE;
            OctetString*    STATUS;
            Codec_RnS    ();
        };

    class Codec_FACI   : public Parameter {
        public:
            Set*            FACI;
            Codec_FACI   ();
        };

    class Codec_FAII   : public Parameter {
        public:
            Set*            CPF;
            Set*            CPAN;
            Set*            FRE;
            Set*            FRA;
            Field*          SPARE;
            Codec_FAII   ();
        };

    class Codec_CUGI   : public Parameter {
        public:
            Field*          BCODE;
            OctetString*    NETID;
            Codec_CUGI   ();
        };

    class Codec_INDEX  : public Parameter {
        public:
            Field*          INDEX;
            Codec_INDEX  ();
        };

    class Codec_USI    : public Parameter {
        public:
            Set*            ITC;
            Set*            CODING;
            Field*          EXT1;
            Set*            ITR;
            Set*            ITM;
            Field*          EXT2;
            Codec_USI    ();
        };

    class Codec_ISPC   : public Parameter {
        public:
            Codec_PC*       PCODE;
            Codec_ISPC   ();
        };

    class Codec_UUI    : public Parameter {
        public:
            OctetString*    DATA;
            Codec_UUI    ();
        };

    class Codec_CONN   : public Parameter {
        public:
            Set*            NAI;
            Set*            OE;
            Set*            SCR;
            Set*            PRES;
            Set*            NPLAN;
            Field*          INN;
            DigitString*    ADDI;
            Codec_CONN   ();
        };

    class Codec_SRIS   : public Parameter {
        public:
            Set*            SRI;
            Codec_SRIS   ();
        };

    class Codec_TNS    : public Parameter {
        public:
            Set*            NETPLAN;
            Set*            NETTYPE;
            Set*            OE;
            DigitString*    ADDI;
            Codec_TNS    ();
        };

    class Codec_EVNT   : public Parameter {
        public:
            Set*            EVNTI;
            Set*            EVNTP;
            Codec_EVNT   ();
        };

    class Codec_CSI    : public ParameterR {
        public:
            Set*            CSTATE;
            Codec_CSI    ();
            Codec_CSI    (const Codec_CSI&);
            Codec_CSI*   copy();
        };

    class Codec_ACL    : public Parameter {
        public:
            Set*            ACL;
            Codec_ACL    ();
        };

    class Codec_OCDN   : public Parameter {
        public:
            Set*            NAI;
            Set*            OE;
            Field*          SCR;
            Set*            PRES;
            Set*            NPLAN;
            Field*          INN;
            DigitString*    ADDI;
            Codec_OCDN   ();
        };

    class Codec_OBCI   : public Parameter {
        public:
            Set*            IBI;
            Set*            CFMO;
            Field*          SPARE;
            Set*            USRNET;
            Codec_OBCI   ();
        };

    class Codec_GENADR : public Parameter {
        public:
            Set*            TYPADR;
            Set*            NAI;
            Set*            OE;
            Field*          SCR;
            Set*            PRES;
            Set*            NPLAN;
            Field*          INN;
            DigitString*    ADDI;
            Codec_GENADR ();
        };

    class Codec_GENDIG : public Parameter {
        public:
            Set*            TYPDIG;
            Set*            GENES;
            DigitString*    ADDI;
            Codec_GENDIG ();
        };

    class Codec_EGRESS : public Parameter {
        public:
            OctetString*    DATA;
            Codec_EGRESS ();
        };

    class Codec_JUR    : public Parameter {
        public:
            DigitString*    ADDI;
            Codec_JUR    ();
        };

    class Codec_CIDC   : public Parameter {
        public:
            Set*            NETPLAN;
            Set*            NETTYPE;
            DigitString*    ADDI;
            Codec_CIDC   ();
        };

    class Codec_BGROUP : public Parameter {
        public:
            Set*            PSEL;
            Field*          LPII;
            Set*            BGIDT;
            Set*            AS;
            Field*          SPARE;
            Field*          BGID;
            Field*          SUBID;
            Set*            TBGLP;
            Set*            OBGLP;
            Codec_BGROUP ();
        };

    class Codec_NOTI   : public Parameter {
        public:
            Set*            NOT;
            Codec_NOTI   ();
        };

    class Codec_SVACT  : public Parameter {
        public:
            Set*            SVACT;
            Codec_SVACT  ();
        };

    class Codec_TRNSRQ : public Parameter {
        public:
            Field*          TRANSID;
            Codec_CPA*      CPA;
            Codec_TRNSRQ ();
        };

    class Codec_SPR    : public Parameter {
        public:
            Set*            SPR;
            Codec_SPR    ();
        };

    class Codec_CGCI   : public Parameter {
        public:
            Set*            CGTYP;
            Set*            DSC;
            Set*            ACI;
            Set*            CCRI;
            Codec_CGCI   ();
        };

    class Codec_CVRI   : public Parameter {
        public:
            Set*            CVRI;
            Codec_CVRI   ();
        };

    class Codec_OTGN   : public Parameter {
        public:
            DigitString*    ADDI;
            Codec_OTGN   ();
        };

    class Codec_CIN    : public Parameter {
        public:
            AsciiString*    CIN;
            Codec_CIN    ();
        };

    class Codec_CLLI   : public Parameter {
        public:
            AsciiString*    CLLI;
            Codec_CLLI   ();
        };

    class Codec_OLI    : public Parameter {
        public:
            Set*            OLI;
            Codec_OLI    ();
        };

    class Codec_CHGN   : public Parameter {
        public:
            Set*            NAI;
            Set*            OE;
            Field*          SCR;
            Field*          PRES;
            Set*            NPLAN;
            Field*          INN;
            DigitString*    ADDI;
            Codec_CHGN   ();
        };

    class Codec_SVCD   : public Parameter {
        public:
            Field*          SVCD;
            Codec_SVCD   ();
        };

    class Codec_CSEL   : public Parameter {
        public:
            Set*            CSEL;
            Codec_CSEL   ();
        };

    class Codec_CDPN_M : public ParameterPL {
        public:
            Field*          PTR;
            Field*          LEN;
            Codec_CDPN*     CDPN;
            Codec_CDPN_M ();
        };

    class Codec_CAUS_M : public ParameterPL {
        public:
            Field*          PTR;
            Field*          LEN;
            Codec_CAUS*     CAUS;
            Codec_CAUS_M ();
        };

    class Codec_RnS_M  : public ParameterPL {
        public:
            Field*          PTR;
            Field*          LEN;
            Codec_RnS*      RnS;
            Codec_RnS_M  ();
        };

    class Codec_USI_M  : public ParameterPL {
        public:
            Field*          PTR;
            Field*          LEN;
            Codec_USI*      USI;
            Codec_USI_M  ();
        };

    class Codec_CSI_M  : public ParameterPL {
        public:
            Field*          PTR;
            Field*          LEN;
            Codec_CSI*      CSI;
            Codec_CSI_M  ();
        };

    class Codec_IOPARM : public ParameterNL {
        public:
            Field*          PNAM;
            Field*          PL;
            Bra*            PNAM_B;
            Codec_IOPARM(char*,char*,Codec**);
            Codec_IOPARM(const Codec_IOPARM&);
            Codec_IOPARM* copy();
        };

    class Codec_IOPARMS : public ParameterP {
        public:
            Field*          PTR;
            Codec_IOPARM*   OPARM;
            Codec_CLRF*     CLRF;
            Codec_ATP*      ATP;
            Codec_CDPN*     CDPN;
            Codec_NCI*      NCI;
            Codec_FCI*      FCI;
            Codec_OFCI*     OFCI;
            Codec_CPC*      CPC;
            Codec_CGPN*     CGPN;
            Codec_RDGN*     RDGN;
            Codec_RDNN*     RDNN;
            Codec_CONR*     CONR;
            Codec_INRI*     INRI;
            Codec_INFI*     INFI;
            Codec_COTI*     COTI;
            Codec_BCI*      BCI;
            Codec_CAUS*     CAUS;
            Codec_RDI*      RDI;
            Codec_CGI*      CGI;
            Codec_RnS*      RnS;
            Codec_FACI*     FACI;
            Codec_FAII*     FAII;
            Codec_CUGI*     CUGI;
            Codec_INDEX*    INDEX;
            Codec_USI*      USI;
            Codec_ISPC*     ISPC;
            Codec_UUI*      UUI;
            Codec_CONN*     CONN;
            Codec_SRIS*     SRIS;
            Codec_TNS*      TNS;
            Codec_EVNT*     EVNT;
            Codec_CSI*      CSI;
            Codec_ACL*      ACL;
            Codec_OCDN*     OCDN;
            Codec_OBCI*     OBCI;
            Codec_GENADR*   GENADR;
            Codec_GENDIG*   GENDIG;
            Codec_EGRESS*   EGRESS;
            Codec_JUR*      JUR;
            Codec_CIDC*     CIDC;
            Codec_BGROUP*   BGROUP;
            Codec_NOTI*     NOTI;
            Codec_SVACT*    SVACT;
            Codec_TRNSRQ*   TRNSRQ;
            Codec_SPR*      SPR;
            Codec_CGCI*     CGCI;
            Codec_CVRI*     CVRI;
            Codec_OTGN*     OTGN;
            Codec_CIN*      CIN;
            Codec_CLLI*     CLLI;
            Codec_OLI*      OLI;
            Codec_CHGN*     CHGN;
            Codec_SVCD*     SVCD;
            Codec_CSEL*     CSEL;
            Codec_UREC*     UREC;
            Field*          PNAM;
            Field*          PL;
            Bra*            PNAM_B;
            Codec_IOPARMS(char*,char*);
        };

    class Codec_ISUP : public Header {
        public:
            Field*          CIC;
            Field*          MT;
            Bra*            MT_B;

            Codec_CDPN_M*   CDPN;
            Codec_NCI*      NCI;
            Codec_FCI*      FCI;
            Codec_CPC*      CPC;
            Codec_INRI*     INRI;
            Codec_INFI*     INFI;
            Codec_COTI*     COTI;
            Codec_BCI*      BCI;
            Codec_CAUS_M*   CAUS;
            Codec_CGI*      CGI;
            Codec_RnS_M*    RnS;
            Codec_FACI*     FACI;
            Codec_FAII*     FAII;
            Codec_USI_M*    USI;
            Codec_SRIS*     SRIS;
            Codec_EVNT*     EVNT;
            Codec_CSI_M*    CSI;
            Codec_CGCI*     CGCI;
            Codec_CVRI*     CVRI;
            Codec_IOPARMS*  OPARMS;

            ParameterG*     IAM;
            ParameterG*     INR;
            ParameterG*     INF;
            ParameterG*     COT;
            ParameterG*     ACM;
            ParameterG*     FOT;
            ParameterG*     ANM;
            ParameterG*     REL;
            ParameterG*     SUS;
            ParameterG*     RES;
            ParameterG*     RLC;
            ParameterG*     CCR;
            ParameterG*     RSC;
            ParameterG*     BLO;
            ParameterG*     UBL;
            ParameterG*     BLA;
            ParameterG*     UBA;
            ParameterG*     GRS;
            ParameterG*     CGB;
            ParameterG*     CGU;
            ParameterG*     CGBA;
            ParameterG*     CGUA;
            ParameterG*     FAR;
            ParameterG*     FAA;
            ParameterG*     FRJ;
            ParameterG*     FAD;
            ParameterG*     FAI;
            ParameterG*     LPA;
            ParameterG*     PAM;
            ParameterG*     GRA;
            ParameterG*     CQM;
            ParameterG*     CQR;
            ParameterG*     CPG;
            ParameterG*     UCIC;
            ParameterG*     CFN;
            ParameterG*     CRA;
            ParameterG*     CRM;
            ParameterG*     CVR;
            ParameterG*     CVT;
            ParameterG*     EXM;

            Codec_ISUP();
        };

    #endif __SS7_ISUP_CODEC_H__

## ISUP_Codec.C

Following is the C++ procedure file which specifies how parameter and message classes are constructed for ISUP. Most of the specification is the mnemonics and display strings to be used when displaying the decoding of an ISUP message. Class methods invoke base class methods in the SS7 encode/decode library.

    /******************************************************************************

     $Id: isup_codec.html,v 0.7.2.1 2000/10/04 03:52:24 brian Exp $

     Copyright (C) 1997, 1998, 1999  Brian Bidulock <bidulock@dallas.net>

     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.

     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.

     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

     ******************************************************************************/

    #include "ISUP_Codec.H"

    // ***********************************************************
    // ****
    // **** Common Field and Set Definitions
    // ****
    // ***********************************************************

    Codec_INN::Codec_INN() :
        Set("INN","Internal Number Ind",1,0,
            "YES",  0,  "Routing to internal number allowed",
            "NO",   1,  "Routing to internal number not allowed",
        NULL) {
    };

    Codec_SCR::Codec_SCR() :
        Set("SCR","Screening Indicator",2,0,
            "UPNV", 0,  "User provided, not verified",
            "UPVP", 1,  "User provided, verified and passed",
            "UPVF", 2,  "User provided, verified and failed",
            "NP",   3,  "Network provided",
        NULL) {
    };

    Codec_PRES::Codec_PRES() :
        Set("PRES","Presentation Ind",2,0,
            "YES",  0,  "Presentation allowed",
            "NO",   1,  "Presentation not allowed",
        NULL) {
    };

    Codec_CPNI::Codec_CPNI() :
        Set("CPNI","Number Incomplete Ind",1,0,
            "COM",  0,  "Complete",
            "INCOM",1,  "Incomplete",
        NULL) {
    };

    Codec_EEM::Codec_EEM() :
        Set("EEM","End to End Method",2,0,
            "NONE", 0,  "No end-to-end method available",
            "PASS", 1,  "Pass along method available",
            "SCCP", 2,  "SCCP method available",
            "BOTH", 3,  "Both Pass along and SCCP available",
        NULL) {
    };

    Codec_IW::Codec_IW() :
        Set("IW","Interworking Ind",1,0,
            "NO",   0,  "No interworking encountered",
            "YES",  1,  "Interworking encountered",
        NULL) {
    };

    Codec_EEI::Codec_EEI() :
        Set("EEI","End to end info",1,0,
            "NO",   0,  "No end to end information available",
            "YES",  1,  "End to end information available",
        NULL) {
    };

    Codec_ISUPI::Codec_ISUPI() :
        Set("ISUPI","ISDN User Part Ind",1,0,
            "NO",   0,  "ISUP not used all the way",
            "YES",  1,  "ISUP used all the way",
        NULL) {
    };

    Codec_NETPLAN::Codec_NETPLAN() :
        Set("NETPLAN","Network ID Plan",4,0,
            "UNK",  0,  "Unknown",
            "CIC3", 1,  "3 digit CIC with circuit code",
            "CIC4", 2,  "4 digit CIC with circuit code",
            "DNIC", 3,  "Public Data Network (DNIC)",
            "MNIC", 6,  "Public Land Mobile Network (MNIC)",
        NULL) {
    };

    Codec_NETTYPE::Codec_NETTYPE() :
        Set("NETTYPE","Network ID Type",3,0,
            "CCITT",    0,  "CCITT Standard Id",
            "NAT",      2,  "National Standard Id",
        NULL) {
    };

    // ***********************************************************
    // ****
    // **** Parameter Definitions
    // ****
    // ***********************************************************

    Codec_CLRF  ::Codec_CLRF  () :
        Parameter("CLRF","Call Reference",40,2,0,(Codec**)&CLID) {
        CLID = new Field("CLID","Call Identity",24,0);
        PCODE = new Codec_PC("PCODE","Point Code",4,6,4,2);
    };

    Codec_ATP   ::Codec_ATP   () :
        Parameter("ATP","Access Transport",-1,1,0,(Codec**)&DATA) {
        DATA = new OctetString("DATA","Data",-1);
    };

    Codec_CDPN  ::Codec_CDPN  () :
        Parameter("CDPN","Called Party Number",-1,7,0,(Codec**)&NAI) {
        NAI   = new Codec_NAI();
        OE    = new Codec_OE();
        SCR   = new Codec_SPAR2();
        PRES  = new Codec_SPAR2();
        NPLAN = new Codec_NPLAN();
        INN   = new Codec_INN();
        ADDI  = new Codec_ADDI();
    };

    Codec_NCI   ::Codec_NCI   () :
        Parameter("NCI","Nat of Connection Inds",8,4,0,(Codec**)&SATI) {
        SATI = new Set("SATI","Satellite Indicator",2,0,
            "0",    0,  "No satellite circuit",
            "1",    1,  "One satellite circuit",
            "2",    2,  "Two satellite circuits",
            "3",    3,  "Three or more satellite circuits",
            NULL);
        CCI = new Set("CCI","Continuity Check Ind",2,0,
            "NO",   0,  "Check not required",
            "YES",  1,  "Check required on this circuit",
            "PREV", 2,  "Check performed on a previous circuit",
            NULL);
        OECHO = new Set("OECHO","Echo Control Ind",1,0,
            "NO",   0,  "No outgoing half echo control device",
            "YES",  1,  "Outgoing half echo control device",
            NULL);
        SPARE = new Codec_SPAR3();
    };

    Codec_FCI   ::Codec_FCI   () :
        Parameter("FCI","Forward Call Inds",16,8,0,(Codec**)&NIC) {
        NIC = new Set("NIC","Nat'l/Int'l Call Ind",1,0,
            "NAT",  0,  "Call treated as national call",
            "INT",  1,  "Call treated as international call",
            NULL);
        EEM   = new Codec_EEM();
        IW    = new Codec_IW();
        EEI   = new Codec_EEI();
        ISUPI = new Codec_ISUPI();
        ISUPPREF = new Set("ISUPPREF","ISUP Preference Ind",2,0,
            "YES",  0,  "ISUP preferred all the way",
            "NO",   1,  "ISUP not required all the way",
            "REQ",  2,  "ISUP required all the way",
            NULL);
        ISDNOA = new Set("ISDNOA","Originating Access",1,0,
            "NO",   0,  "Non-ISDN",
            "YES",  1,  "ISDN",
            NULL);
        SPARE = new Codec_SPAR7();
    };

    Codec_OFCI  ::Codec_OFCI  () :
        Parameter("OFCI","Opt Forward Call Inds",8,6,0,(Codec**)&CUGCI) {
        CUGCI = new Set("CUGCI","CUG Call Ind",2,0,
            "CUG",  0,  "CUG check successful",
            "NONE", 1,  "Non-CUG call",
            "OGA",  2,  "CUG call with outgoing access",
            "NOGA", 3,  "CUG call without outgoing access",
            NULL);
        SPARE1 = new Codec_SPAR2();
        CCBS = new Set("CCBS","CCBS Call Ind",1,0,
            "NO",   0,  "Not a CCBS call",
            "YES",  1,  "CCBS call",
            NULL);
        SPARE2 = new Codec_SPAR1();
        CNI = new Set("CNI","Calling Party Number",1,0,
            "NO",   0,  "Complete",
            "YES",  1,  "Incomplete",
            NULL);
        CNAR = new Set("CNAR","Connected Address",1,0,
            "NO",   0,  "Not requested",
            "YES",  1,  "Requested",
            NULL);
    };

    Codec_CPC   ::Codec_CPC   () :
        Parameter("CPC","Calling Party Category",8,1,0,(Codec**)&CPC) {
        CPC = new Set("CPC","Calling Party Category",8,0,
            "UNK",  0,   "Unknown",
            "FR",   1,   "Operator - French",
            "ENG",  2,   "Operator - English",
            "GER",  3,   "Operator - German",
            "RUS",  4,   "Operator - Russian",
            "SPA",  5,   "Operator - Spanish",
            "ORD",  10,  "Ordinary calling subscriber",
            "PRIO", 11,  "Calling subscriber with priority",
            "DATA", 12,  "Data call",
            "TEST", 13,  "Test call",
            "NVT",  14,  "Non-voice terminal",
            "PAY",  15,  "Payphone",
            "P2",   250, "Subscriber with precedence level 2",
            "P3",   251, "Subscriber with precedence level 3",
            "P4",   252, "Subscriber with precedence level 4",
            "P5",   253, "Subscriber with precedence level 5",
            NULL);
    };

    Codec_CGPN  ::Codec_CGPN  () :
        Parameter("CGPN","Calling Party Number",-1,7,0,(Codec**)&NAI) {
        NAI   = new Codec_NAI();
        OE    = new Codec_OE();
        SCR   = new Codec_SCR();
        PRES  = new Codec_PRES();
        NPLAN = new Codec_NPLAN();
        CPNI  = new Codec_CPNI();
        ADDI  = new Codec_ADDI();
    };

    Codec_RDGN  ::Codec_RDGN  () :
        Parameter("RDGN","Redirecting Number",-1,7,0,(Codec**)&NAI) {
        NAI   = new Codec_NAI();
        OE    = new Codec_OE();
        SCR   = new Codec_SCR();
        PRES  = new Codec_PRES();
        NPLAN = new Codec_NPLAN();
        INN   = new Codec_SPAR1();
        ADDI  = new Codec_ADDI();
    };

    Codec_RDNN  ::Codec_RDNN  () :
        Parameter("RDNN","Redirection Number",-1,7,0,(Codec**)&NAI) {
        NAI   = new Codec_NAI();
        OE    = new Codec_OE();
        SCR   = new Codec_SPAR2();
        PRES  = new Codec_PRES();
        NPLAN = new Codec_NPLAN();
        INN   = new Codec_INN();
        ADDI  = new Codec_ADDI();
    };

    Codec_CONR  ::Codec_CONR  () :
        Parameter("CONR","Connection Request",56,4,0,(Codec**)&LREF) {
        LREF   = new Field("LREF","Local Reference",24,0);
        PCODE  = new Codec_PC("PCODE","Point Code");
        PCLASS = new Field("PLCASS","Protocol Class",8,0);
        CREDIT = new Field("CREDIT","Credit",8,0);
    };

    Codec_INRI  ::Codec_INRI  () :
        Parameter("INRI","Info Request Inds",16,11,0,(Codec**)&CPA) {
        CPA = new Set("CPA","Calling Party Address",1,0,
            "NO",   0,  "Not requested",
            "YES",  1,  "Requested",
            NULL);
        CPAH = new Set("CPAH","CPA Holding",1,0,
            "NO",   0,  "Hold not requested",
            "YES",  1,  "Hold requested",
            NULL);
        CNA = new Set("CNA","Connected Address",1,0,
            "NO",   0,  "Not requested",
            "YES",  1,  "Requested",
            NULL);
        CPC = new Set("CPC","Calling Party Category",1,0,
            "NO",   0,  "Not requested",
            "YES",  1,  "Requested",
            NULL);
        CRG = new Set("CRG","Charge Information",1,0,
            "NO",   0,  "Not requested",
            "YES",  1,  "Requested",
            NULL);
        RDA = new Set("RDA","Redirecting Address",1,0,
            "NO",   0,  "Not requested",
            "YES",  1,  "Requested",
            NULL);
        INX = new Set("INX","Index",1,0,
            "NO",   0,  "Not requested",
            "YES",  1,  "Requested",
            NULL);
        MCI = new Set("MCI","Malicious Call ID",1,0,
            "NO",   0,  "Not requested",
            "YES",  1,  "Requested",
            NULL);
        MCIH = new Set("MCIH","MCI Holding",1,0,
            "NO",   0,  "Hold not requested",
            "YES",  1,  "Hold requested",
            NULL);
        SPARE = new Codec_SPAR6();
        MLBG = new Set("MLBG","Business Group Info",1,0,
            "NO",   0,  "Not requested",
            "YES",  1,  "Requested",
            NULL);

    };

    Codec_INFI  ::Codec_INFI  () :
        Parameter("INFI","Info Indicators",16,10,0,(Codec**)&CPA) {
        CPA = new Set("CPA","Calling Party Address",2,0,
            "NOTI", 0,  "Not included",
            "NOTA", 1,  "Not available",
            "INCL", 3,  "Included",
            NULL);
        CPAH = new Set("CPAH","CPA Hold",1,0,
            "NO",   0,  "Hold not provided",
            "YES",  1,  "Hold provided",
            NULL);
        CNA = new Set("CNA","Connected Address",2,0,
            "NOTI", 0,  "Not included",
            "NOTA", 1,  "Not available",
            "INCL", 3,  "Included",
            NULL);
        CPC = new Set("CPC","Calling Party Category",1,0,
            "NO",   0,  "Not included",
            "YES",  1,  "Included",
            NULL);
        CRG = new Set("CRG","Charge Information",1,0,
            "NO",   0,  "Not included",
            "YES",  1,  "Included",
            NULL);
        RDA = new Set("RDA","Redirecting Address",2,0,
            "NOTI", 0,  "Not included",
            "NOTA", 1,  "Not available",
            "INCL", 3,  "Included",
            NULL);
        INX = new Set("INX","Index",1,0,
            "NO",   0,  "Not included",
            "YES",  1,  "Included",
            NULL);
        SOLINF = new Set("SOLINF","Solicited Information",1,0,
            "NO",   0,  "Solicited",
            "YES",  1,  "Unsolicited",
            NULL);
        SPARE = new Codec_SPAR4();
        MLBG = new Set("MLBG","Business Group Info",1,0,
            "NO",   0,  "Not included",
            "YES",  1,  "Included",
            NULL);
    };

    Codec_COTI  ::Codec_COTI  () :
        Parameter("COTI","Continuity Indicators",8,1,0,(Codec**)&COTI) {
        COTI = new Set("COTI","Continuity Indicator",1,7,
            "FAIL", 0,  "Continuity check failed",
            "PASS", 1,  "Continuity check passed",
            NULL);
    };

    Codec_BCI   ::Codec_BCI   () :
        Parameter("BCI","Backward Call Inds",16,11,0,(Codec**)&CRGI) {
        CRGI = new Set("CRGI","Charge Indicator",2,0,
            "NIND", 0,  "No indication",
            "NO",   1,  "No charge",
            "YES",  2,  "Charge",
            NULL);
        CPS = new Set("CPS","Called Party Status",2,0,
            "NIND", 0,  "No indication",
            "FREE", 1,  "Subscriber free",
            "CON",  2,  "Connect when free",
            NULL);
        CPCI = new Set("CPCI","Called Party Category",2,0,
            "NIND", 0,  "No indication",
            "ORD",  1,  "Ordinary subscriber",
            "PAY",  2,  "Payphone",
            NULL);
        EEM   = new Codec_EEM();
        IW    = new Codec_IW();
        EEI   = new Codec_EEI();
        ISUPI = new Codec_ISUPI();
        HOLDR = new Set("HOLDR","Holding",1,0,
            "NO",   0,  "Hold not required",
            "YES",  1,  "Hold required",
            NULL);
        ISDNTA = new Set("ISDNTA","Terminating Access",1,0,
            "NO",   0,  "Non-ISDN",
            "YES",  1,  "ISDN",
            NULL);
        IECHO = new Set("IECHO","Echo Control Ind",1,0,
            "NO",   0,  "No incoming half echo control device",
            "YES",  1,  "Incoming half echo control device",
            NULL);
        SCCPMD = new Set("SCCPMD","SCCP Method Ind",2,0,
            "NIND", 0,  "No indication",
            "CL",   1,  "Connectionless method available",
            "CO",   2,  "Connection oriented method available",
            "BOTH", 3,  "Both SCCP methods available",
            NULL);
    };

    Codec_CAUS  ::Codec_CAUS  () :
        Parameter("CAUS","Cause Indicators",16,5,2,(Codec**)&LOC) {
        LOC = new Set("LOC","Location",4,1,
            "USER",     0,  "User",
            "PRIVL",    1,  "Private network serving the local user",
            "PUBL",     2,  "Public network serving the local user",
            "TRANS",    3,  "Transit network",
            "PUBR",     4,  "Public network serving the remote user",
            "PRIVR",    5,  "Private network serging the remote user",
            "LIF",      6,  "Local interface controlled by this link",
            "INT",      7,  "International network",
            "IW",       10, "Unknown (beyond an interworking point)",
            NULL);
        CODING = new Set("CODING","Coding Standard",2,0,
            "CCITT",    0,  "CCITT Standard",
            "NAT",      2,  "National Standard",
            "NET",      3,  "Network specific",
            NULL);
        CODING_X = new Field("EXT","Extension",1,0);
        REC = new Set("REC","Recommendation",7,1,
            "Q763",     0,  "Recommendation Q.763",
            "X21",      3,  "Recommendation X.21",
            "X25",      4,  "Recommendation X.25",
            "LAND",     5,  "Public land mobile network",
            NULL);
        NOREC = new Codec_NULL("NOREC","No Recommendation");
        CODING_X_B = new Bra("EXT:","Extension Branch",(Codec*)CODING_X,
                REC  , 0, NOREC, 1,
            NULL);
        CAUSV = new Set("CAUSV","Cause Value",7,1,
            "UN",    1, "Unallocated (unassigned) number",
            "NRSTN", 2, "No route to specified transit net",
            "NRD",   3, "No route to destination",
            "SSIT",  4, "Send special information tone",
            "MDT",   5, "Misdialled trunk prefix",
            "NORM",  16, "Normal call clearing",
            "UB",    17, "User busy",
            "NUR",   18, "No user responding",
            "NAU",   19, "No answer from user (alerted)",
            "CR",    21, "Call rejected",
            "NC",    22, "Number changed",
            "DOO",   27, "Destination out of order",
            "AI",    28, "Address incomplete",
            "FR",    29, "Facility rejected",
            "NU",    31, "Normal - unspecified",
            "NCA",   34, "No circuit available",
            "NOO",   38, "Network out of order",
            "TF",    41, "Temporary failure",
            "SEC",   42, "Switching equipment congestion",
            "UID",   43, "Access information discarded",
            "RCNA",  44, "Requested channel not available",
            "PREMT", 45, "Preemption",
            "RUU",   47, "Resource unavailable -unspecified",
            "RFNS",  50, "Requested facility not subscribed",
            "ICB",   55, "Incoming calls barred within CUG",
            "BCNAT", 57, "Bearer capability not authorized",
            "BCNAV", 58, "Bearer capability not available",
            "SUU",   63, "Service unavailable -unspecified",
            "BCNI",  65, "Bearer capability not implemented",
            "RFU",   69, "Requested facility unimplemented",
            "RDIA",  70, "Only restrictd digital info avail",
            "SIU",   79, "Service unimplemented -unspecif'd",
            "MCUG",  87, "Called user not member of CUG",
            "ID",    88, "Incompatible destination",
            "ITNS",  91, "Invalid transit network selection",
            "IMU",   95, "Invalid message - unspecified",
            "MT",    97, "Message type non-existent",
            "P-D",   99, "Parameter non-existent -discarded",
            "IPC",   100, "Invalid parameter contents",
            "RTE",   102, "Recovery on timer expiry",
            "P-P",   103, "Parameter non-existent -passed on",
            "PEU",   111, "Protocol error - unspecified",
            "IWU",   127, "Interworking class - unspecified",
            NULL);
    };

    Codec_RDI   ::Codec_RDI   () :
        Parameter("RDI","Redirection Info",16,5,0,(Codec**)&RDGI) {
        RDGI = new Set("RDGI","Redirecting Ind",3,0,
            "NONE", 0,  "No redirection",
            "R",    1,  "Call rerouted",
            "RIR",  2,  "Call rerouted, all info restricted",
            "F",    3,  "Call forwarded",
            "FIR",  4,  "Call forwarded, all info restricted",
            "RNR",  5,  "Call rerouted, number restricted",
            "FNR",  6,  "Call forwarded, number restricted",
            NULL);
        CFNR = new Set("CFNR","No Reply Forwarding",1,0,
            "NO",   0,  "Not yet occutred",
            "YES",  1,  "Has occurred",
            NULL);
        ORGRR = new Set("ORGRR","Orig Redir Reason",4,0,
            "UNK",  0,  "Unknown/not available",
            "UB",   1,  "User busy",
            "NOREP",2,  "No reply",
            "UNC",  3,  "Unconditional",
            NULL);
        COUNT = new Field("COUNT","Redirection Counter",4,0);
        RDGR = new Set("RDGR","Redirecting Reason",4,0,
            "UNK",  0,  "Unknown/not available",
            "UB",   1,  "User busy",
            "NOREP",2,  "No reply",
            "UNC",  3,  "Unconditional",
            NULL);
    };

    Codec_CGI   ::Codec_CGI   () :
        Parameter("CGI","Cct Group Supv Type",8,1,0,(Codec**)&TYPE) {
        TYPE = new Set("TYPE","Type Ind",2,6,
            "MAINT",    0,  "Maintenance oriented",
            "HW",       1,  "Hardware failure oriented",
            "SW",       2,  "Software oriented",
            NULL);
    };

    Codec_RnS   ::Codec_RnS   () :
        Parameter("R&S","Range and Status",-1,2,0,(Codec**)&RANGE) {
        RANGE = new Field("RANGE","Range",8,0);
        STATUS = new OctetString("STATUS","Status",-1);
    };

    Codec_FACI  ::Codec_FACI  () :
        Parameter("FACI","Facility Indicator",8,1,0,(Codec**)&FACI) {
        FACI = new Set("FACI","Facility Indicator",8,0,
            "UUI",  2,  "User to user service",
            NULL);
    };

    Codec_FAII  ::Codec_FAII  () :
        Parameter("FAII","Facility Info Inds",8,5,0,(Codec**)&CPF) {
        CPF = new Set("CPF","Called Party Free",1,0,
            "NO",   0,  "Busy",
            "YES",  1,  "Free",
            NULL);
        CPAN = new Set("CPAN","Calling Party Answer",1,0,
            "NO",   0,  "No calling party answer",
            "YES",  1,  "Calling pary answer",
            NULL);
        FRE = new Set("FRE","Facility Req Enquiry",1,0,
            "NO",   0,  "No enquiry",
            "YES",  1,  "Active enquiry",
            NULL);
        FRA = new Set("FRA","Facility Req Active",1,0,
            "NO",   0,  "Not active",
            "YES",  1,  "Active",
            NULL);
        SPARE = new Codec_SPAR4();
    };

    Codec_CUGI  ::Codec_CUGI  () :
        Parameter("CUGI","CUG Interlock Code",32,2,0,(Codec**)&BCODE) {
        BCODE = new Field("BCODE","Binary Code",16,0);
        NETID = new OctetString("NETID","Network Identity",16);
    };

    Codec_INDEX ::Codec_INDEX () :
        Parameter("INDEX","Index",8,1,0,(Codec**)&INDEX) {
        INDEX = new Field("INDEX","Index",8,0);
    };

    Codec_USI   ::Codec_USI   () :
        Parameter("USI","User Service Info",16,6,0,(Codec**)&ITC) {
        ITC = new Set("ITC","Info Trans Capability",5,0,
            "SPEECH",   0,  "Speech",
            "UNRESDIG", 8,  "Unrestricted digital information",
            "RESDIG",   9,  "Restricted digital information",
            "AUDIO3",   16, "3.1 kHz audio",
            "AUDIO7",   17, "7 kHz audio",
            "AUDIO15",  18, "15 kHz audio",
            "VIDEO",    24, "Video",
            NULL);
        CODING = new Set("CODING","Coding Standard",2,0,
            "CCITT",    0,  "CCITT Standard",
            "NAT",      2,  "National Standard",
            "NET",      3,  "Network specific",
            NULL);
        EXT1 = new Codec_SPAR1();
        ITR = new Set("ITR","Info Transfer Rate",5,0,
            "PACK", 0,  "Channel size",
            "64",   16, "64 kbits/s",
            "2x64", 17, "2 x 64 kbits/s",
            "384",  19, "384 kbits/s",
            "1536", 21, "1536 kbits/s",
            "1920", 23, "1920 kbits/s",
            NULL);
        ITM = new Set("ITM","Info Transfer Mode",2,0,
            "C",    0,  "Circuit mode",
            "P",    1,  "Packet mode",
            NULL);
        EXT2 = new Codec_SPAR1();
    };

    Codec_ISPC  ::Codec_ISPC  () :
        Parameter("ISPC","Signalling Point Code",-1,1,0,(Codec**)&PCODE) {
        PCODE = new Codec_PC("SPC","Signalling Point Code");
    };

    Codec_UUI   ::Codec_UUI   () :
        Parameter("UUI","User to User Info",-1,1,0,(Codec**)&DATA) {
        DATA = new OctetString("DATA","Data",-1);
    };

    Codec_CONN  ::Codec_CONN  () :
        Parameter("CONN","Connected Number",-1,7,0,(Codec**)&NAI) {
        NAI   = new Codec_NAI();
        OE    = new Codec_OE();
        SCR   = new Codec_SCR();
        PRES  = new Codec_PRES();
        NPLAN = new Codec_NPLAN();
        INN   = new Codec_SPAR1();
        ADDI  = new Codec_ADDI();
    };

    Codec_SRIS  ::Codec_SRIS  () :
        Parameter("SRIS","Suspend/Resume Inds",8,1,0,(Codec**)&SRI) {
        SRI = new Set("SRI","Suspend/Resume Ind",1,7,
            "ISDN", 0,  "ISDN subscriber initiated",
            "NET",  1,  "Network initiated",
            NULL);
    };

    Codec_TNS   ::Codec_TNS   () :
        Parameter("TNS","Transit Ntwk Selection",-1,4,0,(Codec**)&NETPLAN) {
        NETPLAN = new Codec_NETPLAN();
        NETTYPE = new Codec_NETTYPE();
        OE      = new Codec_OE();
        ADDI    = new Codec_ADDI();
    };

    Codec_EVNT  ::Codec_EVNT  () :
        Parameter("EVNT","Event Information",8,2,0,(Codec**)&EVNTI) {
        EVNTI = new Set("EVNTI","Event Indicator",7,0,
            "ALERT",    1,  "ALERTing",
            "PROG",     2,  "PROGRESS",
            "IBI",      3,  "Inband information/pattern now available",
            "BUSY",     4,  "Call forwarded on busy",
            "NOREP",    5,  "Call forwarded on no reply",
            "UNC",      6,  "Call forwarded unconditional",
            NULL);
        EVNTP = new Set("EVNTP","Event Presentation",1,0,
            "NO",   0,  "No indication",
            "YES",  1,  "Presentation restricted",
            NULL);
    };

    Codec_CSI   ::Codec_CSI   () :
        ParameterR("CSI","Circuit State Info",8,1,0,(Codec**)&CSTATE) {
        // this set repeats
        CSTATE = new Set("CSTATE","Circuit State",8,0,
            "TRANS",       0,  "Transient",
            "UNEQP",       3,  "Unequipped",
            "ICB-NB",      4,  "Incoming busy, no blocking",
            "ICB-LB",      5,  "Incoming busy, local M block",
            "ICB-RB",      6,  "Incoming busy, remote M block",
            "ICB-LRB",     7,  "Incoming busy, local/remote M block",
            "OGB-NB",      8,  "Outgoing busy, no blocking",
            "OGB-LB",      9,  "Outgoing busy, local M block",
            "OGB-RB",      10, "Outgoing busy, remote M block",
            "OGB-LRB",     11, "Outgoing busy, local/remote M block",
            "IDL-NB",      12, "Idle, no blocking",
            "IDL-LB",      13, "Idle, local M block",
            "IDL-RB",      14, "Idle, remote M block",
            "IDL-LRB",     15, "Idle, local/remote M block",
            "IDL-NB-LB",   28, "Idle, local HW block",
            "IDL-LB-LB",   29, "Idle, local M & HW block",
            "IDL-RB-LB",   30, "Idle, remote M block, local HW block",
            "IDL-LRB-LB",  31, "Idle, local/remote M block, local HW blk",
            "IDL-NB-RB",   44, "Idle, remote HW block",
            "IDL-LB-RB",   45, "Idle, local M block, remote HW block",
            "IDL-RB-RB",   46, "Idle, remote M & HW block",
            "IDL-LRB-RB",  47, "Idle, local/remote M block, remote HW blk",
            "IDL-NB-LRB",  60, "Idle, local/remote HW block",
            "IDL-LB-LRB",  61, "Idle, local M block, local/remote HW blk",
            "IDL-RB-LRB",  62, "Idle, remote M block, local/remote HW blk",
            "IDL-LRB-LRB", 63, "Idle, local/remote M & HW block",
            NULL);
    };

    Codec_CSI   ::Codec_CSI   (const Codec_CSI   & original) :
        ParameterR((ParameterR&)original) {
        CSTATE = new Set(*original.CSTATE);
    };

    Codec_CSI*
    Codec_CSI   ::copy() {
        return new Codec_CSI(*this);
    };

    Codec_ACL   ::Codec_ACL   () :
        Parameter("ACL","Automatic Cong Level",8,1,0,(Codec**)&ACL) {
        ACL = new Set("ACL","Automatic Congestion Level",8,0,
            "1",    1,  "Congestion level 1 exceeded",
            "2",    2,  "Congestion level 2 exceeded",
            NULL);
    };

    Codec_OCDN  ::Codec_OCDN  () :
        Parameter("OCDN","Original Called Number",-1,7,0,(Codec**)&NAI) {
        NAI   = new Codec_NAI();
        OE    = new Codec_OE();
        SCR   = new Codec_SPAR2();
        PRES  = new Codec_PRES();
        NPLAN = new Codec_NPLAN();
        INN   = new Codec_SPAR1();
        ADDI  = new Codec_ADDI();
    };

    Codec_OBCI  ::Codec_OBCI  () :
        Parameter("OBCI","Opt Backward Call Inds",8,4,0,(Codec**)&IBI) {
        IBI = new Set("IBI","Inband Information",1,0,
            "NO",   0,  "No indication",
            "YES",  1,  "Inband info/pattern now avail",
            NULL);
        CFMO = new Set("CFMO","Call Forwarding Ind",1,0,
            "NO",   0,  "No indication",
            "YES",  1,  "Call forwarding may occur",
            NULL);
        SPARE = new Codec_SPAR5();
        USRNET = new Set("USR/NET","User-network interaction",1,0,
            "NO",   0,  "No indication",
            "YES",  1,  "User-network interaction",
            NULL);
    };

    Codec_GENADR::Codec_GENADR() :
        Parameter("GENADR","Generic Address",-1,8,0,(Codec**)&TYPADR) {
        TYPADR = new Set("TYPADR","Type of Address",8,0,
            "DIAL", 0,  "Dialed number",
            "DEST", 1,  "Destination number",
            "SUPF", 2,  "Suppl calling addr -screen failed",
            "SUP",  3,  "Suppl calling addr -not screened",
            NULL);
        NAI   = new Codec_NAI();
        OE    = new Codec_OE();
        SCR   = new Codec_SPAR2();
        PRES  = new Codec_PRES();
        NPLAN = new Codec_NPLAN();
        INN   = new Codec_SPAR1();
        ADDI  = new Codec_ADDI();
    };

    Codec_GENDIG::Codec_GENDIG() :
        Parameter("GENDIG","Generic Digits",-1,3,0,(Codec**)&TYPDIG) {
        TYPDIG = new Set("TYPDIG","Type of Digits",5,0,
            "AC",   0,  "Account code",
            "ATH",  1,  "Authorization code",
            "PRIV", 2,  "Private network traveling classmark",
            NULL);
        GENES = new Set("GENES","Gen Encoding Scheme",3,0,
            "EVEN", 0,  "BCD even",
            "ODD",  1,  "BCD odd",
            "IA5",  2,  "IA5",
            NULL);
        ADDI  = new Codec_ADDI();
    };

    Codec_EGRESS::Codec_EGRESS() :
        Parameter("EGRESS","Egress",-1,1,0,(Codec**)&DATA) {
        DATA = new OctetString("DATA","Data",-1);
    };

    Codec_JUR   ::Codec_JUR   () :
        Parameter("JUR","Jurisdiction",-1,1,0,(Codec**)&ADDI) {
        ADDI = new Codec_ADDI();
    };

    Codec_CIDC  ::Codec_CIDC  () :
        Parameter("CIDC","Carrier Id Code",-1,3,0,(Codec**)&NETPLAN) {
        NETPLAN = new Codec_NETPLAN();
        NETTYPE = new Codec_NETTYPE();
        ADDI    = new Codec_ADDI();
    };

    Codec_BGROUP::Codec_BGROUP() :
        Parameter("BGROUP","Business Group",32,9,0,(Codec**)&PSEL) {
        PSEL = new Set("PSEL","Party Selector",4,0,
            "NI",   0,  "No indication",
            "CGPN", 1,  "Calling party number",
            "CDPN", 2,  "Called party number",
            "CONN", 3,  "Connected number",
            "RDGN", 4,  "Redirecting number",
            "OCDN", 5,  "Original called number",
            NULL);
        LPII = new Field("LPII","Line Privileges",1,0);
        BGIDT = new Set("BGIDT","Business Group ID Type",1,0,
            "MBG",  0,  "Multi-location",
            "IWPN", 1,  "Private network interworking",
            NULL);
        AS = new Set("AS","Attendant Station",1,0,
            "NI",   0,  "No indication",
            "LINE", 1,  "Attendant line",
            NULL);
        SPARE = new Codec_SPAR1();
        BGID = new Field("BGID","Business Group ID Type",8,0);
        SUBID = new Field("SUBID","Sub-Group ID",8,0);
        TBGLP = new Set("TBGLP","Term Line Priviledge",4,0,
            "UNR",  0,  "Unrestricted",
            "SEMI", 1,  "Semi-restricted",
            "FULL", 2,  "Fully restricted",
            "FULLI",3,  "Fully intraswitch restricted",
            "DEN",  4,  "Denied",
            NULL);
        OBGLP = new Set("OBGLP","Orig Line Priviledge",4,0,
            "UNR",  0,  "Unrestricted",
            "SEMI", 1,  "Semi-restricted",
            "FULL", 2,  "Fully restricted",
            "FULLI",3,  "Fully intraswitch restricted",
            "DEN",  4,  "Denied",
            NULL);
    };

    Codec_NOTI  ::Codec_NOTI  () :
        Parameter("NOTI","Notification Ind",8,1,0,(Codec**)&NOT) {
        NOT = new Set("NOT","Notification Ind",7,1,
            "CW",   96,  "Call waiting",
            "RH",   249, "Remote hold",
            "RHR",  250, "Remote hold released",
            "CF",   251, "Call forwarding",
            NULL);
    };

    Codec_SVACT ::Codec_SVACT () :
        Parameter("SVACT","Service Activation",8,1,0,(Codec**)&SVACT) {
        SVACT = new Set("SVACT","Service Activation",8,0,
            "CWOT", 124,    "Call waiting originating invoked",
            "DCWI", 125,    "Dial call waiting invoked",
            "CRI",  126,    "Complete call request, ISUP used",
            "CRNI", 127,    "Complete call request, ISUP not used",
            NULL);
    };

    Codec_TRNSRQ::Codec_TRNSRQ() :
        Parameter("TRNSRQ","Transaction Request",-1,2,0,(Codec**)&TRANSID) {
        TRANSID = new Field("TRANSID","Transaction ID",32,0);
        CPA = new Codec_CPA("CPA","Call Party Address");
    };

    Codec_SPR   ::Codec_SPR   () :
        Parameter("SPR","Special Processing Req",8,1,0,(Codec**)&SPR) {
        SPR = new Set("SPR","Special Processing Req",8,0,
            "SPR",  127,    "SSP Processing required",
            NULL);
    };

    Codec_CGCI  ::Codec_CGCI  () :
        Parameter("CGCI","Cct Grp Char Inds",8,4,0,(Codec**)&CGTYP) {
        CGTYP = new Set("CGTYP","Carrier Type",2,0,
            "UNK",  0,  "Unknown",
            "ANG",  1,  "Analog",
            "DIG",  2,  "Digital",
            "BOTH", 3,  "Digital and analog",
            NULL);
        DSC = new Set("DSC","Double Seizing Control",2,0,
            "UNK",  0,  "Unknown",
            "ODD",  1,  "Odd CIC control",
            "EVEN", 2,  "Even CIC control",
            NULL);
        ACI = new Set("ACI","Alarm Carrier Type",2,0,
            "UNK",  0,  "Unknown",
            "SW",   1,  "Software handled",
            "HW",   2,  "Hardware handled",
            NULL);
        CCRI = new Set("CCRI","Continuity Checks",2,0,
            "UNK",  0,  "Unknown",
            "NONE", 1,  "Not required",
            "STAT", 2,  "Required statistically",
            "PC",   3,  "Required per call",
            NULL);
    };

    Codec_CVRI  ::Codec_CVRI  () :
        Parameter("CVRI","Cct Val Response Ind",8,1,0,(Codec**)&CVRI) {
        CVRI = new Set("CVRI","Cct Valid Resp Ind",8,0,
            "SUC",  0,  "Successful",
            "FAIL", 1,  "Failure",
            NULL);
    };

    Codec_OTGN  ::Codec_OTGN  () :
        Parameter("OTGN","O/G Trunk Group Number",-1,1,0,(Codec**)&ADDI) {
        ADDI = new Codec_ADDI();
    };

    Codec_CIN   ::Codec_CIN   () :
        Parameter("CIN","Circuit Id Name",26*8,1,0,(Codec**)&CIN) {
        CIN = new AsciiString("CIN","Circuit Name",26*8);
    };

    Codec_CLLI  ::Codec_CLLI  () :
        Parameter("CLLI","Common Lang Loc Id",11*8,1,0,(Codec**)&CLLI) {
        CLLI = new AsciiString("CLLI","Common Lang Loc Id",11*8);
    };

    Codec_OLI   ::Codec_OLI   () :
        Parameter("OLI","Originating Line Info",8,1,0,(Codec**)&OLI) {
        OLI = new Set("OLI","Originating Line Info",8,0,
            "ANI",  0,  "Identified line, no spec treatment",
            "ONI",  1,  "ONI (multiparty)",
            "ANIF", 2,  "ANI failure",
            "H",    6,  "Hotel with room ID",
            "CL",   7,  "Coinless, hospital, etc",
            "IR",   8,  "InterLATA restricted",
            "TC1",  10, "Test call (1)",
            "AIOD", 20, "AIOD - listed DN sent",
            "IL",   23, "Coin or non-coin identified line",
            "800",  24, "800 call",
            "COIN", 27, "Coin line",
            "IRH",  68, "InterLATA restricted-hotel",
            "TC2",  95, "Test call (2)",
            NULL);
    };

    Codec_CHGN  ::Codec_CHGN  () :
        Parameter("CHGN","Charge Number",16,7,0,(Codec**)&NAI) {
        NAI   = new Codec_NAI();
        OE    = new Codec_OE();
        SCR   = new Codec_SPAR2();
        PRES  = new Codec_SPAR2();
        NPLAN = new Codec_NPLAN();
        INN   = new Codec_SPAR1();
        ADDI  = new Codec_ADDI();
    };

    Codec_SVCD  ::Codec_SVCD  () :
        Parameter("SVCD","Service Code Indicator",8,1,0,(Codec**)&SVCD) {
        SVCD = new Field("SVCD","Service Code",8,0);
    };

    Codec_CSEL  ::Codec_CSEL  () :
        Parameter("CSEL","Carrier Selection Info",8,1,0,(Codec**)&CSEL) {
        CSEL = new Set("CSEL","Selected Carrier ID",8,0,
            "NI",   0,  "No indication",
            "PNI",  1,  "Presubscribed and not input",
            "PI",   2,  "Presubscribed and input",
            "P",    3,  "Presubscribed, no input indication",
            "NPI",  4,  "Not presubscribed and input",
            NULL);
    };

    // ***********************************************************
    // ****
    // **** Variable length mandatory parameters
    // ****
    // ***********************************************************

    Codec_CDPN_M::Codec_CDPN_M() :
        ParameterPL("CDPN","Called Party Number",-1,3,0,(Codec**)&PTR) {
        PTR = new Field("PTR","Parameter Pointer",8,0);
        LEN = new Field("LEN","Parameter Length",8,0);
        CDPN = new Codec_CDPN();
    };

    Codec_CAUS_M::Codec_CAUS_M() :
        ParameterPL("CAUS","Cause Indicators",-1,3,0,(Codec**)&PTR) {
        PTR = new Field("PTR","Parameter Pointer",8,0);
        LEN = new Field("LEN","Parameter Length",8,0);
        CAUS = new Codec_CAUS();
    };

    Codec_RnS_M ::Codec_RnS_M () :
        ParameterPL("R&S","Range and Status",-1,3,0,(Codec**)&PTR) {
        PTR = new Field("PTR","Parameter Pointer",8,0);
        LEN = new Field("LEN","Parameter Length",8,0);
        RnS = new Codec_RnS();
    };

    Codec_USI_M ::Codec_USI_M () :
        ParameterPL("USI","User Service Info",-1,3,0,(Codec**)&PTR) {
        PTR = new Field("PTR","Parameter Pointer",8,0);
        LEN = new Field("LEN","Parameter Length",8,0);
        USI = new Codec_USI();
    };

    Codec_CSI_M ::Codec_CSI_M () :
        ParameterPL("CSI","Circuit State Info",-1,3,0,(Codec**)&PTR) {
        PTR = new Field("PTR","Parameter Pointer",8,0);
        LEN = new Field("LEN","Parameter Length",8,0);
        CSI = new Codec_CSI();
    };

    // ***********************************************************
    // ****
    // **** Optional Parameter List
    // ****
    // ***********************************************************

    Codec_IOPARM::Codec_IOPARM(char* l,char* t,Codec** a) :
        ParameterNL(l,t,8,3,0,(Codec**)&PNAM) {
        PNAM   = (Field*)a[0];
        PL     = (Field*)a[1];
        PNAM_B = (Bra*  )a[2];
    };

    Codec_IOPARM::Codec_IOPARM(const Codec_IOPARM& original) :
        ParameterNL((ParameterNL&)original) {
        PNAM   = new Field(*original.PNAM   );
        PL     = new Field(*original.PL     );
        PNAM_B = new Bra  (*original.PNAM_B );
        PNAM_B-&gt;branch = PNAM;
        content = (Codec**)&PNAM;
    };

    Codec_IOPARM*
    Codec_IOPARM::copy() {
        return new Codec_IOPARM(*this);
    };

    Codec_IOPARMS::Codec_IOPARMS(char* l,char* t) :
        ParameterP(l,t,8,2,54,(Codec**)&PTR) {

        PTR    = new Field("PTR","Parameter Pointer",8,0);

        CLRF   = new Codec_CLRF  ();
        ATP    = new Codec_ATP   ();
        CDPN   = new Codec_CDPN  ();
        NCI    = new Codec_NCI   ();
        FCI    = new Codec_FCI   ();
        OFCI   = new Codec_OFCI  ();
        CPC    = new Codec_CPC   ();
        CGPN   = new Codec_CGPN  ();
        RDGN   = new Codec_RDGN  ();
        RDNN   = new Codec_RDNN  ();
        CONR   = new Codec_CONR  ();
        INRI   = new Codec_INRI  ();
        INFI   = new Codec_INFI  ();
        COTI   = new Codec_COTI  ();
        BCI    = new Codec_BCI   ();
        CAUS   = new Codec_CAUS  ();
        RDI    = new Codec_RDI   ();
        CGI    = new Codec_CGI   ();
        RnS    = new Codec_RnS   ();
        FACI   = new Codec_FACI  ();
        FAII   = new Codec_FAII  ();
        CUGI   = new Codec_CUGI  ();
        INDEX  = new Codec_INDEX ();
        USI    = new Codec_USI   ();
        ISPC   = new Codec_ISPC  ();
        UUI    = new Codec_UUI   ();
        CONN   = new Codec_CONN  ();
        SRIS   = new Codec_SRIS  ();
        TNS    = new Codec_TNS   ();
        EVNT   = new Codec_EVNT  ();
        CSI    = new Codec_CSI   ();
        ACL    = new Codec_ACL   ();
        OCDN   = new Codec_OCDN  ();
        OBCI   = new Codec_OBCI  ();
        GENADR = new Codec_GENADR();
        GENDIG = new Codec_GENDIG();
        EGRESS = new Codec_EGRESS();
        JUR    = new Codec_JUR   ();
        CIDC   = new Codec_CIDC  ();
        BGROUP = new Codec_BGROUP();
        NOTI   = new Codec_NOTI  ();
        SVACT  = new Codec_SVACT ();
        TRNSRQ = new Codec_TRNSRQ();
        SPR    = new Codec_SPR   ();
        CGCI   = new Codec_CGCI  ();
        CVRI   = new Codec_CVRI  ();
        OTGN   = new Codec_OTGN  ();
        CIN    = new Codec_CIN   ();
        CLLI   = new Codec_CLLI  ();
        OLI    = new Codec_OLI   ();
        CHGN   = new Codec_CHGN  ();
        SVCD   = new Codec_SVCD  ();
        CSEL   = new Codec_CSEL  ();
        UREC   = new Codec_UREC  ("UREC"  ,"Unrecognized Parameter");

        PNAM   = new Field("PNAM","Parameter Name",8,0);
        PL     = new Field("PL","Parameter Length",8,0);
        PNAM_B = new Bra("OPARM:","OPARM Branch",(Codec*)PNAM,
            CLRF  ,  1,
            ATP   ,  3,
            CDPN  ,  4,
            NCI   ,  6,
            FCI   ,  7,
            OFCI  ,  8,
            CPC   ,  9,
            CGPN  , 10,
            RDGN  , 11,
            RDNN  , 12,
            CONR  , 13,
            INRI  , 14,
            INFI  , 15,
            COTI  , 16,
            BCI   , 17,
            CAUS  , 18,
            RDI   , 19,
            CGI   , 21,
            RnS   , 22,
            FACI  , 24,
            FAII  , 25,
            CUGI  , 26,
            INDEX , 27,
            USI   , 29,
            ISPC  , 30,
            UUI   , 32,
            CONN  , 33,
            SRIS  , 34,
            TNS   , 35,
            EVNT  , 36,
            CSI   , 38,
            ACL   , 39,
            OCDN  , 40,
            OBCI  , 41,
            GENADR,192,
            GENDIG,193,
            EGRESS,195,
            JUR   ,196,
            CIDC  ,197,
            BGROUP,198,
            NOTI  ,225,
            SVACT ,226,
            TRNSRQ,227,
            SPR   ,228,
            CGCI  ,229,
            CVRI  ,230,
            OTGN  ,231,
            CIN   ,232,
            CLLI  ,233,
            OLI   ,234,
            CHGN  ,235,
            SVCD  ,236,
            SPR   ,237,
            CSEL  ,238,
            UREC  , -1,
        NULL);

        OPARM = new Codec_IOPARM("OPARM","Optional Parameter",(Codec**)&PNAM);
    };

    // ***********************************************************
    // ****
    // **** ISUP Messages
    // ****
    // ***********************************************************

    Codec_ISUP::Codec_ISUP() :
        Header("ISUP","ISDN User Part",-1,3,61,(Codec**)&CIC) {

        // ***********************************************************
        // ****
        // **** Mandatory Parameters
        // ****
        // ***********************************************************

        CDPN   = new Codec_CDPN_M();
        NCI    = new Codec_NCI   ();
        FCI    = new Codec_FCI   ();
        CPC    = new Codec_CPC   ();
        INRI   = new Codec_INRI  ();
        INFI   = new Codec_INFI  ();
        COTI   = new Codec_COTI  ();
        BCI    = new Codec_BCI   ();
        CAUS   = new Codec_CAUS_M();
        CGI    = new Codec_CGI   ();
        RnS    = new Codec_RnS_M ();
        FACI   = new Codec_FACI  ();
        FAII   = new Codec_FAII  ();
        USI    = new Codec_USI_M ();
        SRIS   = new Codec_SRIS  ();
        EVNT   = new Codec_EVNT  ();
        CSI    = new Codec_CSI_M ();
        CGCI   = new Codec_CGCI  ();
        CVRI   = new Codec_CVRI  ();

        OPARMS = new Codec_IOPARMS("OPARMS","Optional Parameters");

        // ***********************************************************
        // ****
        // **** Messages
        // ****
        // ***********************************************************

        IAM  = new ParameterG("IAM",  "Initial Address",        NCI,FCI,CPC,USI,CDPN,OPARMS,NULL);
        INR  = new ParameterG("INR",  "Information Request",    INRI,OPARMS,NULL);
        INF  = new ParameterG("INF",  "Information",            INFI,OPARMS,NULL);
        COT  = new ParameterG("COT",  "Continuity",             COTI,NULL);
        ACM  = new ParameterG("ACM",  "Address Complete",       BCI,OPARMS,NULL);
        FOT  = new ParameterG("FOT",  "Forward Transfer",       OPARMS,NULL);
        ANM  = new ParameterG("ANM",  "Answer",                 OPARMS,NULL);
        REL  = new ParameterG("REL",  "Release",                CAUS,OPARMS,NULL);
        SUS  = new ParameterG("SUS",  "Suspend",                SRIS,OPARMS,NULL);
        RES  = new ParameterG("RES",  "Resume",                 SRIS,OPARMS,NULL);
        RLC  = new ParameterG("RLC",  "Release Complete",       NULL);
        CCR  = new ParameterG("CCR",  "Continuity Check Req",   NULL);
        RSC  = new ParameterG("RSC",  "Reset Circuit",          NULL);
        BLO  = new ParameterG("BLO",  "Blocking",               NULL);
        UBL  = new ParameterG("UBL",  "Unblocking",             NULL);
        BLA  = new ParameterG("BLA",  "Blocking Ack",           NULL);
        UBA  = new ParameterG("UBA",  "Unblocking Ack",         NULL);
        GRS  = new ParameterG("GRS",  "Circuit Grp Reset",      RnS,NULL);
        CGB  = new ParameterG("CGB",  "Circuit Grp Blocking",   CGI,RnS,NULL);
        CGU  = new ParameterG("CGU",  "Circuit Grp Unblocking", CGI,RnS,NULL);
        CGBA = new ParameterG("CGBA", "C'ct Grp Blocking Ack",  CGI,RnS,NULL);
        CGUA = new ParameterG("CGUA", "C'ct Grp Unblockng Ack", CGI,RnS,NULL);
        FAR  = new ParameterG("FAR",  "Facility Request",       OPARMS,NULL);
        FAA  = new ParameterG("FAA",  "Facility Accepted",      OPARMS,NULL);
        FRJ  = new ParameterG("FRJ",  "Facility Reject",        FACI,CAUS,OPARMS,NULL);
        FAD  = new ParameterG("FAD",  "Facility Deactivated",   OPARMS,NULL);
        FAI  = new ParameterG("FAI",  "Facility Information",   FACI,FAII,OPARMS,NULL);
        LPA  = new ParameterG("LPA",  "Loop Back Ack",          NULL);
        PAM  = new ParameterG("PAM",  "Pass Along",             NULL);
        GRA  = new ParameterG("GRA",  "Circuit Grp Reset Ack",  CGI,RnS,NULL);
        CQM  = new ParameterG("CQM",  "Circuit Query",          CGI,RnS,NULL);
        CQR  = new ParameterG("CQR",  "Circuit Query Response", RnS,CSI,NULL);
        CPG  = new ParameterG("CPG",  "Call Progress",          EVNT,OPARMS,NULL);
        UCIC = new ParameterG("UCIC", "Unequipped Cct Id Code", NULL);
        CFN  = new ParameterG("CFN",  "Confusion",              CAUS,NULL);
        CRA  = new ParameterG("CRA",  "Circuit Reserv Ack",     NULL);
        CRM  = new ParameterG("CRM",  "Circuit Reservation",    NCI,NULL);
        CVR  = new ParameterG("CVR",  "C'ct Validation Resp",   CVRI,CGCI,OPARMS,NULL);
        CVT  = new ParameterG("CVT",  "C'ct Validation Test",   NULL);
        EXM  = new ParameterG("EXM",  "Exit",                   OPARMS,NULL);

        CIC = new Field("CIC","Circuit ID Code",14,2);

        MT = new Field("MT","Message Type",8,0);
        MT_B = new Bra("MT:","Messagey Type Branch",(Codec*)MT,
                IAM ,  1,
             // SBA ,  2,   // ITU92, not ANSI88 Subsequent Address
                INR ,  3,
                INF ,  4,
                COT ,  5,
                ACM ,  6,
             // CON ,  7,   // ITU92, not ANSI88 Connect
                FOT ,  8,
                ANM ,  9,
                REL , 12,
                SUS , 13,
                RES , 14,
                RLC , 16,
                CCR , 17,
                RSC , 18,
                BLO , 19,
                UBL , 20,
                BLA , 21,
                UBA , 22,
                GRS , 23,
                CGB , 24,
                CGU , 25,
                CGBA, 26,
                CGUA, 27,
                FAR , 31,
                FAA , 32,
                FRJ , 33,
                FAD , 34,   // ANSI88 only
                FAI , 35,   // ANSI88 only
                LPA , 36,   // ANSI88 : 34 for ITU92.
                PAM , 40,
                GRA , 41,
                CQM , 42,
                CQR , 43,
                CPG , 44,
                UCIC, 46,
                CFN , 47,
             // OVLD, 48,   // ITU92, not ANSI88 Overload
             // CHGI, 49,   // ITU92, not ANSI88 Charge Information
             // NRM , 50,   // ITU92, not ANSI88 Network Resource Management
             // FAC , 51,   // ITU92, not ANSI88 Facility
             // UPT , 52,   // ITU92, not ANSI88 User Part Test
             // UPA , 53,   // ITU92, not ANSI88 User Part Available
             // IDRQ, 54,   // ITU92, not ANSI88 Identification Request
             // IDRS, 55,   // ITU92, not ANSI88 Identification Response
             // SEGM, 56,   // ITU92, not ANSI88 Segmentation
                CRA ,233,   // ANSI88 only
                CRM ,234,   // ANSI88 only
                CVR ,235,   // ANSI88 only
                CVT ,236,   // ANSI88 only
                EXM ,237,   // ANSI88 only
            NULL);
    };

    #if 0
        Access delivery information
        Access transport
        Automatic congestion level
        Backward call indicators
        Call diversion information
    #endif

OpenSS7 | Brian F. G. Bidulock, © Copyright 2000, Brian F. G. Bidulock, All Rights Reserved. Last modified: $Date: 2000/10/04 03:52:24 $