Modem/Communication Problem

Modem/Communication Problem

Post by Barry L. Johnso » Wed, 30 Oct 1996 04:00:00



Situation:
programmers need to be paged via beeper when a script/program abend
occurs within our batch cycle.  CA-Unicenter is being used to execute
and evaluate the abend condition and a scheduled event is executing via
a script to perform a UNIX TIP to the modem.  We are running Solaris 2.4
if that matters.

Problem:
The script runs when associated with at a shell prompt fine but when
executing via CA-Unicenter the TIP command encounters an error "tip must
be run interactive".  This I believe is due to the script not being
associated to a TTY device when executed in this manner.

Question:
Any ideas on how to resolve this issue or does anyone have a C program
that will perform this function?  The only requirement of this solution
is to dial a phone number with inserted pauses and then a code, i.e.
8,1##########,,,,,,,9999.

 
 
 

Modem/Communication Problem

Post by Ian Fin » Wed, 30 Oct 1996 04:00:00



> Situation:
> programmers need to be paged via beeper when a script/program abend
> occurs within our batch cycle.  CA-Unicenter is being used to execute
> and evaluate the abend condition and a scheduled event is executing via
> a script to perform a UNIX TIP to the modem.  We are running Solaris 2.4
> if that matters.

> Problem:
> The script runs when associated with at a shell prompt fine but when
> executing via CA-Unicenter the TIP command encounters an error "tip must
> be run interactive".  This I believe is due to the script not being
> associated to a TTY device when executed in this manner.

> Question:
> Any ideas on how to resolve this issue or does anyone have a C program
> that will perform this function?  The only requirement of this solution
> is to dial a phone number with inserted pauses and then a code, i.e.
> 8,1##########,,,,,,,9999.

Expect is a great tool for automating Unix programs.  I have written
a simple expect script that uses tip to page me when one of my scripts
fails :)

You can get expect from:

ftp://ftp.cme.nist.gov/pub/expect/

Expect is a tcl based app, so you need that as well...also available
from the same site.

You might also get the O'Reilly book EXPLORING EXPECT by Don Libes
(the author of expect as well).

Ian Fink


 
 
 

1. AIX 4.x Modem/Communications Problem

I have a C program that must periodically dial a modem, log on to a remote
computer, send and receive packets of information (without carriage returns
or line feeds), and log out.  This program works well under AIX version 3.x
but won't work under 4.x.

The basic logic here is:

/* Set the port attributes */
Terminal = open("/dev/tty1",O_RDWR | O_NDELAY);
tcgetattr(Terminal,&attr);
attr.c_cflag |= CLOCAL;
attr.c_lflag &= ~(ICANON);
attr.c_cc[VMIN] = 0;
attr.c_cc[VTIME] = 500;
tcsetattr(Terminal,&attr);
close(Terminal);

/* Normal open */
Terminal = open("/dev/tty1",O_RDWR");
    /* Basic send a packet and receive response logic */
    for(cnt=0;send[cnt],cnt++) write(Terminal, &send[cnt], 1);
    while(read(Terminal, &ch, 1) == 1)
    {
        printf("%c",ch);
    }
close(Terminal);

I am having the following problems with this code:
1. With the modem set normally for DTR (&C1), I can't open the port for the
"Normal open" - it sits there forever.
2. If I set the modem to ignore DTR (&C0), it will open, but then read the
same response over and over (for example: if I sent an ATH, I receive a
repeating OKOKOKOKOKOKOKOKOK....
3. If I open the tty with O_NDELAY for the normal open, I never get ANY
response.

Any ideas (or FIXES) would be GREATLY APPRECIATED!

Thanks,
Bill Crozier

2. How configure ADSL multiport in Linux?

3. dip to modem communication problem

4. PC104-DAS16Jr/16 data acquisition card

5. modem communication problem

6. Settings in Linux

7. Announcement: Modem-1.0 -- A Distributed Communication Package for Modems

8. Problems linking on Solaris 2.6

9. Modem to modem communication

10. modem-0.4b - Distributed communication package for modems

11. Communication to an external modem with HAYES commands CODE problems...

12. problem using full duplex voice communication via modem ??