Link to home
Start Free TrialLog in
Avatar of harisis
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?
Avatar of Alisher_N
Alisher_N

just a rough sketch

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) )

you must have a modem by the way ;-))
Avatar of harisis

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_WRITE,nil,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
 MyModemStr := 'ATDT5551234';
 writefile( f1, MyModemStr, length(MYModemStr),i,@ol )
end;

ASKER CERTIFIED SOLUTION
Avatar of Alisher_N
Alisher_N

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sorry, I forgot

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
auto answer is a modem feature, not delphi :-)
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!
thank u Alisher_N ! is there any link or have u got a tutorial that can help me to learn modem programming?
thanx!