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!

dialling using the connection directory 1

Status
Not open for further replies.

kazn

Programmer
Jul 17, 2003
5
GB
I need to write a script that logs into a group of pbx sites using the connection directory, opens a capture file capture some data, and close the capture file for each entry. So far I have managed to get the script to perform correctly for the 1st site, but on the 2nd entry the site is dialled but the commands are not transmitted.
I am new to aspect and would appreciate any help anyone could give. Here is what I have so far:

proc main
dial DATA GROUP "group name" CONNECTALL ; Dial entry.
while $DIALING ; Yield processing time while dialing.
yield
endwhile


when $CARRIER TRUE ; See if we're connected.

capture on
waitfor "?"
transmit "osl 111111111^m"
waitfor "?"
transmit "lct^m" ; get switch data.
waitfor "?"
hangup ; Hang up the phone line.

capture off

endwhen

endproc
 
I think I have this sorted now. I added a while 1 command after connecting.

However I have another problem, I am trying to set the capture file name to the connection directory name. I have used set capture CURRENT which works for the first connection but not subsequent ones, these are called pw01, pw02 etc.

Any clues much appreciated
Thanks
 
I use for loops and a switch when I want to dial into many things.

example:

string dialName

for i 0 upt0 1
switch i
case 0
dialName = "Whatever"
dial DATA GROUP dialName
endcase
case 1
dialName = "Whatever2"
dial DATA GROUP dialName
endcase
endswitch
next


To go where no programmer has gone before.
 
Thanks dbsquared the script is now dialling each entry in turn as required although your version is probably neater.

This is what I have so far the capture file name is still causing problems



proc main
dial DATA GROUP "group name" CONNECTALL ; Dial group entry.
while $DIALING ; Yield processing time while dialing.
yield
endwhile

while $CARRIER ; See if we're connected.
while 1

set capture file CURRENT
capture on

waitfor "?"
transmit "osl 111111111^m"
waitfor "?"
transmit "lct^m" ; get switch details.
waitfor "?"
hangup ; Hang up the phone line.

capture off

endwhile

endwhile

endproc



Thanks for your help
 
for your capture file you need to decalre the variable

string CURRENT="File.cap"

To go where no programmer has gone before.
 
Try removing the set capture file command. What I think is happening (didn't get much chance to test this) is you are setting the capture file to what is specified in Procomm rather than what is specified for each entry in the Connection Directory. When I ran your script with that line commented out, the various capture files associated with the Connection Directory entries were used.


aspect@aspectscripting.com
 
Here's where I am at now....having tried knob's and dbsquareds' suggestions

The script connects to the 1st entry, opens the capture, names it correctly and logs off. The 2nd entry is then dialled, at this point while the switch is still being dialled a capture file called pwxx.cap is opened, when the switch has connected another capture file is opened and named correctly. this happens for all the entries. I have tried setting capture autostart off at various places in the script, but that has had no effect.


;String szCurrentName
;String szFileName


proc main
dial DATA GROUP "group name" CONNECTALL ; Dial group entry.

while $DIALING ; Yield processing time while dialing.
yield
endwhile

while $CARRIER ; See if we're connected.
while 1
;fetch capture file szCurrentName
;szFileName = szCurrentName
;set capture file szFileName
capture on

waitfor "?"
transmit "osl xxxxxxxxx^m"
waitfor "?"
transmit "lct^m" ; get switch details.
waitfor "?"
hangup ; Hang up the phone line.

capture off

endwhile

endwhile
set capture autostart off
endproc



Thanks
 
I think the problem is you have your
while $DIALING ; Yield processing time while dialing.
yield
endwhile

outside your While 1 loop try this:

while $DIALING ; Yield processing time while dialing.
yield
endwhile


while $CARRIER ; See if we're connected.
while 1

while $DIALING ; Yield processing time while dialing.
yield
endwhile

;then the rest of your script

endwhile
endwhile



To go where no programmer has gone before.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top