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

Capturing info from ProComm Screen

Status
Not open for further replies.

MyFlight

Technical User
Feb 4, 2002
193
I hope that someone can point me in the right direction.
I am trying to access a ROLM voicemail system and capture header information.
I need to capture the following information to string values for later (MULTIPLE) uses:
Site Name (From Dialing Directory)
Company Name (From DIaling Directory)
PhoneMial Version (From Screen) "ROLM PhoneMail Version 6.3"
PhoneMail Site ID (From Screen) "ROLM PhoneMail Site Id: XXXXX37816"
PhoneMail Release (From Screen) " PhoneMail release 6.3.3.1"

for SINGLE NODE SYSTEMS

Current Node Number (From Screen) "PhoneMail is active with 16 Channels" No Node info is shown on One Node Systems
Total Number of Nodes (From Screen) "PhoneMail is active with 16 Channels" No Node info is shown on One Node Systems
Number of Channels (From Screen) "PhoneMail is active with 16 Channels" 16 is the Number I NEED

for MULTI NODE SYSTEMS

Current Node Number (From Screen) "PhoneMail (Node 2 of 6) is active with 16 Channels" 2 is the Number I NEED
Total Number of Nodes (From Screen) "PhoneMail (Node 2 of 6) is active with 16 Channels" 6 is the Number I NEED
Number of Channels (From Screen) "PhoneMail (Node 2 of 6) is active with 16 Channels" 16 is the Number I NEED

I have written a script file to capture most of
the information. However, it does NOT work all of the time.
Could someone take a look at my script and offer some suggestions.
Steps Taken
First when I dial into the system I have to wait until the terminal gets to the "LOGIN:" Prompt (i.e. waitquiet 5)
Next I need to Login to the PhoneMial System ("Log-SA.wax").
Third after the Login is complete (i.e. the "Function: Prompt appears) one of the 2 EXAMPLES below will be on the screen.


EXAMPLE 1

Login: SYSADMIN
Password:
ROLM PhoneMail Version 6.3
(C) Copyright 1989-1997 Siemens Business Communication Systems.
All Rights Reserved.



ROLM PhoneMail Site Id: XXXXX37816


PhoneMail release 6.3.5.

CPU Type of local node is 80386 33MHz.
PhoneMail is active with 16 Channels

Function: ;
Fri Feb 11, 2005 7:52 AM


EXAMPLE 2

Login: SYSADMIN
Password:
ROLM PhoneMail Version 6.3
(C) Copyright 1989-1997 Siemens Business Communication Systems.
All Rights Reserved.



ROLM PhoneMail Site Id: XXXXX28206


PhoneMail release 6.3.3.1

CPU Type of local node is 80386 33MHz.
PhoneMail (Node 2 of 6) is active with 16 Channels

Function:



My Current Script File


#define SaveDir "C:\Temp Completed Reports\"
proc main
string thestring, StartNode, StopNode, Channel, SiteID, Release, sSiteName
string sSemiColon = ""
string cMulti = "Node"
string EndNode, sNode
integer iNode, iStopNode
string fName = "Completed "
string fEnd = ".txt"
string SiteCMR

strcpy sSiteName $DialSelect
set dialentry access DATA $DIALSELECT
fetch dialentry company SiteCMR
strcat fName fEnd
chdir SaveDir
fopen 2 fName APPEND TEXT
pause 2
iNode = 0
waitquiet 5
execute "Log-SA.wax"
waitfor "Function:" FOREVER
locate 21, 0 Move the cursor
termreads thestring 52 Read 52 characters
if strfind thestring cMulti
substr StartNode thestring 17 1
substr StopNode thestring 23 1
substr Channel thestring 41 2
else
StartNode = "1"
StopNode = "1"
substr Channel thestring 25 2
locate 18, 0 Move the cursor
termreads thestring 52 Read 52 characters
substr Release thestring 19 9
locate 15, 0 Move the cursor
termreads thestring 52 Read 52 characters
substr SiteID thestring 25 10
fwrite 2 sSiteName 25
fwrite 2 sSemiColon 1
fwrite 2 SiteCMR 9
fwrite 2 sSemiColon 1
fwrite 2 SiteID 10
fwrite 2 sSemiColon 1
finsblock 2 10
fwrite 2 sSemiColon 1
fwrite 2 Release 10
fwrite 2 sSemiColon 1
fwrite 2 sNode 2
finsblock 2 4
finsblock 2 4
fwrite 2 sSemiColon 1
fwrite 2 Channel 4
fwrite 2 sSemiColon 1
call SingleLogoff
exit
endif
locate 18, 0 Move the cursor
termreads thestring 52 Read 52 characters
substr Release thestring 19 9
locate 15, 0 Move the cursor
termreads thestring 52 Read 52 characters
substr SiteID thestring 25 10
fwrite 2 sSiteName 25
fwrite 2 sSemiColon 1
fwrite 2 SiteCMR 9
fwrite 2 sSemiColon 1
fwrite 2 SiteID 10
fwrite 2 sSemiColon 1
finsblock 2 10
fwrite 2 sSemiColon 1
fwrite 2 Release 10
fwrite 2 sSemiColon 1
atoi StopNode iStopNode
EndNode = "C 0"
if iStopNode > 1
while iNode < iStopNode
iNode ++
itoa iNode sNode
strupdt EndNode sNode 2 1
Transmit "LOG^M"
waitfor "Action:"
Transmit EndNode
Transmit "^M"
waitfor "Function:" FOREVER
locate 21, 0 Move the cursor
termreads thestring 52 Read 52 characters
if strfind thestring cMulti
substr StartNode thestring 17 1
substr StopNode thestring 23 1
substr Channel thestring 41 2
fwrite 2 sNode 2
finsblock 2 4
fwrite 2 sSemiColon 1
fwrite 2 Channel 4
fwrite 2 sSemiColon 1
else
substr StartNode thestring 17 1
substr StopNode thestring 23 1
substr Channel thestring 41 2
fwrite 2 sNode 2
finsblock 2 4
fwrite 2 sSemiColon 1
fwrite 2 Channel 4
fwrite 2 sSemiColon 1
endif
endwhile
call MultiLogoff
endif
endproc

proc SingleLogoff
pause 1
transmit "^M"
waitfor "Function: " FOREVER
transmit "LOG^M"
waitfor "Action: "
transmit "LOG^M"
fwrite 2 "`r`n" 1
fclose 2
hangup
capture OFF
endproc

proc MultiLogoff
pause 1
transmit "^M"
waitfor "Function: " FOREVER
transmit "LOG^M"
waitfor "Action: " FOREVER
transmit "LOG^M"
waitfor "Login:"
fwrite 2 "`r`n" 1
fclose 2
hangup
capture OFF
endproc
 
Sometimes it doesn't seems to work, it just skips whole areas.
 
I don't see anything offhand, but I do have a couple comments. You should not need the finsblock commands since you are writing at the end of the file and don't need to add blocks to it (ASPECT will do this automatically).

The other thing I noticed is that it looks like you may be writing different pieces of data depending on if you are connected to a single node system versus a multinode system. The else clause in the if strfind thestring cMulti construct (early in the script) looks like it should have code that would apply to both situations, but will only be executed on a single node system. Is this correct?

 
Knob,

You are correct. for clarification once the Login script executes and the Function: Prompt appears all scrollin stops. You are usualll left with one of four possibilities.

1. Single Node System
2. Single Node System With Errors
3. Multi Node System
4. Multi Node System With Errors

Regardless I still need teh same information. The only thing that would become irrevelent would be the End or Stop Node in a Single Node System. I have revised my Script per your recommendations and below is what I have currently. The Problem is How to know what to look for and when. Everything stays on the same line Except when there are errors, in that case there is ONE line added. in addition if there is garbage on the line there may be additional carrage returns. When I Run the script file here is what I get on the ProComm Screen. In addition I have included a link to a picture of the Completed.txt file.

see link: for example of Completed.txt file

HERE IS THE SCRIPT

#define SaveDir "C:\Temp Completed Reports\"
proc main
string sSiteName, sSiteCMR, sSiteID, sVersion
string thestring, sStartNode, sStopNode, sChannel, sRelease
string sSemiColon = ""
string cMulti = "Node"
string EndNode, sNode
integer iNode, iStopNode
string fName = "Completed "
string fEnd = ".txt"

strcpy sSiteName $DialSelect
set dialentry access DATA $DIALSELECT
fetch dialentry company sSiteCMR
strcat fName fEnd
chdir SaveDir
fopen 2 fName APPEND TEXT
pause 2
iNode = 0
waitquiet 5
execute "Log-SA.wax"
waitfor "Function:" FOREVER

;With NO ERRORS
locate 22, 0 ;Move the cursor to Row 22 Column 0
termreads thestring 52 ;Reads 52 digits
if strfind thestring cMulti
substr sStartNode thestring 17 1
substr sStopNode thestring 23 1
substr sChannel thestring 41 2
locate 10, 0 ;Move the cursor to Row 10 Column 0
termreads thestring 30 ;Reads 30 digits
substr sVersion thestring 23 5 ;Moves 5 digits to sVersion from Column 23
locate 16, 0 ;Move the cursor to Row 16 Column 0
termreads thestring 35 ;Reads 35 digits
substr sSiteID thestring 24 10 ;Moves 10 digits to sSiteID from Column 24
locate 19, 0 ;Move the cursor to Row 19 Column 0
termreads thestring 30 ;Reads 30 digits
substr sRelease thestring 20 10 ;Moves 10 digits to sRelease from Column 20
fwrite 2 sSiteName 25 ;Write the Site Name to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
fwrite 2 sSiteCMR 9 ;Write the CMR Number to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
fwrite 2 sSiteID 10 ;Write the Site ID Number to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
fwrite 2 sRelease 10 ;Write the Release Number to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
fwrite 2 sVersion 10 ;Write the Version Number to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
fwrite 2 sStartNode 2 ;Write the Starting Node Number to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
fwrite 2 sStopNode 2 ;Write the Ending Node Number to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
fwrite 2 sChannel 4 ;Write the Number of Channels to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
call MultiLogoff
exit
else
sStartNode = "1" ;Sets the StartNode to 1 for SINGLE NODE SYSTEMS
sStopNode = "1" ;Sets the StopNode to 1 for SINGLE NODE SYSTEMS
substr sChannel thestring 25 2 ;Moves 2 digits to sChannel from Column 25
locate 10, 0 ;Move the cursor to Row 10 Column 0
termreads thestring 30 ;Reads 30 digits
substr sVersion thestring 23 5 ;Moves 5 digits to sVersion from Column 23
locate 16, 0 ;Move the cursor to Row 16 Column 0
termreads thestring 35 ;Reads 35 digits
substr sSiteID thestring 24 10 ;Moves 10 digits to sSiteID from Column 24
locate 19, 0 ;Move the cursor to Row 19 Column 0
termreads thestring 30 ;Reads 30 digits
substr sRelease thestring 20 10 ;Moves 10 digits to sRelease from Column 20
fwrite 2 sSiteName 25 ;Write the Site Name to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
fwrite 2 sSiteCMR 9 ;Write the CMR Number to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
fwrite 2 sSiteID 10 ;Write the Site ID Number to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
fwrite 2 sRelease 10 ;Write the Release Number to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
fwrite 2 sVersion 10 ;Write the Version Number to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
fwrite 2 sStartNode 2 ;Write the Starting Node Number to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
fwrite 2 sStopNode 2 ;Write the Ending Node Number to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
fwrite 2 sChannel 4 ;Write the Number of Channels to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
call SingleLogoff
exit
endif

atoi sStopNode iStopNode
EndNode = "C 0"
if iStopNode > 1
while iNode < iStopNode
iNode ++
itoa iNode sNode
strupdt EndNode sNode 2 1 ;Changes EndNode (NODE NUMBER) by adding sNode (1)
Transmit "LOG^M" ;Sends LOG to the PhoneMail to LOGOFF
waitfor "Action:"
Transmit EndNode ;Sends the EndNode Number to change NODES
Transmit "^M" ;Sends a Carriage Return to the PhoneMail
waitfor "Function:" FOREVER
locate 21, 0 ;Move the cursor to Row 21 Column 0
termreads thestring 52 ;Reads 52 digits
if strfind thestring cMulti
substr sStartNode thestring 17 1 ;Moves 1 digit to sStartNode from Column 17
substr sStopNode thestring 23 1 ;Moves 1 digit to sStopNode from Column 23
substr sChannel thestring 41 2 ;Moves 2 digits to sChannel from Column 41
fwrite 2 sNode 2 ;Write the Node Numbers to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
fwrite 2 sChannel 4 ;Write the Number of Channels to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
else
substr sStartNode thestring 17 1 ;Moves 1 digit to sStartNode from Column 17
substr sStopNode thestring 23 1 ;Moves 1 digit to sStopNode from Column 23
substr sChannel thestring 41 2 ;Moves 2 digits to sChannel from Column 41
fwrite 2 sNode 2 ;Write the Node Numbers to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
fwrite 2 sChannel 4 ;Write the Number of Channels to File 2
fwrite 2 sSemiColon 1 ;Writes a SemiColon to File 2
endif
endwhile
call MultiLogoff
endif
endproc

proc SingleLogoff
pause 1
transmit "^M"
waitfor "Function: " FOREVER
transmit "LOG^M"
waitfor "Action: "
transmit "LOG^M"
fwrite 2 "`r`n" 1
fclose 2
hangup
capture OFF
endproc

proc MultiLogoff
pause 1
transmit "^M"
waitfor "Function: " FOREVER
transmit "LOG^M"
waitfor "Action: " FOREVER
transmit "LOG^M"
waitfor "Login:"
fwrite 2 "`r`n" 1
fclose 2
hangup
capture OFF
endproc


I need to be able to connect to these systems and change thru all of the nodes from 1 to 8 (which is the max), and collect Node number and channel for each Node.

Any suggestioons you can offer will be greatly appreciated.
 
Knob,

I forgot to post the content of the ProComm Screen. Screen resolution is set for 25-Rows by 80-Columns.


Login:
Illegal Input.

Login:

Login:

Login: SYSADMIN
Password:
ROLM PhoneMail Version 6.3
(C) Copyright 1989-1997 Siemens Business Communication Systems.
All Rights Reserved.



ROLM PhoneMail Site Id: XXXXX39166


PhoneMail release 6.3.5.

CPU Type of local node is 80386 33MHz.
PhoneMail (Node 1 of 2) is active with 16 Channels

Function:


Thanks again for you help.
 
So does your existing script work OK as long as you don't run into a system with errors? Can you post a screenshot of what that looks like (a system with errors as mentioned in the beginning of your second to last post)?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top