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!

Automated TEXT Capture?

Status
Not open for further replies.

ShorePatrol

Programmer
Mar 19, 2003
18
US
Hi All,

I'm really new to Procomm Scripting...I'm an Active Server Page (ASP) and Visual Basic programmer, but I need to write a script for Procomm....

Here's what I need it to do...

We have a modem hooked up to a PBX (telephone) system. Every once in a while the modem is sent some data, not alot, just a few lines....we know the data gets to the modem, due to the lights flashing...

What I need to do, is connect Procomm to the modem, and somehow have it autoanswer, and grab the incoming text, then write it to a text file...

Is this possible? Does anyone have any script that can do this?

Any help GREATLY appreciated!

Thanks!
Dave
 
Here's something off the top of my head (i.e. untested) that may work:

proc main
set modem acceptcall data ON
set modem acceptcall fax OFF
set modem autoanswer PW
clear
when $CARRIER call log_it

while 1
yield
endwhile
endproc

proc log_it
if $CARRIER == 1
capture on
else
capture off
clear
endif
endproc

The clear statements are to clear the screen so data from previous sessions do not appear in subsequent capture files.

You will likely want to use the set capture filename command to give each capture file a unique name unless it is OK for all data to remain in the same file. aspect@aspectscripting.com
 
Thanks for that reply....I just got Procomm installed...

Another question: when the data comes to the modem, and I see RING, RING, RING...I type ATA which connects the call.

Then it says: CONNECT 9600
But then it just sits there...is there a terminal command to "grab" any of the data that should be there, so I can see it on the screen?

And as far as your script goes, when I run it, the little guy keep running - I'm assuming this is the loop to wait for the incoming call...will it save the data to the "capture" directory?

Can you elaborate on how I would use the "set capture filename" to give each captured file a different name?

Thanks for your help!
Dave
 
As long as the calling system is sending data, it should appear on the Procomm screen without you or the script needing to do anything. The capture command won't steal the data from the screen like rget and some other commands do. I would try the test again without the script running and see if the data comes through OK in that case.

The data will be saved to the capture directory. You can change the capture path with the set capture path command.

You can use the set capture file command (not filename as I mistakenly said earlier) to set the name of the capture file. You could write a function to determine the name based on the date, for example, then call that function as the first step in the log_it procedure (just before the capture on command). Then you would use the set capture file command with the generated filename to specify the capture file for this particular data session. aspect@aspectscripting.com
 
Thanks for that info Knob,

Yeah, even without the script, I'm not able to see any data coming through...

I need to confirm the correct data is coming from the sending computer....

I have a few concerns with my direct-connect setup (see seperate post)...but, hopefully I can hash this out.

Again, thanks- (I'm sure I'll be posting more stupid questions)...:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top