CodePudding user response:
What are you using sound card, are generally have the SDK is read,CodePudding user response:
The problem is difficult,Don't know
CodePudding user response:
1/+ 1There must be a hardware support, hardware vendors will provide a development kit,
CodePudding user response:
I have been writing, or compiled in the D5, time is too long, can't find the original program,(1) hardware to use cat,
(2) the database to store telephone Numbers,
(3) through controls (?) Achieve dialing,
After I check the, reply again!
CodePudding user response:
Find the code, for reference only.Var s, TelPhone: string;
I: integer;
The begin
TelPhone:=';
S:=DBGrid1 SelectedField. AsString;
For I:=1 to Length (S) do
The begin
If (48 & lt; [I]=word (S)) and (word (S) [I] <=57) then//valid number 0123456789
TelPhone:=TelPhone + S [I];
end;
If length (TelPhone) & lt; 2 then the exit;
With CallParams do
The begin
DwTotalSize:=sizeof (CallParams);
DwBearerMode:=LINEBEARERMODE_VOICE;
DwMediaMode:=LINEMEDIAMODE_INTERACTIVEVOICE;
end;
If lineInitialize (@ lineApp HInstance, @ lineCallBack, ' ', nDevs) & lt; 0
Then showmessage (' lines cannot be initialized. ')
Else if nDevs=0//no TAPI device
Then the begin
LineShutDown (lineApp);
LineApp:=0;
End
The else//negotiation TAPI1.4 TAPI version number?? TAPI2.0
If lineNegotiateAPIVersion (lineApp, 0, $00010004, $00020000,
TapiVersion extid) & lt; 0
Then the begin
Showmessage (' TAPI version are not compatible. ');
LineShutDown (lineApp);
LineApp:=0;
End
The else errorcode:=lineOpen (lineApp LINEMAPPER, @ line, tapiVersion, 0, 0, LINECALLPRIVILEGE_NONE, LINEMEDIAMODE_INTERACTIVEVOICE, @ CallParams);//open the line
If errorcode<0
Then showmessage (' line can't open! ')
The else begin//line successfully open the
LineConfigDialog (0, the Self. Handle, nil);
LineGetIcon (0, 'tapi/line, @ lineIcon);
If lineMakeCall (line, @ call, PChar (TelPhone), 0, @ CallParams) & lt; 0
Then showmessage (' call failed! ')
The else begin
Showmessage (' pick machine, please call! ');
LineHandOff (call, 'mu???? 2 | o °? 3 ido ', LINEMEDIAMODE_INTERACTIVEVOICE);
LineShutDown (lineApp);
end;
end;
end;
CodePudding user response:
Call a function:procedure lineCallback (hDevice, dwMsg dwCallbackInstance,
DwParam1, dwParam2 dwParam3: LongInt); Stdcall;//oi2? O?? D. mu???? '| aio ˉ ey
Var Call: HCall;
The begin
If dwMsg=LINE_REPLY then
If dwParam2 & lt; 0 then
Showmessage (' call response error! ')
The else
If dwMsg=LINE_CALLSTATE then begin
Call:=HCall (hDevice); Case dwParam1 of
LINECALLSTATE_IDLE:
If the call & lt;> 0 then
The begin
LineDeallocateCall (Call);
end;
LINECALLSTATE_PROCEEDING: showmessage (' call normal processing! ');
LINECALLSTATE_DIALTONE: showmessage (' detected dial tone! ');
LINECALLSTATE_DIALING: showmessage (' are dialing! ');
LINECALLSTATE_DISCONNECTED:
The begin
If dwParam2=LINEDISCONNECTMODE_NORMAL then showmessage (' normal disconnection)
The else
If dwParam2=LINEDISCONNECTMODE_BUSY then showmessage (' the line is busy);
end;
LINECALLSTATE_BUSY: showmessage (' the line is busy processing);
end;
end;
end;
CodePudding user response:
I found a phone in the room procedures, also picked up a used for interface DLL, and hippiesCodePudding user response:
The first hardware support, hardware manufacturer will supply the corresponding SDK development kit and the sample, if you want to achieve out of thin air, can wait to 2300 does not necessarily!CodePudding user response:
My code, hardware needs: support dial up Internet cat,Upload again, DBGrid the right mouse button events:
var s, TelPhone: string;nullnull
I: integer;
The begin
TelPhone:=';
S:=DBGrid1 SelectedField. AsString;
For I:=1 to Length (S) do
The begin
If (48 & lt; [I]=word (S)) and (word (S) [I] <=57) then//valid number 0123456789
TelPhone:=TelPhone + S [I];
end;
If length (TelPhone) & lt; 2 then the exit;
With CallParams do
The begin
DwTotalSize:=sizeof (CallParams);
DwBearerMode:=LINEBEARERMODE_VOICE;
DwMediaMode:=LINEMEDIAMODE_INTERACTIVEVOICE;
end;
If lineInitialize (@ lineApp HInstance, @ lineCallBack, ' ', nDevs) & lt; 0
Then showmessage (' lines cannot be initialized. ')
Else if nDevs=0//no TAPI device
Then the begin
LineShutDown (lineApp);
LineApp:=0;
End
The else//negotiation TAPI1.4 TAPI version number?? TAPI2.0
If lineNegotiateAPIVersion (lineApp, 0, $00010004, $00020000,
TapiVersion extid) & lt; 0
Then the begin
Showmessage (' TAPI version are not compatible. ');
LineShutDown (lineApp);
LineApp:=0;
End
The else errorcode:=lineOpen (lineApp LINEMAPPER, @ line, tapiVersion, 0, 0, LINECALLPRIVILEGE_NONE, LINEMEDIAMODE_INTERACTIVEVOICE, @ CallParams);//open the line
If errorcode<0
Then showmessage (' line can't open! ')
The else begin//line successfully open the
LineConfigDialog (0, the Self. Handle, nil);
LineGetIcon (0, 'tapi/line, @ lineIcon);
If lineMakeCall (line, @ call, PChar (TelPhone), 0, @ CallParams) & lt; 0
Then showmessage (' call failed! ')
The else begin
Showmessage (' pick machine, please call! ');
LineHandOff (call, 'mu???? 2 | o °? 3 ido ', LINEMEDIAMODE_INTERACTIVEVOICE);
LineShutDown (lineApp);
end;
end;
end;