harisis
asked on
Dialing and sending DTMF codes
How i can make a routine that dials a number to the phone, then sends some DTMF codes and then hungs up the line?
you must have a modem by the way ;-))
ASKER
I made the following routine but the modem dosn't dial. It does nothing... Is there a problem with the routine?:
-------------------------- ---------- ----
procedure TForm1.Button1Click(Sender : TObject);
var
MyModemStr:pchar;
i:dword;
ol:Toverlapped;
begin
FillChar(ol, Sizeof(ol), 0);
f1 := createfile( 'com2',GENERIC_WRITE,FILE_ SHARE_WRIT E,nil,OPEN _EXISTING, FILE_ATTRI BUTE_NORMA L,0);
MyModemStr := 'ATDT5551234';
writefile( f1, MyModemStr, length(MYModemStr),i,@ol )
end;
--------------------------
procedure TForm1.Button1Click(Sender
var
MyModemStr:pchar;
i:dword;
ol:Toverlapped;
begin
FillChar(ol, Sizeof(ol), 0);
f1 := createfile( 'com2',GENERIC_WRITE,FILE_
MyModemStr := 'ATDT5551234';
writefile( f1, MyModemStr, length(MYModemStr),i,@ol )
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
sorry, I forgot
var
s1: String[255];
var
s1: String[255];
heyy thank u all! u great helped me!
do u know how to make delphi aoutamaticly answer the incoming calls? or can i detect a incoming call?
thanx beforehand
do u know how to make delphi aoutamaticly answer the incoming calls? or can i detect a incoming call?
thanx beforehand
auto answer is a modem feature, not delphi :-)
just send 'ats0=1' string to modem, it will answer then to incoming calls
just send 'ats0=1' string to modem, it will answer then to incoming calls
thank u Alisher_N ! is there any link or have u got a tutorial that can help me to learn modem programming?
thanx!
thanx!
thank u Alisher_N ! is there any link or have u got a tutorial that can help me to learn modem programming?
thanx!
thanx!
var
MyModemStr[255];
f1 := createfile( 'com2'........);
MyModemStr := 'ATDT5551234';
writefile( f1, MyModemStr[1], length(MYModemStr) )
if you want connection message from other side - read from com2 and wait for 'connect xxxxx' string, if you don't want just send after short pause any tones you need:
MyModemStr := 'ATX1DT1234';
writefile( f1, MyModemStr[1], length(MYModemStr) )