Einzelnen Beitrag anzeigen

msickel

Registriert seit: 14. Mai 2005
108 Beiträge
 
Delphi 2005 Professional
 
#5

Re: Paramter Me oder This wie in delphi ?

  Alt 14. Mai 2008, 07:54
kein Problem

hier kommt der Code


Delphi-Quellcode:
unit Unit2;

{$WARN SYMBOL_PLATFORM OFF}

interface

uses
  ComObj, ActiveX, Project1_TLB, StdVcl, TVIVRLib_TLB, sysutils, Forms;

type
  TIVRPlug1 = class(TAutoObject, PluginApplication)
  protected
    function CallOffering(const Caller: PluginCaller): HResult; stdcall;
    function CallPlaced(const Caller: PluginCaller;
      CallProgress: CPType): HResult; stdcall;
    function CallTerminated: HResult; stdcall;

  end;

implementation

uses ComServ;

var
  nEndPos : integer = -1;
  mMedia : PluginMedia;
  Ergebnis : TVIVRLib_TLB.ActionResult;
  strDigits : String;
  strVoiceDir : String = 'c:\program files\televantage server\vfiles\en00\' ;

{
Function GatherAndVerifyRange(iMedia: PluginMedia; DigitCount: Integer; DigitTerm: String; Min: Long;                    ByVal Max As Long, _
  MainPrompt: String; TimeOutPrompt: String; InvalidEntryPrompt: String; MaxRetriesPrompt: String;
  DigitTimeOut: Long; MaxRetries: Long) As String
}




function TIVRPlug1.CallOffering(const Caller: PluginCaller): HResult;
begin
  try
    Caller.SetStatus('CallOffering');
    mMedia := Caller.GetMedia(self as PluginMedia);
    //mMedia := Caller.GetMedia(forms.application as IInterface);
   // mMedia := Caller.GetMedia(Sender);
    mMedia.PlayFile(strVoiceDir+'aahi.vox', '@', 0, nEndPos, true, ffVOX_PCM_8K);

    strDigits := mMedia.GetDigits(3, '', -1, -1, idsStartImmediate, Ergebnis);
    mMedia.PlayFile(strVoiceDir + 'xferto.vox','@',0, nEndPos, true, ffVOX_PCM_8K);
    mMedia.PlayString(strDigits + '|' + 'C', '',true, ffVOX_PCM_8K, '','mm/dd/yyyy', 6);
    Caller.CallDone(naTransferToNumber, strDigits, atExtension, '', 0);

  except on e: Exception do
    begin
      Caller.SetStatus('Exception caught in CallOffering: ' + e.Message);
      raise;
    end;
  end;

  result := arOK;
end;

function TIVRPlug1.CallPlaced(const Caller: PluginCaller;
  CallProgress: CPType): HResult;
begin
  result := arOK;
end;

function TIVRPlug1.CallTerminated: HResult;
begin
  result := cpStopped;
end;

initialization
  TAutoObjectFactory.Create(ComServer, TIVRPlug1, Class_MyClass,
    ciMultiInstance, tmApartment);
end.
Delphi-Quellcode:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TfrmIVRPlugin1 = class(TForm)
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  frmIVRPlugin1: TfrmIVRPlugin1;

implementation

{$R *.dfm}

end.
Delphi-Quellcode:

unit Project1_TLB;

// ************************************************************************ //
// WARNUNG
// -------
// Die in dieser Datei deklarierten Typen wurden aus Daten einer Typbibliothek
// generiert. Wenn diese Typbibliothek explizit oder indirekt (über eine
// andere Typbibliothek) reimportiert wird oder wenn die Anweisung
// 'Aktualisieren' im Typbibliotheks-Editor während des Bearbeitens der
// Typbibliothek aktiviert ist, wird der Inhalt dieser Datei neu generiert und
// alle manuell vorgenommenen Änderungen gehen verloren.
// ************************************************************************ //

// PASTLWTR : 1.2
// Datei generiert am 14.05.2008 07:36:55 aus der unten beschriebenen Typbibliothek.

// ************************************************************************ //
// Typbib: C:\Program Files\Borland\Delphi7\Projects\IVRPLUGIN\IVRTest.tlb (1)
// LIBID: {7B60B193-CB21-4781-8916-71238AD0B614}
// LCID: 0
// Hilfedatei:
// Hilfe-String: Project1 Bibliothek
// DepndLst:
// (1) v5.0 TVIVRLib, (C:\Program Files\Common Files\Vertical\TeleVantage\tvivr.tlb)
// (2) v2.0 stdole, (C:\WINNT\system32\STDOLE2.TLB)
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit muß ohne Typüberprüfung für Zeiger compiliert werden.
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
interface

uses Windows, ActiveX, Classes, Graphics, StdVCL, TVIVRLib_TLB, Variants;
  

// *********************************************************************//
// In dieser Typbibliothek deklarierte GUIDS . Es werden folgende
// Präfixe verwendet:
// Typbibliotheken : LIBID_xxxx
// CoClasses : CLASS_xxxx
// DISPInterfaces : DIID_xxxx
// Nicht-DISP-Schnittstellen: IID_xxxx
// *********************************************************************//
const
  // Haupt- und Nebenversionen der Typbibliothek
  Project1MajorVersion = 1;
  Project1MinorVersion = 0;

  LIBID_Project1: TGUID = '{7B60B193-CB21-4781-8916-71238AD0B614}';

  CLASS_MyClass: TGUID = '{DBDC6719-F549-4B05-8502-F40046F73D23}';
type

// *********************************************************************//
// Deklaration von in der Typbibliothek definierten CoClasses
// (HINWEIS: Hier wird jede CoClass zu ihrer Standardschnittstelle
// zugewiesen)
// *********************************************************************//
  MyClass = PluginApplication;


// *********************************************************************//
// Die Klasse CoMyClass stellt die Methoden Create und CreateRemote zur
// Verfügung, um Instanzen der Standardschnittstelle PluginApplication, dargestellt von
// CoClass MyClass, zu erzeugen. Diese Funktionen können
// von einem Client verwendet werden, der die CoClasses automatisieren
// möchte, die von dieser Typbibliothek dargestellt werden.
// *********************************************************************//
  CoMyClass = class
    class function Create: PluginApplication;
    class function CreateRemote(const MachineName: string): PluginApplication;
  end;

implementation

uses ComObj;

class function CoMyClass.Create: PluginApplication;
begin
  Result := CreateComObject(CLASS_MyClass) as PluginApplication;
end;

class function CoMyClass.CreateRemote(const MachineName: string): PluginApplication;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_MyClass) as PluginApplication;
end;

end.
Delphi-Quellcode:

unit TVIVRLib_TLB;

// ************************************************************************ //
// WARNUNG
// -------
// Die in dieser Datei deklarierten Typen wurden aus Daten einer Typbibliothek
// generiert. Wenn diese Typbibliothek explizit oder indirekt (über eine
// andere Typbibliothek) reimportiert wird oder wenn die Anweisung
// 'Aktualisieren' im Typbibliotheks-Editor während des Bearbeitens der
// Typbibliothek aktiviert ist, wird der Inhalt dieser Datei neu generiert und
// alle manuell vorgenommenen Änderungen gehen verloren.
// ************************************************************************ //

// PASTLWTR : 1.2
// Datei generiert am 14.05.2008 07:36:55 aus der unten beschriebenen Typbibliothek.

// ************************************************************************ //
// Typbib: C:\Program Files\Common Files\Vertical\TeleVantage\tvivr.tlb (1)
// LIBID: {ECDF5A55-1E6C-11D3-80B5-00104B59E16D}
// LCID: 0
// Hilfedatei:
// Hilfe-String: TeleVantage 7.0 IVR Plug-in Library
// DepndLst:
// (1) v2.0 stdole, (C:\WINNT\system32\STDOLE2.TLB)
// Übergeordnete Typbibliothek:
// (0) v1.0 Project1, (C:\Program Files\Borland\Delphi7\Projects\IVRPLUGIN\IVRTest.tlb)
// Fehler
// Hinweis: Parameter 'Type' im PluginCaller.CallDone geändert zu 'Type_'
// Hinweis: Element 'Set' von 'PluginCaller' geändert zu 'Set_'
// Hinweis: Element 'Set' von 'PluginCallee' geändert zu 'Set_'
// Hinweis: Element 'Set' von 'PluginCaller' geändert zu 'Set_'
// Hinweis: Element 'Set' von 'PluginCallee' geändert zu 'Set_'
// Hinweis: Element 'Set' von 'PluginCaller' geändert zu 'Set_'
// Hinweis: Element 'Set' von 'PluginCallee' geändert zu 'Set_'
// Hinweis: Element 'Set' von 'PluginCaller' geändert zu 'Set_'
// Hinweis: Element 'Set' von 'PluginCallee' geändert zu 'Set_'
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit muß ohne Typüberprüfung für Zeiger compiliert werden.
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
interface

uses Windows, ActiveX, Classes, Graphics, StdVCL, Variants;
  

// *********************************************************************//
// In dieser Typbibliothek deklarierte GUIDS . Es werden folgende
// Präfixe verwendet:
// Typbibliotheken : LIBID_xxxx
// CoClasses : CLASS_xxxx
// DISPInterfaces : DIID_xxxx
// Nicht-DISP-Schnittstellen: IID_xxxx
// *********************************************************************//
const
  // Haupt- und Nebenversionen der Typbibliothek
  TVIVRLibMajorVersion = 5;
  TVIVRLibMinorVersion = 0;

  LIBID_TVIVRLib: TGUID = '{ECDF5A55-1E6C-11D3-80B5-00104B59E16D}';

  IID_IVRPlugInNotify: TGUID = '{1C23DC95-0C87-11D3-80B0-00104B59E16D}';
  IID_IVRPlugInNotify2: TGUID = '{ED7AD4E0-EEE5-11D3-811C-00104B59E16D}';
  IID_PluginMedia: TGUID = '{4A097B41-4179-11D4-B3F7-00500479174A}';
  IID_PluginCaller: TGUID = '{4A097B3C-4179-11D4-B3F7-00500479174A}';
  IID_PluginCallee: TGUID = '{4A097B4D-4179-11D4-B3F7-00500479174A}';
  IID_PluginApplication: TGUID = '{4A097B3E-4179-11D4-B3F7-00500479174A}';
  IID_PluginOutOfBandCallProgressMonitor: TGUID = '{4A097B5A-4179-11D4-B3F7-00500479174A}';
  IID_PluginApplicationOutbound: TGUID = '{4A097B50-4179-11D4-B3F7-00500479174A}';
  DIID_PluginOutOfBandCallProgressEvents: TGUID = '{4A097B59-4179-11D4-B3F7-00500479174A}';
  IID__PluginOutOfBandCallProgressEvents: TGUID = '{4A097B58-4179-11D4-B3F7-00500479174A}';
  IID_ITVPlugIn: TGUID = '{ECDF5A61-1E6C-11D3-80B5-00104B59E16D}';
  IID_IVRPlugIn2: TGUID = '{AF4EDF10-EEDD-11D3-811C-00104B59E16D}';
  CLASS_IVRPlugIn: TGUID = '{ECDF5A62-1E6C-11D3-80B5-00104B59E16D}';
  IID_IPluginServer: TGUID = '{4A097B3D-4179-11D4-B3F7-00500479174A}';
  CLASS_PluginServer: TGUID = '{826D21E4-4161-11D4-B3F7-00500479174A}';

// *********************************************************************//
// Deklaration von in der Typbibliothek definierten Enumerationen
// *********************************************************************//
// Konstanten für enum CPType
type
  CPType = TOleEnum;
const
  cpStopped = $00000001;
  cpConnected = $00000008;
  cpBusy = $00000009;
  cpNoRing = $0000000A;
  cpNoAnswer = $0000000B;
  cpOperatorIntercept = $0000000C;
  cpCallError = $0000000D;
  cpNoDialtone = $0000000E;
  cpFaxTone = $0000000F;
  cpRejected = $00000010;
  cpNoLoopCurrent = $00000011;
  cpUnassignedNumber = $00000012;
  cpDestOutOfOrder = $00000013;
  cpNetworkCongestion = $00000014;
  cpDestIncompatible = $00000015;
  cpDialed = $00000029;
  cpRingback = $0000002A;
  cpFaxOrModem = $0000002B;
  cpLoopcurrent = $0000002C;

// Konstanten für enum FileFormat
type
  FileFormat = TOleEnum;
const
  ffVOX_ADPCM_6K = $00000000;
  ffVOX_ADPCM_8K = $00000001;
  ffVOX_PCM_6K = $00000002;
  ffVOX_PCM_8K = $00000003;
  ffWAV_PCM_6K = $00000006;
  ffWAV_PCM_8K = $00000007;
  ffWAV_PCM_11K = $00000008;

// Konstanten für enum ActionResult
type
  ActionResult = TOleEnum;
const
  arRuntimeError = $FFFFFFFF;
  arOK = $00000000;
  arStopped = $00000001;
  arTermDigit = $00000002;
  arMaxSilence = $00000003;
  arMaxNonSilence = $00000004;
  arMaxDigits = $00000005;
  arTimeOut = $00000006;
  arTimeOutInterDigit = $00000007;
  arBusy = $00000008;
  arNoAnswer = $00000009;
  arNoRingBack = $0000000A;
  arConnected = $0000000B;
  arOperatorIntercept = $0000000C;
  arNoDialTone = $0000000D;
  arFaxOrModem = $0000000E;
  arCPAError = $0000000F;
  arCPAUnknown = $00000010;

// Konstanten für enum InterDigitStartConstants
type
  InterDigitStartConstants = TOleEnum;
const
  idsStartImmediate = $00000000;
  idsStartDelayed = $00000001;

// Konstanten für enum ToneId
type
  ToneId = TOleEnum;
const
  tidDialtone = $00000001;
  tidReorder = $00000002;
  tidBusy = $00000003;
  tidRingback1 = $00000004;
  tidRingback2 = $00000005;
  tidRingback1CallWait = $00000006;
  tidRingback2CallWait = $00000007;
  tidRecallDial = $00000008;
  tidIntercept = $00000009;
  tidCallWait1 = $0000000A;
  tidCallWait2 = $0000000B;
  tidBusyVerifyA = $0000000C;
  tidBusyVerifyB = $0000000D;
  tidExecOverride = $0000000E;
  tidFeatureConfirm = $0000000F;
  tidStutterDialtone = $00000010;

// Konstanten für enum ConnectTypeConstants
type
  ConnectTypeConstants = TOleEnum;
const
  ctUnknown = $00000000;
  ctCadenceBreak = $00000001;
  ctLoopCurrent = $00000002;
  ctVoice = $00000003;
  ctAnsweringMachine = $00000004;

// Konstanten für enum NextAction
type
  NextAction = TOleEnum;
const
  naHangup = $00000000;
  naTransferToNumber = $00000001;
  naTransferToVoiceMail = $00000002;
  naReturnToRoutingList = $00000003;
  naError = $00000004;

// Konstanten für enum AddressType
type
  AddressType = TOleEnum;
const
  atNone = $00000000;
  atTelephone = $00000001;
  atIP = $00000002;
  atStation = $00000003;
  atUser = $00000004;
  atExtension = $00000006;
  atPlugin = $00000008;
  atAutoAttendant = $00000009;
  atWorkgroup = $0000000A;
  atQueue = $0000000B;
  atDIDDigits = $0000000C;
  atUserDefaultLocation = $0000000D;
  atVoiceMail = $0000000E;
  atAccountLogin = $0000000F;
  atHoldMenu = $00000010;
  atUnparkMenu = $00000015;

// Konstanten für enum WaitForAudioResult
type
  WaitForAudioResult = TOleEnum;
const
  wfarTimeout = $00000000;
  wfarInbandCp = $00000001;
  wfarConnected = $00000002;
  wfarDisconnected = $00000003;
  wfarLocalDisconnect = $00000004;

// Konstanten für enum CallDisconnectReason
type
  CallDisconnectReason = TOleEnum;
const
  cdrUnknown = $00000000;
  cdrBusy = $00000001;
  cdrDestOutOfOrder = $00000002;
  cdrUnassignedNumber = $00000003;
  cdrNetworkCongestion = $00000004;
  cdrRejected = $00000005;
  cdrDestIncompatible = $00000006;
  cdrNoAnswer = $00000007;

// Konstanten für enum OutOfBandCallProgress
type
  OutOfBandCallProgress = TOleEnum;
const
  oobcpInitiated = $00000000;
  oobcpProceeding = $00000001;
  oobcpAlerting = $00000002;
  oobcpConnected = $00000003;
  oobcpDisconnected = $00000004;

// Konstanten für enum KeyType
type
  KeyType = TOleEnum;
const
  pdCallerIDNumber = $00000000;
  pdCallerIDName = $00000001;
  pdDIDNumber = $00000002;
  pdDeviceNumber = $00000003;
  pdLoggedInUserExt = $00000004;
  pdCallbackNumber = $00000005;
  pdCallbackAddressType = $00000006;
  pdCallbackAddressSubType = $00000007;
  pdCallbackAccessCode = $00000008;
  pdDetails = $00000009;
  pdCustomVariableName = $0000000A;
  pdCustomVariableValue = $0000000B;

// Konstanten für enum AddressSubType
type
  AddressSubType = TOleEnum;
const
  astUnknown = $00000000;
  astInternational = $00000001;
  astNational = $00000002;
  astNetwork = $00000003;
  astSubscriber = $00000004;
  astAbbreviated = $00000006;
  astReserved = $00000007;
  astUseServiceRules = $00000008;
  astPagerNumber = $00000010;

type

// *********************************************************************//
// Forward-Deklaration von in der Typbibliothek definierten Typen
// *********************************************************************//
  IVRPlugInNotify = interface;
  IVRPlugInNotifyDisp = dispinterface;
  IVRPlugInNotify2 = interface;
  IVRPlugInNotify2Disp = dispinterface;
  PluginMedia = interface;
  PluginMediaDisp = dispinterface;
  PluginCaller = interface;
  PluginCallerDisp = dispinterface;
  PluginCallee = interface;
  PluginApplication = interface;
  PluginOutOfBandCallProgressMonitor = interface;
  PluginApplicationOutbound = interface;
  PluginOutOfBandCallProgressEvents = dispinterface;
  _PluginOutOfBandCallProgressEvents = interface;
  ITVPlugIn = interface;
  ITVPlugInDisp = dispinterface;
  IVRPlugIn2 = interface;
  IVRPlugIn2Disp = dispinterface;
  IPluginServer = interface;
  IPluginServerDisp = dispinterface;

// *********************************************************************//
// Deklaration von in der Typbibliothek definierten CoClasses
// (HINWEIS: Hier wird jede CoClass zu ihrer Standardschnittstelle
// zugewiesen)
// *********************************************************************//
  IVRPlugIn = ITVPlugIn;
  PluginServer = IPluginServer;


// *********************************************************************//
// Deklaration von Strukturen, Unions und Aliasen.
// *********************************************************************//
  PUserType1 = ^TGUID; {*}


// *********************************************************************//
// Schnittstelle: IVRPlugInNotify
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {1C23DC95-0C87-11D3-80B0-00104B59E16D}
// *********************************************************************//
  IVRPlugInNotify = interface(IDispatch)
    ['{1C23DC95-0C87-11D3-80B0-00104B59E16D}']
    procedure CallOffering(hParty: Smallint; Line: Smallint); safecall;
    procedure CallTerminated(hParty: Smallint; Line: Smallint); safecall;
  end;

// *********************************************************************//
// DispIntf: IVRPlugInNotifyDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {1C23DC95-0C87-11D3-80B0-00104B59E16D}
// *********************************************************************//
  IVRPlugInNotifyDisp = dispinterface
    ['{1C23DC95-0C87-11D3-80B0-00104B59E16D}']
    procedure CallOffering(hParty: Smallint; Line: Smallint); dispid 1;
    procedure CallTerminated(hParty: Smallint; Line: Smallint); dispid 2;
  end;

// *********************************************************************//
// Schnittstelle: IVRPlugInNotify2
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {ED7AD4E0-EEE5-11D3-811C-00104B59E16D}
// *********************************************************************//
  IVRPlugInNotify2 = interface(IDispatch)
    ['{ED7AD4E0-EEE5-11D3-811C-00104B59E16D}']
    procedure CallOffering(hParty: Smallint; Line: Smallint); safecall;
    procedure CallTerminated(hParty: Smallint; Line: Smallint); safecall;
    procedure CallPlaced(hParty: Smallint; Line: Smallint; CallProgress: CPType); safecall;
  end;

// *********************************************************************//
// DispIntf: IVRPlugInNotify2Disp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {ED7AD4E0-EEE5-11D3-811C-00104B59E16D}
// *********************************************************************//
  IVRPlugInNotify2Disp = dispinterface
    ['{ED7AD4E0-EEE5-11D3-811C-00104B59E16D}']
    procedure CallOffering(hParty: Smallint; Line: Smallint); dispid 1;
    procedure CallTerminated(hParty: Smallint; Line: Smallint); dispid 2;
    procedure CallPlaced(hParty: Smallint; Line: Smallint; CallProgress: CPType); dispid 3;
  end;

// *********************************************************************//
// Schnittstelle: PluginMedia
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {4A097B41-4179-11D4-B3F7-00500479174A}
// *********************************************************************//
  PluginMedia = interface(IDispatch)
    ['{4A097B41-4179-11D4-B3F7-00500479174A}']
    procedure Stop; safecall;
    function PlayFile(const FileName: WideString; const TermDigits: WideString;
                      StartPosition: Integer; out EndPosition: Integer; ClearDigitBuffer: WordBool;
                      Format: FileFormat): ActionResult; safecall;
    function PlayString(const Value: WideString; const TermDigits: WideString;
                        ClearDigitBuffer: WordBool; Format: FileFormat;
                        const LanguageParams: WideString; const DateFormat: WideString;
                        NumericPrecision: Integer): ActionResult; safecall;
    function GetDigits(MaxDigits: Integer; const TermDigits: WideString; DigitsTimeOut: Integer;
                       InterDigitTimeOut: Integer; InterDigitStart: InterDigitStartConstants;
                       out Result: ActionResult): WideString; safecall;
    function FlushDigitBuffer: WideString; safecall;
    function RecordFile(const FileName: WideString; const TermDigits: WideString;
                        RecordTimeOut: Integer; StartPosition: Integer; out EndPosition: Integer;
                        ClearDigitBuffer: WordBool; RecordBeep: WordBool; Format: FileFormat;
                        MaxSilence: Integer; MaxNonSilence: Integer): ActionResult; safecall;
    function PlayTone(Tone: ToneId; const TermDigits: WideString; ToneTimeOut: Integer): ActionResult; safecall;
    procedure Dial(const DialString: WideString); safecall;
    function GetXmitTimeslot: Integer; safecall;
    procedure Listen(Timeslot: Integer); safecall;
    procedure SetVolume(Volume: Smallint); safecall;
    procedure SetRate(Rate: Smallint); safecall;
    function GetCallProgress(CallTimeOut: Integer; out ConnectLength: Integer;
                             out ConnectType: ConnectTypeConstants): ActionResult; safecall;
  end;

// *********************************************************************//
// DispIntf: PluginMediaDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {4A097B41-4179-11D4-B3F7-00500479174A}
// *********************************************************************//
  PluginMediaDisp = dispinterface
    ['{4A097B41-4179-11D4-B3F7-00500479174A}']
    procedure Stop; dispid 1;
    function PlayFile(const FileName: WideString; const TermDigits: WideString;
                      StartPosition: Integer; out EndPosition: Integer; ClearDigitBuffer: WordBool;
                      Format: FileFormat): ActionResult; dispid 2;
    function PlayString(const Value: WideString; const TermDigits: WideString;
                        ClearDigitBuffer: WordBool; Format: FileFormat;
                        const LanguageParams: WideString; const DateFormat: WideString;
                        NumericPrecision: Integer): ActionResult; dispid 3;
    function GetDigits(MaxDigits: Integer; const TermDigits: WideString; DigitsTimeOut: Integer;
                       InterDigitTimeOut: Integer; InterDigitStart: InterDigitStartConstants;
                       out Result: ActionResult): WideString; dispid 4;
    function FlushDigitBuffer: WideString; dispid 5;
    function RecordFile(const FileName: WideString; const TermDigits: WideString;
                        RecordTimeOut: Integer; StartPosition: Integer; out EndPosition: Integer;
                        ClearDigitBuffer: WordBool; RecordBeep: WordBool; Format: FileFormat;
                        MaxSilence: Integer; MaxNonSilence: Integer): ActionResult; dispid 6;
    function PlayTone(Tone: ToneId; const TermDigits: WideString; ToneTimeOut: Integer): ActionResult; dispid 7;
    procedure Dial(const DialString: WideString); dispid 8;
    function GetXmitTimeslot: Integer; dispid 9;
    procedure Listen(Timeslot: Integer); dispid 10;
    procedure SetVolume(Volume: Smallint); dispid 11;
    procedure SetRate(Rate: Smallint); dispid 12;
    function GetCallProgress(CallTimeOut: Integer; out ConnectLength: Integer;
                             out ConnectType: ConnectTypeConstants): ActionResult; dispid 13;
  end;

// *********************************************************************//
// Schnittstelle: PluginCaller
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {4A097B3C-4179-11D4-B3F7-00500479174A}
// *********************************************************************//
  PluginCaller = interface(IDispatch)
    ['{4A097B3C-4179-11D4-B3F7-00500479174A}']
    procedure CallDone(Action: NextAction; const Number: WideString; Type_: AddressType;
                       const AccessCode: WideString; SubType: Integer); safecall;
    procedure Ping; safecall;
    procedure SetStatus(const Status: WideString); safecall;
    function GetXmitTimeslot: Integer; safecall;
    procedure Listen(Timeslot: Integer); safecall;
    function GetMedia(ExtraInfo: OleVariant): PluginMedia; safecall;
    function GetDevice(ExtraInfo: OleVariant): WideString; safecall;
    procedure ReleaseDevice; safecall;
    function Get_PluginExtension: WideString; safecall;
    function Get_PluginDID: WideString; safecall;
    function Get_PluginName: WideString; safecall;
    function Get_PluginComments: WideString; safecall;
    function Get_PluginVariable: WideString; safecall;
    function Get_DeviceName: WideString; safecall;
    procedure Set_(const PropertyName: WideString; Value: OleVariant); safecall;
    function Get(const PropertyName: WideString; DefaultValue: OleVariant): OleVariant; safecall;
    function AssociateExtension(const Extension: WideString): WordBool; safecall;
    function AssociateCallerId(const CallerIdNumber: WideString; const CallerIdName: WideString;
                               const ExtensionContext: WideString): WordBool; safecall;
    function Exists(const PropertyName: WideString): WordBool; safecall;
    procedure Delete(const PropertyName: WideString); safecall;
    function AssociateCalledExtension(const Extension: WideString): WordBool; safecall;
    function AssociateCalledCallerId(const CallerIdNumber: WideString;
                                     const CallerIdName: WideString;
                                     const ExtensionContext: WideString): WordBool; safecall;
    function AssociateExtensionEx(const Extension: WideString; MarkAuthenticated: WordBool): WordBool; safecall;
    property PluginExtension: WideString read Get_PluginExtension;
    property PluginDID: WideString read Get_PluginDID;
    property PluginName: WideString read Get_PluginName;
    property PluginComments: WideString read Get_PluginComments;
    property PluginVariable: WideString read Get_PluginVariable;
    property DeviceName: WideString read Get_DeviceName;
  end;

// *********************************************************************//
// DispIntf: PluginCallerDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {4A097B3C-4179-11D4-B3F7-00500479174A}
// *********************************************************************//
  PluginCallerDisp = dispinterface
    ['{4A097B3C-4179-11D4-B3F7-00500479174A}']
    procedure CallDone(Action: NextAction; const Number: WideString; Type_: AddressType;
                       const AccessCode: WideString; SubType: Integer); dispid 1;
    procedure Ping; dispid 6;
    procedure SetStatus(const Status: WideString); dispid 7;
    function GetXmitTimeslot: Integer; dispid 8;
    procedure Listen(Timeslot: Integer); dispid 9;
    function GetMedia(ExtraInfo: OleVariant): PluginMedia; dispid 10;
    function GetDevice(ExtraInfo: OleVariant): WideString; dispid 11;
    procedure ReleaseDevice; dispid 12;
    property PluginExtension: WideString readonly dispid 13;
    property PluginDID: WideString readonly dispid 14;
    property PluginName: WideString readonly dispid 15;
    property PluginComments: WideString readonly dispid 16;
    property PluginVariable: WideString readonly dispid 17;
    property DeviceName: WideString readonly dispid 18;
    procedure Set_(const PropertyName: WideString; Value: OleVariant); dispid 19;
    function Get(const PropertyName: WideString; DefaultValue: OleVariant): OleVariant; dispid 20;
    function AssociateExtension(const Extension: WideString): WordBool; dispid 21;
    function AssociateCallerId(const CallerIdNumber: WideString; const CallerIdName: WideString;
                               const ExtensionContext: WideString): WordBool; dispid 22;
    function Exists(const PropertyName: WideString): WordBool; dispid 23;
    procedure Delete(const PropertyName: WideString); dispid 24;
    function AssociateCalledExtension(const Extension: WideString): WordBool; dispid 25;
    function AssociateCalledCallerId(const CallerIdNumber: WideString;
                                     const CallerIdName: WideString;
                                     const ExtensionContext: WideString): WordBool; dispid 26;
    function AssociateExtensionEx(const Extension: WideString; MarkAuthenticated: WordBool): WordBool; dispid 27;
  end;

// *********************************************************************//
// Schnittstelle: PluginCallee
// Flags: (256) OleAutomation
// GUID: {4A097B4D-4179-11D4-B3F7-00500479174A}
// *********************************************************************//
  PluginCallee = interface(IUnknown)
    ['{4A097B4D-4179-11D4-B3F7-00500479174A}']
    function Set_(const PropertyName: WideString; Value: OleVariant): HResult; stdcall;
    function Get(const PropertyName: WideString; DefaultValue: OleVariant; out Value: OleVariant): HResult; stdcall;
    function AssociateExtension(const Extension: WideString; out Associated: WordBool): HResult; stdcall;
    function AssociateCallerId(const CallerIdNumber: WideString; const CallerIdName: WideString;
                               const ExtensionContext: WideString; out Associated: WordBool): HResult; stdcall;
    function Exists(const PropertyName: WideString; out Exists: WordBool): HResult; stdcall;
    function Delete(const PropertyName: WideString): HResult; stdcall;
    function AssociateCalledExtension(const Extension: WideString; out Associated: WordBool): HResult; stdcall;
    function AssociateCalledCallerId(const CallerIdNumber: WideString;
                                     const CallerIdName: WideString;
                                     const ExtensionContext: WideString; out Associated: WordBool): HResult; stdcall;
  end;

// *********************************************************************//
// Schnittstelle: PluginApplication
// Flags: (256) OleAutomation
// GUID: {4A097B3E-4179-11D4-B3F7-00500479174A}
// *********************************************************************//
  PluginApplication = interface(IUnknown)
    ['{4A097B3E-4179-11D4-B3F7-00500479174A}']
    function CallOffering(const Caller: PluginCaller): HResult; stdcall;
    function CallTerminated: HResult; stdcall;
    function CallPlaced(const Caller: PluginCaller; CallProgress: CPType): HResult; stdcall;
  end;

// *********************************************************************//
// Schnittstelle: PluginOutOfBandCallProgressMonitor
// Flags: (256) OleAutomation
// GUID: {4A097B5A-4179-11D4-B3F7-00500479174A}
// *********************************************************************//
  PluginOutOfBandCallProgressMonitor = interface(IUnknown)
    ['{4A097B5A-4179-11D4-B3F7-00500479174A}']
    function WaitForAudio(TimeoutInMilliseconds: Integer; out Result: WaitForAudioResult): HResult; stdcall;
    function GetDisconnectReason(out DisconnectReason: CallDisconnectReason): HResult; stdcall;
    function MonitorCallProgress(const PluginOutOfBandCallProgressEvents: IDispatch): HResult; stdcall;
  end;

// *********************************************************************//
// Schnittstelle: PluginApplicationOutbound
// Flags: (256) OleAutomation
// GUID: {4A097B50-4179-11D4-B3F7-00500479174A}
// *********************************************************************//
  PluginApplicationOutbound = interface(IUnknown)
    ['{4A097B50-4179-11D4-B3F7-00500479174A}']
  end;

// *********************************************************************//
// DispIntf: PluginOutOfBandCallProgressEvents
// Flags: (4096) Dispatchable
// GUID: {4A097B59-4179-11D4-B3F7-00500479174A}
// *********************************************************************//
  PluginOutOfBandCallProgressEvents = dispinterface
    ['{4A097B59-4179-11D4-B3F7-00500479174A}']
    procedure CallProgressIndication(CallProgressState: OutOfBandCallProgress; ExtraData: OleVariant); dispid 101;
  end;

// *********************************************************************//
// Schnittstelle: _PluginOutOfBandCallProgressEvents
// Flags: (16) Hidden
// GUID: {4A097B58-4179-11D4-B3F7-00500479174A}
// *********************************************************************//
  _PluginOutOfBandCallProgressEvents = interface(IUnknown)
    ['{4A097B58-4179-11D4-B3F7-00500479174A}']
    function CallProgressIndication(CallProgressState: OutOfBandCallProgress; ExtraData: OleVariant): HResult; stdcall;
  end;

// *********************************************************************//
// Schnittstelle: ITVPlugIn
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {ECDF5A61-1E6C-11D3-80B5-00104B59E16D}
// *********************************************************************//
  ITVPlugIn = interface(IDispatch)
    ['{ECDF5A61-1E6C-11D3-80B5-00104B59E16D}']
    procedure CallDone(hParty: Smallint; NextActionConstants: NextAction;
                       const DialString: WideString); safecall;
    procedure SetCustomPartyData(hParty: Smallint; const KeyName: WideString;
                                 const Value: WideString); safecall;
    function GetCustomPartyData(hParty: Smallint; const KeyName: WideString): WideString; safecall;
    procedure SetPartyData(hParty: Smallint; StandardKeyConstants: KeyType; const Value: WideString); safecall;
    function GetPartyData(hParty: Smallint; StandardKeyConstants: KeyType): WideString; safecall;
    procedure Ping(hParty: Smallint); safecall;
    procedure SetStatus(hParty: Smallint; const Status: WideString); safecall;
    function GetXmitTimeslot(hParty: Smallint): Integer; safecall;
    procedure Listen(hParty: Smallint; Timeslot: Integer); safecall;
  end;

// *********************************************************************//
// DispIntf: ITVPlugInDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {ECDF5A61-1E6C-11D3-80B5-00104B59E16D}
// *********************************************************************//
  ITVPlugInDisp = dispinterface
    ['{ECDF5A61-1E6C-11D3-80B5-00104B59E16D}']
    procedure CallDone(hParty: Smallint; NextActionConstants: NextAction;
                       const DialString: WideString); dispid 1;
    procedure SetCustomPartyData(hParty: Smallint; const KeyName: WideString;
                                 const Value: WideString); dispid 2;
    function GetCustomPartyData(hParty: Smallint; const KeyName: WideString): WideString; dispid 3;
    procedure SetPartyData(hParty: Smallint; StandardKeyConstants: KeyType; const Value: WideString); dispid 4;
    function GetPartyData(hParty: Smallint; StandardKeyConstants: KeyType): WideString; dispid 5;
    procedure Ping(hParty: Smallint); dispid 6;
    procedure SetStatus(hParty: Smallint; const Status: WideString); dispid 7;
    function GetXmitTimeslot(hParty: Smallint): Integer; dispid 8;
    procedure Listen(hParty: Smallint; Timeslot: Integer); dispid 9;
  end;

// *********************************************************************//
// Schnittstelle: IVRPlugIn2
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {AF4EDF10-EEDD-11D3-811C-00104B59E16D}
// *********************************************************************//
  IVRPlugIn2 = interface(IDispatch)
    ['{AF4EDF10-EEDD-11D3-811C-00104B59E16D}']
    procedure CallDone(hParty: Smallint; NextActionConstants: NextAction;
                       const DialString: WideString); safecall;
    procedure SetCustomPartyData(hParty: Smallint; const KeyName: WideString;
                                 const Value: WideString); safecall;
    function GetCustomPartyData(hParty: Smallint; const KeyName: WideString): WideString; safecall;
    procedure SetPartyData(hParty: Smallint; StandardKeyConstants: KeyType; const Value: WideString); safecall;
    function GetPartyData(hParty: Smallint; StandardKeyConstants: KeyType): WideString; safecall;
    procedure Ping(hParty: Smallint); safecall;
    procedure SetStatus(hParty: Smallint; const Status: WideString); safecall;
    function GetXmitTimeslot(hParty: Smallint): Integer; safecall;
    procedure Listen(hParty: Smallint; Timeslot: Integer); safecall;
    function PlaceCall(const AccessCode: WideString; const DialString: WideString;
                       const Extension: WideString; SubType: AddressSubType;
                       const InitialData: WideString; CallProgress: Smallint): Smallint; safecall;
    procedure Register(const ProgId: WideString); safecall;
    function Get_Extension: WideString; safecall;
    function Get_DID: WideString; safecall;
    function Get_Name: WideString; safecall;
    function Get_Comments: WideString; safecall;
    function Get_CustomVariableName: WideString; safecall;
    function Get_CustomVariableValue: WideString; safecall;
    property Extension: WideString read Get_Extension;
    property DID: WideString read Get_DID;
    property Name: WideString read Get_Name;
    property Comments: WideString read Get_Comments;
    property CustomVariableName: WideString read Get_CustomVariableName;
    property CustomVariableValue: WideString read Get_CustomVariableValue;
  end;

// *********************************************************************//
// DispIntf: IVRPlugIn2Disp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {AF4EDF10-EEDD-11D3-811C-00104B59E16D}
// *********************************************************************//
  IVRPlugIn2Disp = dispinterface
    ['{AF4EDF10-EEDD-11D3-811C-00104B59E16D}']
    procedure CallDone(hParty: Smallint; NextActionConstants: NextAction;
                       const DialString: WideString); dispid 1;
    procedure SetCustomPartyData(hParty: Smallint; const KeyName: WideString;
                                 const Value: WideString); dispid 2;
    function GetCustomPartyData(hParty: Smallint; const KeyName: WideString): WideString; dispid 3;
    procedure SetPartyData(hParty: Smallint; StandardKeyConstants: KeyType; const Value: WideString); dispid 4;
    function GetPartyData(hParty: Smallint; StandardKeyConstants: KeyType): WideString; dispid 5;
    procedure Ping(hParty: Smallint); dispid 6;
    procedure SetStatus(hParty: Smallint; const Status: WideString); dispid 7;
    function GetXmitTimeslot(hParty: Smallint): Integer; dispid 8;
    procedure Listen(hParty: Smallint; Timeslot: Integer); dispid 9;
    function PlaceCall(const AccessCode: WideString; const DialString: WideString;
                       const Extension: WideString; SubType: AddressSubType;
                       const InitialData: WideString; CallProgress: Smallint): Smallint; dispid 10;
    procedure Register(const ProgId: WideString); dispid 11;
    property Extension: WideString readonly dispid 12;
    property DID: WideString readonly dispid 13;
    property Name: WideString readonly dispid 14;
    property Comments: WideString readonly dispid 15;
    property CustomVariableName: WideString readonly dispid 16;
    property CustomVariableValue: WideString readonly dispid 17;
  end;

// *********************************************************************//
// Schnittstelle: IPluginServer
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {4A097B3D-4179-11D4-B3F7-00500479174A}
// *********************************************************************//
  IPluginServer = interface(IDispatch)
    ['{4A097B3D-4179-11D4-B3F7-00500479174A}']
    function PlaceCall(const AccessCode: WideString; const DialString: WideString;
                       const Extension: WideString; SubType: Integer; const InitialData: WideString): Integer; safecall;
  end;

// *********************************************************************//
// DispIntf: IPluginServerDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {4A097B3D-4179-11D4-B3F7-00500479174A}
// *********************************************************************//
  IPluginServerDisp = dispinterface
    ['{4A097B3D-4179-11D4-B3F7-00500479174A}']
    function PlaceCall(const AccessCode: WideString; const DialString: WideString;
                       const Extension: WideString; SubType: Integer; const InitialData: WideString): Integer; dispid 1;
  end;

// *********************************************************************//
// Die Klasse CoIVRPlugIn stellt die Methoden Create und CreateRemote zur
// Verfügung, um Instanzen der Standardschnittstelle ITVPlugIn, dargestellt von
// CoClass IVRPlugIn, zu erzeugen. Diese Funktionen können
// von einem Client verwendet werden, der die CoClasses automatisieren
// möchte, die von dieser Typbibliothek dargestellt werden.
// *********************************************************************//
  CoIVRPlugIn = class
    class function Create: ITVPlugIn;
    class function CreateRemote(const MachineName: string): ITVPlugIn;
  end;

// *********************************************************************//
// Die Klasse CoPluginServer stellt die Methoden Create und CreateRemote zur
// Verfügung, um Instanzen der Standardschnittstelle IPluginServer, dargestellt von
// CoClass PluginServer, zu erzeugen. Diese Funktionen können
// von einem Client verwendet werden, der die CoClasses automatisieren
// möchte, die von dieser Typbibliothek dargestellt werden.
// *********************************************************************//
  CoPluginServer = class
    class function Create: IPluginServer;
    class function CreateRemote(const MachineName: string): IPluginServer;
  end;

implementation

uses ComObj;

class function CoIVRPlugIn.Create: ITVPlugIn;
begin
  Result := CreateComObject(CLASS_IVRPlugIn) as ITVPlugIn;
end;

class function CoIVRPlugIn.CreateRemote(const MachineName: string): ITVPlugIn;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_IVRPlugIn) as ITVPlugIn;
end;

class function CoPluginServer.Create: IPluginServer;
begin
  Result := CreateComObject(CLASS_PluginServer) as IPluginServer;
end;

class function CoPluginServer.CreateRemote(const MachineName: string): IPluginServer;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_PluginServer) as IPluginServer;
end;

end.
ich hoffe das ist so ok
ich weiss, das ich nichts weiss!
  Mit Zitat antworten Zitat