跪求大神介紹下怎么開發電話撥號程式,比如讀取客戶在接通電話后輸入的號碼字符。好人一生平安!謝謝!
uj5u.com熱心網友回復:
看你用的什么語音卡,一般都是有SDK讀取的。uj5u.com熱心網友回復:
問題有難度的,不太清楚
uj5u.com熱心網友回復:
1樓+1必須有硬體支持,硬體廠商會提供開發包。
uj5u.com熱心網友回復:
我曾經撰寫過,還是在D5中編譯,時間過長,找不到原程式了。(1)硬體要使用貓。
(2)資料庫保存電話號碼。
(3)通過控制元件(?)達到拔號。
待我查到,再回復!
uj5u.com熱心網友回復:
找到代碼,僅供參考。var s,TelPhone:string;
i:integer;
begin
TelPhone:='';
S:=DBGrid1.SelectedField.AsString;
for i:=1 to Length(S) do
begin
if (48<=Ord(S[I])) and (Ord(S[I])<=57) then // 有效數字0123456789
TelPhone:=TelPhone+S[I];
end;
if length(TelPhone)<2 then exit;
with CallParams do
begin
dwTotalSize := sizeof(CallParams);
dwBearerMode := LINEBEARERMODE_VOICE;
dwMediaMode:=LINEMEDIAMODE_INTERACTIVEVOICE;
end;
if lineInitialize(@lineApp,HInstance,@lineCallBack,'',nDevs)<0
then showmessage('線路不能初始化!')
else if nDevs=0 // 無TAPI設備
then begin
lineShutDown(lineApp);
lineApp:=0;
end
else // 協商TAPI版本號 TAPI1.4??TAPI2.0
if lineNegotiateAPIVersion(lineApp,0,$00010004,$00020000,
tapiVersion,extid)<0
then begin
showmessage('TAPI版本不兼容!');
lineShutDown(lineApp);
lineApp:=0;
end
else errorcode:=lineOpen(lineApp,LINEMAPPER,@line,tapiVersion,0,0,LINECALLPRIVILEGE_NONE,LINEMEDIAMODE_INTERACTIVEVOICE,@CallParams); // 打開線路
if errorcode<0
then showmessage('線路不能打開!')
else begin // 線路成功打開
lineConfigDialog(0,Self.Handle,nil);
lineGetIcon(0,'tapi/line',@lineIcon);
if lineMakeCall(line,@call,PChar(TelPhone),0,@CallParams)<0
then showmessage('呼叫失敗!')
else begin
showmessage('請摘機通話!');
lineHandOff(call,'μ??°2|o?3ìDò',LINEMEDIAMODE_INTERACTIVEVOICE);
lineShutDown(lineApp);
end;
end;
end;
uj5u.com熱心網友回復:
呼叫函式:procedure lineCallback(hDevice, dwMsg, dwCallbackInstance,
dwParam1, dwParam2, dwParam3: LongInt); stdcall;//òì2?o??D·μ??′|àíoˉêy
var Call: HCall;
begin
if dwMsg = LINE_REPLY then
if dwParam2 < 0 then
showmessage('呼叫回應錯誤!')
else
if dwMsg = LINE_CALLSTATE then begin
Call := HCall(hDevice); case dwParam1 of
LINECALLSTATE_IDLE:
if call <> 0 then
begin
lineDeallocateCall(Call);
end;
LINECALLSTATE_PROCEEDING:showmessage('呼叫正常處理!');
LINECALLSTATE_DIALTONE:showmessage('檢測到拔號音!');
LINECALLSTATE_DIALING: showmessage('正在拔號!');
LINECALLSTATE_DISCONNECTED:
begin
if dwParam2=LINEDISCONNECTMODE_NORMAL then showmessage('正常斷開')
else
if dwParam2=LINEDISCONNECTMODE_BUSY then showmessage('線路忙');
end;
LINECALLSTATE_BUSY:showmessage('線路忙處理');
end;
end;
end;
uj5u.com熱心網友回復:
我在機房找到一個打電話的程式,還撿到一個用于介面的DLL。。嘻uj5u.com熱心網友回復:
第要硬體支持,硬體廠家會供相應的SDK開發包和示例,你要想憑空實作。可以等待到2300年不一定!uj5u.com熱心網友回復:
我的代碼,硬體需要:支持拔號上網的貓。重新上傳,DBGrid的滑鼠右鍵事件:
var s,TelPhone:string;
i:integer;
begin
TelPhone:='';
S:=DBGrid1.SelectedField.AsString;
for i:=1 to Length(S) do
begin
if (48<=Ord(S[I])) and (Ord(S[I])<=57) then // 有效數字0123456789
TelPhone:=TelPhone+S[I];
end;
if length(TelPhone)<2 then exit;
with CallParams do
begin
dwTotalSize := sizeof(CallParams);
dwBearerMode := LINEBEARERMODE_VOICE;
dwMediaMode:=LINEMEDIAMODE_INTERACTIVEVOICE;
end;
if lineInitialize(@lineApp,HInstance,@lineCallBack,'',nDevs)<0
then showmessage('線路不能初始化!')
else if nDevs=0 // 無TAPI設備
then begin
lineShutDown(lineApp);
lineApp:=0;
end
else // 協商TAPI版本號 TAPI1.4??TAPI2.0
if lineNegotiateAPIVersion(lineApp,0,$00010004,$00020000,
tapiVersion,extid)<0
then begin
showmessage('TAPI版本不兼容!');
lineShutDown(lineApp);
lineApp:=0;
end
else errorcode:=lineOpen(lineApp,LINEMAPPER,@line,tapiVersion,0,0,LINECALLPRIVILEGE_NONE,LINEMEDIAMODE_INTERACTIVEVOICE,@CallParams); // 打開線路
if errorcode<0
then showmessage('線路不能打開!')
else begin // 線路成功打開
lineConfigDialog(0,Self.Handle,nil);
lineGetIcon(0,'tapi/line',@lineIcon);
if lineMakeCall(line,@call,PChar(TelPhone),0,@CallParams)<0
then showmessage('呼叫失敗!')
else begin
showmessage('請摘機通話!');
lineHandOff(call,'μ??°2|o?3ìDò',LINEMEDIAMODE_INTERACTIVEVOICE);
lineShutDown(lineApp);
end;
end;
end;
uj5u.com熱心網友回復:
delphi有個叫Varian Async32的控制元件,可以實作電話撥號,需要有貓和電話線。實質就是對串口操作,收發AT指令。轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/157063.html
上一篇:請教個excel匯出格式的問題啊
