Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CS1000 Scripting question

Status
Not open for further replies.

SherWat

Technical User
Feb 12, 2016
216
CA
I am working on a script to change multiple parameters on sets on a CS100 PBX. I am learning REXX as I go.
I am able to create a script that does the changes but it doesn't care if the phone is busy or idle.
What command would be used to check the state of the phone, and if busy, don't do the change but end?
Code:
CALL ZocWaitForSeq "on"

CALL ZocSetLogfileName "c:\temp\changes.txt"

CALL ZocSend "ld 20^M"

CALL ZocWait "REQ:"
CALL ZocSend "stat 248 0 0 8^M"

CALL ZocWait "REQ:"
CALL ZocSend "CHG^M"

CALL ZocWait "TYPE:"
CALL ZocSend "1230^M"

CALL ZocWait "TN"
CALL ZocSend "248 0 0 8^M"

CALL ZocWait "ECHG"
CALL ZocSend "yes^M"

CALL ZocWait "ITEM"
CALL ZocSend "fdn 7000^M"

CALL ZocWait "ITEM"
CALL ZocSend "hunt 7000^M"

CALL ZocWait "ITEM"
CALL ZocSend "key 16 mwk 7000^M"

CALL ZocWait "KEY"
CALL ZocSend "^M"

CALL ZocWait "ITEM"
CALL ZocSend "^M"

CALL ZocWait "REQ:"
CALL ZocSend "****^M"

Running the above does the change and results in output that looks like this:
>ld 20

PT0000
REQ: stat 248 0 0 8
IDLE REGISTERED 00
REQ: CHG
TYPE: 1230
TN 248 0 0 8
ECHG yes
ITEM fdn 7000
ITEM hunt 7000
ITEM key 16 mwk 7000
KEY
ITEM


But how would I get the script to check if the IDLE RESISTERED line reads BUSY REGISTERED to then either wait 30 seconds and do the stat command again, or skip to the next record.

Thank you.
 
It is very hard to tell. What you have posted contains ONE Rexx keyyword - CALL repeated many times. The rest is some external program routines called ZOCxxxx. If you want to process the output from one of these routines then you need to show what that output looks like and what you want as a result.

I had a look at the CS1000 forum and found that you had posted there as well - bad manners in the world of forums. You get little from this forum because you do not, as noted above, provide the correct information. As a result of that incorrect/missing information one cannot provide any help because no one knows what you are having a problem with in regard to Rexx programming.


Nic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top