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

waitfor firing too early

Status
Not open for further replies.

joemudd

MIS
Jun 7, 2005
15
0
0
CA
Hi, I'm trying to write an Aspect script to print reports on available DNs and TNs (2000 and 500) on a Nortel PBX.

Here's the section of script in question:

transmit "LD 20^M"
waitfor "REQ: "
transmit "PRT^M"
waitfor "TYPE: "
transmit "LUDN^M"
waitfor "CUST "
transmit "^M"
waitfor "DN "
transmit "^M"
waitfor "REQ: "
transmit "LUVU^M"

Once all the DNs have finished printing, but *before* the next "REQ:" prompt appears, the "LUVU" transmit is executed. Since this happens before the "REQ:" prompt, the PBX doesn't receive the command and the script stops at the "REQ:" prompt waiting for a command that's already been sent. Here's a sample of the output:

6957 6966 6967 6970 6971 6974 6976 6980
6985 6986 6987 717 718 7190 7191 7192
7193 7194 7195 7196 7197 7198 79 81
82 83 86 87 LUVU

REQ:

I can get around this using waitquiet or pause commands in my script, but that's a hack and I'd rather solve this properly.

I can't make any sense of why this is happening. Any help is appreciated.

Thanks.
 
Waitfors will expire after 30 seconds if they are not matched, moving on to the next command. If this is what is happening in your case, you can specify a timeout value in seconds at the end of the waitfor command, or use the FOREVER flag to force the script to wait until the specified text has been received.


 
Awesome, that did the trick, thanks a lot!

But now I'm encountering another problem - I'm dialing by directory group and as soon as my script issues the hangup command the dialing dialog comes back up and tries the next site. But it picks up the line too soon and the previous site is still on the line.

Pause doesn't seem to help. Procomm just tries dialing as soon as it has hung up.

How can I delay this so that the line has some time to free up?

Thanks again.

(BTW, should I maybe repost this in a new thread?)
 
i like the waitfor "xxxx " forever for some of my scripts. and i use a set txpace 40, to slow the script down, it helps on some of my eq

john poole
bellsouth business
columbia,sc
 
Do you have a script attached to each Connection Directory entry, or is your script iterating through the list of entries and dialing each one? How long of a pause did you try after the disconnect or hangup command?


 
I'm using "dial DATA GROUP PBX CONNECTALL" to dial the list of entries (with a single script.)

I tried pause 5, but I could tell it wasn't pausing at all. It seems like as soon as the port is hung up, the next entry is dialed immediately.
 
proc main

string Input

sdlginput "Specify site" "'All' or site name (ex: 'Main PBX')" Input

if stricmp Input "All"
dial DATA GROUP "PBX" CONNECTALL
else
dial DATA Input
endif

while $DIALQUEUE
while $DIALING
yield
endwhile

if $CARRIER
pause 2
waitquiet 2 FOREVER
doReports()
endif
endwhile

endproc

proc doReports

logon()
getReports()
cleanUp()

endproc

proc cleanUp

transmit "LOGO^M"
waitfor ">"
waitquiet 2
hangup ; this is where the problem is -
; as soon as hangup is issued, the
; next entry is dialed, regardless
; of whether or not I have a pause

endproc

proc logon

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

endproc

proc getReports

; gets LD 20 LUDN/LUVU stuff here

endproc
 
i would do a pause 2, transmit'" after the hangup, do a get on a procedure that has a 10 sec delay and dials #, i've had a simular problem when getting lcnt tables and ldis from a group of networked switches. i did see a simular work around that did a transmit "at^M" waitquite 10, "at^M" waitfor "OK " it worked for that person. if you share that script i can help trouble shoot it, on the same type dial in's.. most scripts i have i do share, a couple i have are in progress and may be marketable..

john poole
bellsouth business
columbia,sc
 
I'm seeing some definite problems with that script, but haven't found a good workaround yet. I'll check with another ASPECT developer and see if he has run into this before.


 
I've fixed it. I used dialcount, dialname, dial, and a for loop. I can pause for a few seconds between iterations of the loop. There are some good examples in the Procomm Aspect documentation.

The script works great now :)

Thanks for all your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top