unit uSQLThread.SQLSaveCallActivity;
interface
uses System.Classes, System.SysUtils, System.Types, uCallactivity,
ZAbstractConnection, ZConnection, ZAbstractRODataset, ZDataset, Data.DB, uDBSettings;
type
TOnThreadFinished=procedure(Sender: TObject)
of object;
TSQLSaveCallActivity=class(TThread)
private
FDBSettings: TDBSettings;
FOnThreadFinished: TOnThreadFinished;
Ftablename:
string;
Frecordid:
string;
Fagentname:
string;
FIncoming: Integer;
Fotherpartyphonenumber2:
string;
Flocalpartyphonenumber:
string;
FCallID: Integer;
Fdevicename:
string;
Fotherpartyname:
string;
Fotherpartyphonenumber:
string;
Fagentguid: TGUID;
FCallState:
string;
procedure DoThreadFinished;
published
property OnThreadFhinished: TOnThreadFinished
read FOnThreadFinished
write FOnThreadFinished;
public
constructor Create(Suspended: Boolean; DBSettings: TDBSettings; Agentguid: TGUID; Agentname:
string;
callid, incoming: Integer; callstate, devicename, localpartyphonenumber, otherpartyphonenumber, recordid,
otherpartyphonenumber2, otherpartyname, tablename:
string);
protected
procedure Execute;
override;
end;
const
DebuggingName = '
SQLSaveCallActivity';
implementation
{ TSQLTemplate }
constructor TSQLSaveCallActivity.Create(Suspended: Boolean; DBSettings: TDBSettings; Agentguid: TGUID; Agentname:
string;
callid, incoming: Integer; callstate, devicename, localpartyphonenumber, otherpartyphonenumber, recordid,
otherpartyphonenumber2, otherpartyname, tablename:
string);
begin
inherited Create(Suspended);
FDBSettings:=TDBSettings.Create;
DBSettings.AssignTo(FDBSettings);
//<---Hier springt er noch rein. FDBSettings sollte erzeugt sein. DBSettings wird ja übergeben, und sollte auch vorhanden sein.
self.Fagentguid:=Agentguid;
// Zumal DBSettings vom aufrufenden Thread auch an ganz viele
self.Fagentname:=Agentname;
// andere Threads übergeben wird, und von keinem anderen eine
self.FCallID:=callid;
// Fehlermeldung kommt.
self.FIncoming:=incoming;
Self.FCallState:=callstate;
self.Fdevicename:=devicename;
self.Flocalpartyphonenumber:=localpartyphonenumber;
self.Fotherpartyphonenumber:=otherpartyphonenumber;
self.Frecordid:=recordid;
self.Fotherpartyphonenumber2:=otherpartyphonenumber2;
self.Fotherpartyname:=otherpartyname;
self.Ftablename:=tablename;
end;