dialing program; modem receives dialstring but doesn't dial?

dialing program; modem receives dialstring but doesn't dial?

Post by Atiqullah Hash » Tue, 18 Jul 1995 04:00:00



Hi,

I have a simple program to dial out via a hayes modem. When run, the
modem RD and TD lights blink showing that it receives the dial string
from the program but doesn't really dial out.
Here is the relevant piece of code. Any help is appreciated.
Thanks

Atiq
-------------------------------------
void sttyModem(int fd)
{
        struct termio tbuf;
        if (ioctl(fd, TCGETA, &tbuf) < 0 )
                cerr << "ioctl(TCGETA) failed; errno = "<< errno << endl;
        tbuf.c_iflag = IXON | IXOFF | ISTRIP | IGNBRK | IGNPAR;
        tbuf.c_oflag = 0;
        tbuf.c_lflag = 0;
        tbuf.c_cflag = B300 | CS7 | CREAD | HUPCL | PARENB;
        tbuf.c_cc[4] = 1;       // MIN
        tbuf.c_cc[5] = 0;       // TIME
        if (ioctl(fd, TCSETAF, &tbuf))
                cerr << "ioctl(TCSETAF) failed; errno = "<< errno << endl;

Quote:}

main()
{
        int tty_fd;
        tty_fd=open(....)  etc.
        sttyModem(tty_fd);

        char *str="ATDT91(800)222-3333\r";            //some number
        char ss[10];

        write(tty_fd, str, strlen(str));
        read(tty_fd, ss, 1);
        // other code..........
        exit(0);

Quote:}

 
 
 

dialing program; modem receives dialstring but doesn't dial?

Post by Harry Vene » Wed, 19 Jul 1995 04:00:00



Quote:

>Hi,

>I have a simple program to dial out via a hayes modem. When run, the
>modem RD and TD lights blink showing that it receives the dial string
>from the program but doesn't really dial out.
>Here is the relevant piece of code. Any help is appreciated.
>Thanks

>Atiq
>-------------------------------------

[ source deleted ]

Quote:>main()
>{
>        int tty_fd;
>        tty_fd=open(....)  etc.
>        sttyModem(tty_fd);

>        char *str="ATDT91(800)222-3333\r";              //some number
>        char ss[10];

>        write(tty_fd, str, strlen(str));
>        read(tty_fd, ss, 1);
>        // other code..........
>        exit(0);
>}

I had the same problem a few years ago.
Some modems don't like receiving an AT command at full speed.
I solved the problem bij sending each character seperate and waiting for the
output to drain by using the ioctl command.
Change your single write into a loop where each character is written seperately
followed by ioctl(tty_fd,TCSBRK,1).

Harry Venema
--
---------------------------------------------------------------------------
Harry Venema                     | VCD Services B.V


#include <stddisclaimer.h>       | Voice +31 50 975500 Fax: +31 50 975597
---------------------------------------------------------------------------

 
 
 

1. how to set " modem don't wait for dial tone before dialing "

how to set " modem don't wait for dial tone before dialing "

i want to make it like in windows98 because i have a problem with my line..
Now i use isdn line with router Zyxel. and i want to use modem with my line
but i must set modem " don't wait for dial tone before dialing " how can i do it??

i used windows98 and set no wait for dial tone before dialing .It's work..but
in Linux not work.

bump

2. Problems with 3D Expression

3. PPP: Dial In, Dial Out, Fax Receive (Possible?)

4. crond error wrong environment variables

5. linux 2.018/kerneld/PPP dial on demand: 'network unreachable' then starts dialling

6. COMPAT_LINUX question

7. 2.3 -> 2.7 via Dial-up (Re: CVS over 'dropping' dial-ups)

8. Linux and gatherTalk

9. modem doesn't dial

10. Why my modem doesn't dial up?

11. Modem doesn't dial out ....

12. Mu modem doesn't dial...

13. PPP doesn't dial modem!!!