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!

dial Data Group " " CONNECTAL (how to run scripts on all connections?)

Status
Not open for further replies.

esoare

Programmer
Jun 15, 2005
199
US
Code:
proc main


call dialup

call login
call gethyst
call gettime
call gettid
call getphst
call getdnb
call gettnb




     transmit "****^M"
     transmit "LOGO^M"
     transmit "^M"
     waitfor "OVL111"
     beep
     
     disconnect
     pause 15
     
endproc


proc dialup 



dial DATA GROUP "Maintenance" CONNECTALL

pause 30

endproc

proc login
    
    transmit "****^M"
    transmit "LOGI "
    transmit $USERID
    transmit "^M"
    waitfor "PASS?"
    transmit $PASSWORD
    transmit "^M"
    waitfor ">" FOREVER

 
endproc     


proc gethyst

integer iDay, iMonth, iYear, iMin, iHour, iSec
string hystfname
string switchName
switchName = $DIALCONNECT
ltimeints $LTIME iYear iMonth iDay iHour iMin iSec
strfmt hystfname "%7.11s_History_%02d_%02d_%d_%d_%d.txt" switchName iMonth iDay iYear iHour iMin

  
     pwtitlebar switchName PERMANENT   ;Display switch name in title.
     beep
     set txpace 40
     
     
set capture file hystfname
 
capture on

endproc

ok. So, let's say the script is started with the windows scheduler.

The first site dialed is completely fine. All the code runs.

But the Script ends, though the "dial DATA GROUP" still goes on, like it is supposed to.

What command should I use, to not let the "proc main" "endproc" and also avoid the "call dialup" and be able to call all the rest of the scripts, to do their thing, until there is no more "entries" to dial, in the "dial group"?

I think that is a run on sentence. :)

Should I put some code behind the last "call" and say for it to jump to the beginning of the process?

Something with the loop while for? I am lost at this point.

I have gleaned alot from the access stuff here! And managed to piece meal this together. Hope the code that I wrote helps, others out.

ES
 
The problem is once you have made all the othr calls from your main proc, your script returns, performs the first logoff, then the main proc ends.
You need to set up some loops using WHILE statements.

Look into using WHILE $DIALING to loop and thus pause the script when you are dialing an entry. Place what you want run each time within a WHILE $CARRIER loop. And I just can't get my head around which command would detect when the whole connection directory is finished...

1 method that springs to my mind at the moment is shown below... This procedure has a call to itself (not possible to do within the main proc) and so you would place a call to this in your main procedure, then this script calls itself repeatedly each time it detects $Carrier, when it runs thru without detecting carrier, it would return to the main proc and thus the script ends.


proc myidea

dialok = 0 ;variable to check if dial was ok

WHILE $DIALING
;wait while dialing
ENDWHILE

WHILE $CARRIER
;PUT YOUR SCRIPT CMDS HERE FOR EACH DIAL ENTRY
dialok = 1
ENDWHILE

if dialok == 1
;we had carrier that time through
call myidea ;so go back and run this procedure again
else
;we did not have carrier, so dial connect all finished
endif

endproc
######################################
Hope that might help you sort it...
I noticed the script is for NORTEL equip...
Check out my webpage for some great NORTEL scripts.
######################################







 
And I just realised you've visited my page before...
I'm back at work in 24hrs, so I'll repost soemthing then (if you havent sorted it) when I have had a chance to test a modified version of your script on my PABX dialconnect entries.

 
I found a thread knob answered re: TELNET CONNECT ALL...
I made a few changes to suit your situation...
I hope this works...

proc main
integer iEntries ;Number of entries in dialing class
integer iCount ;Loop variable
string gName = "Maintenance" ;Name of DATA Group
string sName ;Name of Connection Directory entry

dialcount DATA GROUP gName iEntries ;Get number of entries in specified dialclass
for iCount = 0 upto (iEntries - 1)
dialname DATA GROUP gName iCount sName ;Get entry name corresponding to index number
statmsg sName
dial DATA GROUP gName sName ;Make DATA connection
while $DIALING ;Loop while making connection
yield
endwhile
if $CARRIER == 1 ;If connected
;do commands here
endif
endfor
endproc


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top