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

Procomm script for time sync

Status
Not open for further replies.

PhoneBear

Technical User
Oct 24, 2005
1
US
I have two scripts that can be run with Procomm. One logs into the PBX and the other syncs the time with the host computer recieving accurate time from an NTP server. Procomm allow only running one script at a time. I would like to combine the scripts into one and then by using the scheduling function have the pc log it the PBX automatically and then sync the time. Both scripts are .wax files.
 
you need to modify the was file, when you complile it, it creates the wax.. two ways, do a call procedure or just copy the body of the time into the main procedure..

Code:
proc main
   
 

   set txpace 30	
   transmit "****^M"
   waitfor ">"
   transmit "john^M"
   
   transmit "****^M"
   waitfor ">"
   transmit "logi bcsrmac^M"
   pause 6
   waitfor "PASS "
   transmit "xxxx^M"
   call myproc
   waitfor ">"
   
   
  
endproc
proc myproc   
integer iDay, iMonth, iYear, iMin, iHour, iSec
string sSend
  
   ltimeints $LTIME iYear iMonth iDay iHour iMin iSec
   
   strfmt sSend "STAD %02d %02d %d %02d %02d %02d" iDay iMonth iYear iHour iMin iSec
   set txpace 30
   transmit "****^M"
   waitfor ">"
   
   transmit "ld 2^M"
   waitfor "."
   
   transmit "TTAD^M"
   waitfor "."
   transmit sSend
   transmit "^M"
   waitfor "."
   
   pause 2
   transmit "TTAD^M"
  
   pause 2
   transmit "****^M"
 
  endproc

   
  [/quote]

change the xxxx to your password, leave the ^M in place, that is a carrige return.. this script takes the time from your pc, if ran while your logged in, it logs you out and back in.. 

john poole
bellsouth business
columbia,sc
 
I'm going to be really anal here and say that it is better to rearrange some of the code so that you are 2 seconds closer to the correct time:

proc myproc
integer iDay, iMonth, iYear, iMin, iHour, iSec
string sSend

transmit "ld 2^M"
waitfor "."

transmit "TTAD^M"
waitfor "."

ltimeints $LTIME iYear iMonth iDay iHour iMin iSec

strfmt sSend "STAD %02d %02d %d %02d %02d %02d" iDay iMonth iYear iHour iMin iSec
set txpace 30

transmit sSend
transmit "^M"
waitfor "."

pause 1
transmit "TTAD^M"

pause 2
transmit "****^M"

endproc
 
your right, pretty anal, i don't use that one anymore. i've combined it with another that does the logi sets the time, does an edd scpu and edd.. just my way of being sure that both disk match at 7:00:01 every day... i've got anal covered.. thanks

john poole
bellsouth business
columbia,sc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top