Previous Topic: GETGROUP CommandNext Topic: GETSYSNAMES Command


GETSTATUS Command

The GETSTATUS command returns the current status of a voice channel.

This command has the following format:

ADDRESS VOX "GETSTATUS CHANNELNUM(channelnum)
  [SYSTEM(sysname)]
  [PREFIX(varname)]
  [CMDRESP(destination)]"
CHANNELNUM

A specific, physical channel number. Valid values range from 1 through the number of lines installed.

SYSTEM

(Optional) Specifies the name of the system that is running the notification server to which you want to direct the command.

The sysname value can contain up to eight alphanumeric characters.

Default: The local system name

PREFIX

(Optional) Specifies the name of the REXX stem variable (other than the default name) that contains the return information for the command.

For information about changing the default variable name, see ADDRESS VOX Return Information in this chapter.

Default: VOX.GETSTATUS

CMDRESP

(Optional) Directs return information to a specific destination (destination). For a list of valid destination values, see ADDRESS VOX Return Information in this chapter.

Default: REXX

Return Information:

After the GETSTATUS command executes, it sets the special REXX return code variable RC.

Channel Status

Meaning

BUSY

Busy

DIAL

Dialing a telephone number

GETDIG

Getting digits from the voice channel's digit buffer

IDLE

Idle (no I/O activity on the channel)

NOTINUSE

Channel not in use

PLAY

Playing a voice message

RECD

Recording a voice message

HOOK

Setting the hook state to either on-hook or off-hook

STOPD

The current operation is stopped, but the channel is not idle

WTEVT

Waiting for a specified event to occur

WTRNG

Waiting for rings

Example:

The following REXX code illustrates how to use the GETSTATUS command to determine the number of channels that are currently in use on a notification server:

/* Get a list of the local notification server's available channels. */

address vox 'getgroup group(all)'
parse var vox.getgroup.1 name interrupt numchannels 
channelsingroup
channelsinuse = 0

/* Check every channel to determine in-use status of each. */

do i = 1 to numchannels

/* Get the next channel number in the group */

parse var channelsingroup channelnumber channelsingroup

/* Check channel. */

address vox 'getstatus channelnum('channelnumber') prefix(status)'

/* Maintain a count of the number of in-use channels. */

if status <> "NOTINUSE" then channelsinuse = channelsinuse + 1
end