Mail Archives: djgpp/1999/04/02/08:09:57
"Rafael García" wrote:
> Is it possible to simply dial a phone number with the modem and hang up?
> The intent is to someone that make many calls to use the modem and don't
> have to manually press the numbers.
>
> It would be wonderful something like this:
>
> dial(char *number) {
> FILE *f=fopen("com2:","w");
what's the "w" ???????
>
> if (!f) return 1;
> fprintf(f,"atdt82%s\n",number); // 82 for the office phone
> system to get out line
try changing this to
fprintf(f,"atdt82,,%s\n",number); //Commas are to tell the modem to wait,
then dial the number
You usually need to wait for a 2nd dial tone when dialing outside of a PBX.
> waitUserKey();
> fprintf(f,"ath\n");
fprintf(f,"+++ ath0\n"); //+++ is to to tell the modem to switch to command
mode, then execute the command.
Which if I remember correctly is ath0. It's been a while since I've done any
stuff w/ modems. Used to use BBSes, but it's been about 4-5 years. Also, \n,
which is the new line, might work better as ^M, literal caret and then M.
Modems interpret this as control-m, which is a linefeed.
>
> fclose(f);
> return 0;
> }
>
> Thanks.
Also, all of this info is given to you w/o the benefit of an actual modem in
my computer. It is all from my memory of the days when I used to use BBS
systems.
- Raw text -