# lapddemo overview

lapddemo establishes a data link and sends and receives Q.931 messages. It demonstrates how:

- An application accessing the stack at the LAPD interface can establish a data link on an ISDN trunk.

- To build raw Q.931 messages and send them to the trunk.

- To access the stack if duplicate NAI values are configured.

Messages built and sent with this demonstration program are based on standard Q.931 specifications (Blue Book) and may not be accepted or allowed in some switch variants.

#### Featured functions

isdnReleaseBuffer, isdnSendMessage, isdnStartProtocol, isdnStopProtocol

#### Requirements

- One or more digital trunk interface boards

- Natural Access

- nocc.tcp file

#### Usage

lapddemo [options]

where options are one or more of the following:

Option | Meaning | Defaults
--- | --- | ---
-b boardno | Number of the board to use. (Board numbers are specified in the board keyword file.) | 0
-n | lapddemo configured for the network terminator (NT) side. | Not specified. lapddemo is configured for terminal equipment (TE).
-a nai | Network access identifier (NAI). | None.
-g nfas_group | NFAS group number, for duplicate NAI values. | None.
-v verboselevel | Verbosity level. Valid values are: 0: Show no messages 1: Show SETUP messages only 2: Show all ISDN messages | 2
-f filename | Name of the configuration file to be read. This file describes the behavior of the program in terms of what Q.931 messages are sent or received. Specifications for outgoing calls are not given in the default configuration file. You must make additions to this file in order for the demonstration program to achieve the CONNECTED state for outbound calls. | lapddemo.cfg

#### Functional overview

When lapddemo is run, it performs the following tasks:

Task | Description
1 | It parses command-line arguments and makes sure all arguments are valid and do not conflict.
2 | It initializes Natural Access.
3 | It starts the ISDN protocol stack on the board specified on the command-line, either as terminal equipment (TE) or as network equipment (NT), with the specified network operator variant and country variant.
4 | It sends a SABME message on the trunk to establish the data link.
5 | If you type S, the program sends a SETUP message to the trunk. Otherwise, it waits for messages from the line.
6 | If a Q.931 message is received, the program decodes information from the message and responds with an appropriate message, specified in the configuration file. For example, after receiving a SETUP message, it may send an ALERTING message.