Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

CS1000 Scripting question

CS1000 Scripting question

CS1000 Scripting question

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 ZocSend "yes^M"

CALL ZocSend "fdn 7000^M"

CALL ZocSend "hunt 7000^M"

CALL ZocSend "key 16 mwk 7000^M"

CALL ZocWait "KEY"
CALL ZocSend "^M"

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

REQ: stat 248 0 0 8
TYPE: 1230
TN 248 0 0 8
ECHG yes
ITEM fdn 7000
ITEM hunt 7000
ITEM key 16 mwk 7000

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.

RE: CS1000 Scripting question

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.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close