(Page 1 of 1 in this chapter) Version


Appendix C

ISUP Sample Application


Overview
Data Structures
Checkpoint Message Structure
Event Structure
Circuit Control Structure
Threads
Events
ISUP to Circuit
Circuit to Circuit
UDP to Circuit
UDP to ISUP
HMI to ISUP
Program Operation
Program Startup
Primary Startup
Backup Startup
Normal Incoming Call
Incoming Test Call
Outgoing Test Call
Running the isupdemo Program
Command Line Options
User Interface Commands

Overview

The ISUP sample application, isupdemo, is a multi-threaded program utilizing the redundancy features of the NMS ISUP layer and NMS HM API. It is a skeletal implementation of a toll switch with a simple user interface for placing and receiving test calls and managing circuits.

Data Structures

The following sections describe data structures that are called by the isupdemo application.

Checkpoint Message Structure

The checkpoint message structure, ChkPntMsg, is used to transfer circuit state information from the primary application to the backup application.

typedef struct checkPointMsg
{
    U32     msgId;
    CirId   cirId;        /* circuit ID of indicated circuit */
    CirId   mateId;       /* circuit ID of mate circuit      */
    U8      transient;    /* transient state indicator       */
    U8      callState;    /* call processing state           */
    U8      blkState;     /* circuit blocking state          */
} ChkPntMsg;

Event Structure

The event structure, Event, is used to pass information between threads. This is done by passing a pointer to an event in the buffer member of a CTA_EVENT structure.

typedef struct
{
    IsupRcvInfoBlk  info;      /* ISUP receive information block     */
    SiAllSdus       sdu;       /* union of all ISUP event structures */
    ChkPntMsg       chkPntMsg; /* checkpoint message                 */
} Event;

Circuit Control Structure

The circuit control structure, Circuit, is used to maintain information required by the application in order to control a particular circuit.

typedef struct circuit
{
    short       state;     /* thread state                         */
    CTAQUEUEHD  ctaQueue;  /* CT Access queue for receiving events */
    CTAHD       ctaHndl;   /* CT Access handle for this thread     */
    CirId       cirId;     /* circuit ID of this circuit           */
    CirId       mateId;    /* circuit ID for mate circuit          */
    SuId        suId;      /* service user ID                      */
    SiInstId    suInstId;  /* service user instance ID             */
    SiInstId    spInstId;  /* service provider instance ID         */
    U8          callState; /* call processing state                */
    U8          blkState;  /* circuit blocking state               */
    U8          transient; /* transient state indicator            */
} Circuit;

Threads

The following threads comprise the isupdemo application:
Thread

Description

Main thread

The main thread parses command line arguments, initializes global data, and starts all other threads.

User thread

The user thread accepts input from the keyboard and parses the input. Depending upon the command entered by the user, this will result in either an event to a circuit thread or a call to the ISUP API.

Test thread

The test thread receives events regarding a test call from a circuit thread. This results in the printing of a message indicating the type of event that was received.

UDP thread

The UDP thread receives checkpoint messages from the mate application, which result in checkpoint events generated to circuit threads. It also receives the application ready message from the mate application, resulting in an application ready event sent to the ISUP thread.

HMI thread

The HMI thread receives CT Access events from the HM API and translates these events into internal events passed to the ISUP thread.

ISUP thread

The ISUP thread receives CT Access events from the ISUP API and translates these events into internal events routed to the appropriate incoming, outgoing, and test threads.

Incoming circuit thread

An incoming thread receives events from the ISUP thread, and exchanges events with its mate outgoing thread.

Outgoing circuit thread

An outgoing thread receives events from the ISUP thread, and exchanges events with its mate incoming thread.

Figure 18 illustrates the inter-thread communications in the ISUP demonstration application.

Figure 18. Inter-thread Communication in the isupdemo Application

Events

Threads use CT Access to pass events between themselves. The following sections describe the CT Access event ID values used to identify these events.

ISUP to Circuit

The following event ID values are used to pass information from the ISUP thread to circuit threads. They are also used to pass information from the user thread to circuit threads.
Event

Description

IAM_MSG

Initial address message has received for this circuit.

ACM_MSG

Address complete message has been received for this circuit.

ANM_MSG

Answer message has been received for this circuit.

REL_MSG

Release message has been received for this circuit.

RLC_MSG

Release complete message has been received for this circuit.

RSC_MSG

Reset message has been received for this circuit.

BLO_MSG

Blocking message has been received for this circuit.

BLA_MSG

Blocking acknowledgement message has been received for this circuit.

UBL_MSG

Unblocking message has been received for this circuit.

UBA_MSG

Unblocking acknowledgement message has been received for this circuit.

INF_MSG

Information message has been received for this circuit.

INR_MSG

Information request message has been received for this circuit.

CON_MSG

Connect message has been received for this circuit.

CPG_MSG

Call progress message has been received for this circuit.

SUS_MSG

Suspend message has been received for this circuit.

RES_MSG

Resume message has been received for this circuit.

SAM_MSG

Subsequent address message has been received for this circuit.

CGB_MSG

Circuit group blocking message has been received concerning this circuit.

CGU_MSG

Circuit group unblocking message has been received concerning this circuit.

IDLE_EVT

Circuit should immediately transition to the idle state with no ISUP interaction.

Circuit to Circuit

The following event ID values are used to pass information between circuit threads.
Event

Description

IAM_EVT

Initial address message has received for this circuit's mate.

ACM_EVT

Address complete message has been received for this circuit's mate.

ANM_EVT

Answer message has been received for this circuit's mate.

REL_EVT

Release message has been received for this circuit's mate.

RLC_EVT

Release complete message has been received for this circuit's mate.

RSC_EVT

Reset message has been received for this circuit's mate.

BLO_EVT

Blocking message has been received for this circuit's mate.

BLA_EVT

Blocking acknowledgement message has been received for this circuit's mate.

UBL_EVT

Unblocking message has been received for this circuit's mate.

UBA_EVT

Unblocking acknowledgement message has been received for this circuit's mate.

INF_EVT

Information message has been received for this circuit's mate.

INR_EVT

Information request message has been received for this circuit's mate.

CON_EVT

Connect message has been received for this circuit's mate.

CPG_EVT

Call progress message has been received for this circuit's mate.

SUS_EVT

Suspend message has been received for this circuit's mate.

RES_EVT

Resume message has been received for this circuit's mate.

SAM_EVT

Subsequent address message has been received for this circuit's mate.

CGB_EVT

Circuit group blocking message has been received concerning this circuit's mate.

CGU_EVT

Circuit group unblocking message has been received concerning this circuit's mate.

ERR_EVT

Error indication has been received for this circuit.

UDP to Circuit

This event ID value is used to pass information from the UDP thread to circuit threads.
Event

Description

CHKPNT_EVT

Indicates that a checkpoint message has been received concerning this circuit.

UDP to ISUP

This event ID value is used to pass information from the UDP thread and ISUP thread.
Event

Description

APPREADY_EVT

Indicates that a ready message has been received from the mate application.

HMI to ISUP

The following event ID values are used to pass information from the HMI thread to the ISUP thread:
Event

Description

DEAD_EVT

Indicates that a halted, dead, or loading event was received from the HM API.

STARTED_EVT

Indicates that a starting event was received from the HM API.

BACKUP_EVT

Indicates that a now backup event was received from the HM API.

PRIMARY_EVT

Indicates that a now primary event was received from the HM API.

STANDALONE_EVT

Indicates that a now standalone event was received from the HM API.

Program Operation

The following sections describe what occurs when isupdemo is run.

Program Startup

At startup, the main thread first parses the command line arguments, setting global variables based on the results of this parsing. Next, the user, test, HMI, UDP, and ISUP threads are started. Finally, the incoming and outgoing threads are started.

Primary Startup

Upon receipt of the HMI_EVN_NOWPRIMARY event from the HM API, the HMI thread issues an EVT_PRIMARY event to the ISUP thread. When the ISUP thread receives this event, it generates an application ready message to the mate application. When an application ready message is received, the primary application will initiate a batch checkpoint to the backup application.

Backup Startup

Upon receipt of the HMI_EVN_NOWBACKUP event from the HM API, the HMI thread issues an EVT_BACKUP event to the ISUP thread. When the ISUP thread receives this event, it generates an application ready message to the mate application. If an application ready message is received, the backup application will again send an application ready message to the primary application.

Normal Incoming Call

Figure 19 depicts a normal incoming call setup and release. Brackets ([]) indicate checkpoints, with the checkpointed data contained within the brackets in the form [<circuit state>, <transient state>].

Figure 19. Normal Incoming Call Setup and Release

Incoming Test Call

Figure 20 depicts an incoming test call setup and release. Text in braces ({}) indicate commands entered from the keyboard.

Figure 20. Incoming Test Call Setup and Release

Outgoing Test Call

Figure 21 depicts an outgoing test call setup and release. Text in braces ({}) indicate commands entered from the keyboard.

Figure 21. Outgoing Test Call Setup and Release

Running the isupdemo Program

The following sections provide commands/command line options used with the isupdemo application.

Command Line Options

The following command line options are accepted by the isupdemo application. Options may be entered in any order.
Command Line Option

Description

-b boardNum

Specifies the board to which this instance of the application will communicate.
Default: 1

-da address

Specifies the internet address of the mate application in dotted decimal format.
Default: loopback (127.0.0.1)

-dn name

Specifies the name of the host on which the mate application is running.
Default: none

-dp port

Specifies the UDP port number of the mate application.
Default: 4096

-lp port

Specifies the UDP port for this application instance.
Default: 4096

-n numCir

Specifies the number of incoming and outgoing circuits.
Default: 64 (64 incoming circuits, 64 outgoing circuits)

-ni numIn

Specifies the number of incoming circuits.
Default: 64

-no numOut

Specifies the number of incoming circuits.
Default: 64

Note: Incoming circuit are created first, starting with a circuit ID of one. Outgoing circuits are then created starting with circuit ID equal to the last incoming circuit ID plus one.

-s switchType

Specifies the ISUP switch type (ANSI88, ANSI92, ANSI95, ITUBLUE, ITUWHITE, Q767, or JNTT).
Default: ANSI92

-te

Enables event tracing.

-tc

Enables checkpoint tracing.

-ta

Enables all tracing.

User Interface Commands

The following commands are available for managing circuits and placing and receiving test calls. Test calls may only be received on incoming circuits and placed on outgoing circuits.
Command

Syntax

Description

QUIT

QUIT

Exits application.

ACM

ACM <circuit>
where circuit is the circuit ID of an incoming circuit.

Sends an address complete message.

ANM

ANM <circuit>
where circuit is the circuit ID of an incoming circuit.

Sends an answer message.

BLO

BLO <circuit>
where circuit is the circuit ID of the circuit to be blocked.

Sends a blocking message.

CGB

CGB <circuit> <range>
where circuit is the circuit ID of the first circuit in the group to be blocked, and range is the desired range value

Sends a circuit group blocking message.

CGU

CGU <circuit> <range>
where circuit is the circuit ID of the first circuit in the group to be unblocked, and range is the desired range value.

Sends a circuit group unblocking message.

CON

CON <circuit>
where circuit is the circuit ID of an incoming circuit

Sends a connect message.

GRS

GRS <circuit> <range>
where circuit is the circuit ID of the first circuit in the group to be reset, and range is the desired range value.

Sends a circuit group reset message.

IAM

IAM <circuit> <called> [<calling>]
where circuit is the circuit ID of an outgoing circuit, called is the called party number, and calling is the optional calling party number

Sends an initial address message.

REL

REL <circuit> [<cause>]
where circuit is the circuit ID of the circuit to be released, and cause is an optional cause value.

Sends a release message.

RSC

RSC <circuit>
where circuit is the circuit ID of the circuit to be reset.

Sends a circuit reset message.

UBL

UBL <circuit>
where circuit is the circuit ID of the circuit to be unblocked.

Sends an unblocking message.



(Page 1 of 1 in this chapter) Version


tech_support@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights reserved.