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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

busy state detect

Status
Not open for further replies.

Shawnzhang

Vendor
Sep 6, 2007
38
CN
i want a script which can detect busy status.
if the TN is busy, then skip to the next TN
if the Tn is idle, then do the change

can anybody help me?
 
The script also needs to make a note off all TN's it
found busy so you can run the script again against
these TN's.

Why not scedule the script to run at a time when all
TN's are idle, say at nightime?
 
By busy status, I assume you mean something other than a busy signal (I'm not familiar with the hardware you are discussing)? If so, you could use the waitfor or when target command to look for a particular response to indicate the busy status.

 
Maby this litle script can show one way to do it.
Code:
;Display a message for each busy TN.         

integer loop=11      ; Start at this loop.
integer unit, reply
string TEXTString
proc main
   while loop < 21   ; Stop at this loop.
     unit=0
     while unit < 16 ; from unit 0 to 15
       when target 0 "BUSY" call busyTN
       strfmt TEXTString "STAT %d %d^M" loop unit
       transmit TEXTString
       waitfor "REQ: "
       (unit++)
     endwhile
     (loop++)
   endwhile
endproc

proc busyTN
  strfmt TEXTString "Someone is using the phone on TN: %d %d" loop unit
  sdlgmsgbox "FYI" TEXTString INFORMATION OK reply
endproc
It cylces trough all units on some loops,
and displays a message when it finds a busy TN.

It should be possible to tweek this to your liking...

HTH :)
Geir
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top