# Switching shell: swish

Provides interactive or text-file-driven control of MVIP and H.100 switches through the SWI service, the PPX service, or directly using the device drivers.

#### Usage

swish [-i] [filename]

where:

-i specifies that the default initialization file, swish.ini, is ignored, and filename specifies an ASCII file that contains swish commands to be executed before any interactive commands are executed.

#### Description

swish is a tool for interactive or text-file-driven control of switches. swish provides a convenient way to manually test connections during development to verify the commands that will be given to switches from within Natural Access applications that use the SWI service.

#### Procedure

Use swish in interactive mode, text-file-driven mode, or in a combination of the two.

In interactive mode, enter swish commands at the swish command prompt to control the switches on the underlying hardware:

swish

In interactive mode, the command prompt swish: displays. Type help to get a list of commands and arguments that swish supports. You can also enter the name of a command without any arguments to get more information about the command.

In text-file-driven mode, provide swish with the name of the text file that holds the commands to be executed. If the text file does not have the exit command at the end, swish goes into interactive mode after executing the commands in the text file. Use the filename.swi naming convention for the input text file.

To run swish using input from a text file enter the following command at the prompt:

swish filename

In text-file-driven mode, swish executes the commands from the specified file name. The syntax of the commands in the file is the same as the syntax of the commands in interactive mode.

swish supports four kinds of commands:

- SWI service commands

- PPX service commands

- MVIP-90 driver commands (legacy support for older systems)

- MVIP-95 driver commands.

The PPX service commands use functions from the PPX service. The names of the commands are the same as the functions provided by the PPX service, and the arguments to the commands are also similar. Refer to the function reference section for more information about the PPX service functions.

The swish commands use prefixes that correspond to the related functions or device drivers, as shown in the following table:

Use this prefix... | To indicate...
--- | ---
swi | SWI service commands.
ppx | PPX service commands.
drv | MVIP-90 driver commands (retained for legacy systems).
d95 | MVIP-95 driver commands.

swish supports the following commands:

Command | Arguments | Description
--- | --- | ---
ppx.CreateConnection | ppxHd = CxName DefaultPattern | Creates an empty connection.
ppx.OpenConnection | ppxHd = CxName | Opens a previously created connection.
ppx.CloseConnection | ppxHd | Closes a connection.
ppx.CloseX | Switch Number | Closes handle to opened switch.
ppx.DestroyNamedConnection | ppxHd | Destroys a named connection.
ppx.SetTalker | ppxHd Talker | Sets the talker for a connection.
ppx.AddListeners | ppxHd ListenerList | Adds listeners to a connection.
ppx.RemoveListeners | ppxHd ListenerList | Removes listeners from a connection.
ppx.SetDefaultPattern | ppxHd pattern | Sets the default pattern for a connection.
ppx.Connect | TiList TO ToList [SIMPLEX | DUPLEX | QUAD] | Makes a connection.
ppx.Disconnect | ToList FROM TiList [SIMPLEX | DUPLEX | QUAD] | Disconnects a connection.
ppx.Begin |  | Starts collecting commands.
ppx.BeginCancel |  | Cancels a begin command.
ppx.ShowDB |  | Dumps the PPX runtime database to a text file.
ppx.Submit |  | Sends commands to server.

For more information about a specific command, type the name of the command and press Enter.

Refer to the Switching Service Developer's Reference Manual for more information on the swish utility.

#### Example

The following ppx.cfg file is used for this example:

[PPX]
Fabric
Bus H100
CTBUS:0..15:0..31
CTBUS:16..23:0..63
CTBUS:24..31:0..127
End Bus
Switch 0 ## AG 2000
SwitchType = HMIC
DeviceName = "agsw"
DeviceNumber = 0
Bus H100 (CTBUS:0..15:0..31)
Inputs
LOCAL:0..6(2):0..7
End Inputs
Outputs
LOCAL:1..7(2):0..7
End Outputs
End Switch
End Fabric
# This SWISH script connects the Line-interfaces on an AG 2000 board as
# listeners on a connection block to a DSP resource on the AG 2000 board
# which is playing a hold message (the talker).
# Create the connection block.
ppx.CreateConnection hd0 = "" 0
# Set the talker
ppx.SetTalker hd0 0:LOCAL:4:0
# Add the listeners - add the 8 incoming lines
ppx.AddListeners hd0 0:LOCAL:0:0..7
# A new message can be played to all the listeners by simply setting a
# new talker to the connection. The previous talker is disconnected.
ppx.SetTalker hd0 0:LOCAL:4:1
# Close the connection
ppx.CloseConnection hd0
quit