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?
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.
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.