# Control MVIP switches: swish

Provides interactive or text-file-driven control of MVIP
switches through the Switching service or Point-to-Point Switching service, or by directly using the device drivers.

#### Usage

swish [options] [filename]

where options are:

Option | Use this option to specify the...
--- | ---
-s context_name | Name of a sharable context .
-i filename | Default initialization file, swish.ini, to ignore.
-@ server | Server host name or IP address. Default = localhost.

filename specifies an ASCII file containing swish commands to be executed before any interactive commands are executed.

#### Description

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

#### Procedure

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

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

In text-file-driven mode, you provide swish with the name of the file to read for the commands to run. 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.

Scripts that demonstrate swish command syntax for MVIP-related commands can be found in these directories:

Operating system | Directory
Windows | \nms\ctaccess\demos\swish
UNIX | opt/nms/ctaccess/demos/swish

To run swish interactively, enter the following command at the prompt:

swish

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

swish filename

In interactive mode, the command prompt swish: displays. Enter the help command 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, swish executes the commands from the specified file. 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:

- Switching service commands

- Point-to-Point Switching service commands

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

- MVIP-95 driver commands

The Switching service commands are the interface to the Switching service. The names of the commands are the same as the functions provided by the Switching service, and the arguments to the commands are also similar. Refer to the Function reference section for information about the Switching service functions.

The driver commands enable you to directly access the underlying driver by bypassing the Switching service. Some of the Switching service commands and the driver commands have the same names. swish uses the Switching service command by default.

To distinguish among the swish commands, refer to the following table:

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

The Switching service commands provided by swish take a switch handle
as an argument. This switch handle is opened by the OpenSwitch command. The driver commands take a driver handle as an argument and it is opened by the LoadDriver (Windows) or the OpenDevice (UNIX) command. The driver handle and the switch handle are not interchangeable: a switch handle cannot be used in a driver command and a driver handle cannot be used in a Switching service command.

The commands presented in the following table are supported by swish.

If you need help on a command, type the name of the command at the swish prompt and press Enter. The syntax and the options for the command are displayed.

Command | Arguments | Description
--- | --- | ---
swi.OpenSwitch | SwiHd = DLLname SwNo [RESTORE=...] [STD=...] | Opens a switch.
swi.CloseSwitch | SwiHd | Closes a switch.
swi.DisableOutput | SwiHd ToList | Disables outputs of switch.
swi.GetOutputState | SwiHd ToList | Displays connections.
swi.Caps | SwiHd | Displays switch capabilities.
swi.GetSwitchCaps | SwiHd | Displays switch capabilities.
swi.MakeConnection | SwiHd TiList TO ToList [SIMPLEX|DUPLEX|QUAD] | Connects inputs to outputs.
swi.MakeFramedConnection | SwiHd TiList TO ToList [SIMPLEX|DUPLEX|QUAD] | Connects inputs to outputs with identical throughput delay for all connections.
swi.ResetSwitch | SwiHd | Resets a switching block.
swi.SendPattern | SwiHd pattrn TO ToList | Sends a pattern.
swi.SampleInput | SwiHd TiList | Displays data memory.
swi.ConfigBoardClock | SwiHd TYPE=STD... SOURCE=MVIP... | Establishes the clock source for an MVIP board.
swi.ConfigBoardH100Clock | SwiHd TYPE=H100... SOURCE=INTERNAL... H100MODE=SLAVE... FALLBACK=ENABLE... NETREFSPEED=8KHZ... FALLBACKSOURCE=INTERNAL... | Establishes the clock source for an H.100/H.110 board.
swi.ConfigNetrefClock | SwiHd SOURCE=INTERNAL... NETREFMODE=NETREF_1... NETREFSPEED=8KHZ... | Defines the source of the NETREF clocks (H.100/H.110).
swi.QueryBoardClock | SwiHd TYPE=H100... | Returns board clocking configuration and clock status information.
swi.QueryTimingReference | SwiHd SOURCE=INTERNAL... | Returns status of potential TDM bus clock timing reference.
swi.EnableSwitch | SwiHd | Enables switch block.
swi.DisableSwitch | SwiHd | Disables switch block.
swi.ConfigStreamSpeed | SwiHd SPEED=... Streams | Configures stream speed.
swiGetStreamsBySpeed | SwiHd SPEED=... | Returns streams by speed.
swi.ConfigLocalStream | SwiHd | Configures device on a local stream.
swi.ConfigLocalStream | SwiHd | Configures device on a local stream.
swi.ConfigLocalTimeslot | SwiHd | Configures device on a local stream and timeslot.
swi.GetBoardInfo | SwiHd | Returns board information.
swi.GetDriverInfo | SwiHd | Returns driver information.
swi.GetLocalStreamInfo | SwiHd | Returns information about a device on a local stream.
swi.GetLocalTimeslotInfo | SwiHd | Returns information about a device on a local stream and timeslot.
swi.CallDriver | SwiHd command [arg1 ... argN] | Makes a direct call to the MVIP device driver.
swi.GetLastError | SwiHd | Returns the last MVIP device error.
swi.ConfigCarrier | SwiHd TrkNo [frame=D4...] [code=ZCS...] | Loads configuration data for a digital carrier (trunk).
swi.CarrierStatus | SwiHd TrkNo | Displays carrier status.
swi.QueryHybridIds | SwiHd STList | Retrieves the hybrid IDs.
d95.MakeConnection | DevHd TiList TO ToList [SIMPLEX|DUPLEX|QUAD] | Connects inputs to outputs.
d95.MakeFramedConnection | DevHd TiList TO ToList | Connects inputs to outputs with identical throughput delay for all connections.
d95.ResetSwitch | DevHd | Resets a switching block.
d95.SendPattern | DevHd pattrn TO SToList | Sends a pattern.
d95.DisableOutput | DevHd SToLst | Disables outputs of switches.
d95.SampleInput | DevHd STiLst | Displays data memory.
d95.WatchInput | DevHd STiLst | Monitors SToLst continuously.
d95.WatchOutputl | DevHd SToLst | Monitors SToLst continuously.
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.DestroyNamed Connection | 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 | (None) | Starts collecting commands.
ppx.BeginCancel | (None) | Cancels a begin command.
ppx.Submit | (None) | Sends commands to server.
ppx.ShowDB | (None) | Sends the contents of the database to a file.

Note: The d95 commands are applicable only to MVIP-95 drivers. All stream and timeslot values should be specified in MVIP-95 syntax.

For more information about the... | Refer to the...
--- | ---
swi functions | Specific function in the function reference.
d95 commands | MVIP-95 Device Driver Standard Manual
ppx functions | Point-to-Point Switching Service Developer's Reference Manual

#### Example

# This SWISH script connects the DSPs to the Line-interfaces on
# a fully populated AG 2000 board.
# Open the switch in MVIP-95 mode with switch state restoration disabled.
swi.OpenSwitch ag2000 = agsw 0 STD=MVIP95 RESTORE=DISABLE
# Reset the switch
swi.ResetSwitch ag2000
# Connect the DSPs to the Line-interfaces,
swi.MakeConnection ag2000 LOCAL:0:0..7 to LOCAL:5:0..7 QUAD
# The same command can be accomplished by typing the following set of commands:
swi.MakeConnection ag2000 LOCAL:0:0..7 to LOCAL:5:0..7
swi.MakeConnection ag2000 LOCAL:4:0..7 to LOCAL:1:0..7
swi.MakeConnection ag2000 LOCAL:2:0..7 to LOCAL:7:0..7
swi.MakeConnection ag2000 LOCAL:6:0..7 to LOCAL:3:0..7
# Close the switch. The connections remain because we opened the switch in
# restoration disabled.
swi.CloseSwitch ag2000
quit