unit VaxServerVoAILib_TLB;

// ************************************************************************ //
// WARNING                                                                    
// -------                                                                    
// The types declared in this file were generated from data read from a       
// Type Library. If this type library is explicitly or indirectly (via        
// another type library referring to this type library) re-imported, or the   
// 'Refresh' command of the Type Library Editor activated while editing the   
// Type Library, the contents of this file will be regenerated and all        
// manual modifications will be lost.                                         
// ************************************************************************ //

// $Rev: 122765 $
// File generated on 16/1/2026 5:33:46 PM from Type Library described below.

// ************************************************************************  //
// Type Lib: C:\VaxServerCOM\VaxServerVoAI.dll (1)
// LIBID: {7D724F72-E8CE-4F0D-B0E7-3755CF194180}
// LCID: 0
// Helpfile: 
// DepndLst:
//   (1) v2.0 stdole, (C:\Windows\SysWOW64\stdole2.tlb)
// SYS_KIND: SYS_WIN64
// Errors:
//   Error creating palette bitmap of (TServerLibVoAI) : No Server registered for this CoClass
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. 
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
{$ALIGN 4}

interface

uses Winapi.Windows, System.Classes, System.Variants, System.Win.StdVCL, Vcl.Graphics, Vcl.OleServer, Winapi.ActiveX;
  

// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:        
//   Type Libraries     : LIBID_xxxx                                      
//   CoClasses          : CLASS_xxxx                                      
//   DISPInterfaces     : DIID_xxxx                                       
//   Non-DISP interfaces: IID_xxxx                                        
// *********************************************************************//
const
  // TypeLibrary Major and minor versions
  VaxServerVoAILibMajorVersion = 1;
  VaxServerVoAILibMinorVersion = 0;

  LIBID_VaxServerVoAILib: TGUID = '{7D724F72-E8CE-4F0D-B0E7-3755CF194180}';

  DIID__IServerLibVoAIEvents: TGUID = '{61C8315F-1FD2-4E04-8DA4-3B598BC426A1}';
  IID_IServerLibVoAI: TGUID = '{6390067F-595D-4B45-89B1-C8E87B41545F}';
  CLASS_ServerLibVoAI: TGUID = '{10C163D0-E66E-4685-A9BD-8BF5D4989220}';
type

// *********************************************************************//
// Forward declaration of types defined in TypeLibrary                    
// *********************************************************************//
  _IServerLibVoAIEvents = dispinterface;
  IServerLibVoAI = interface;
  IServerLibVoAIDisp = dispinterface;

// *********************************************************************//
// Declaration of CoClasses defined in Type Library                       
// (NOTE: Here we map each CoClass to its Default Interface)              
// *********************************************************************//
  ServerLibVoAI = IServerLibVoAI;


// *********************************************************************//
// DispIntf:  _IServerLibVoAIEvents
// Flags:     (4096) Dispatchable
// GUID:      {61C8315F-1FD2-4E04-8DA4-3B598BC426A1}
// *********************************************************************//
  _IServerLibVoAIEvents = dispinterface
    ['{61C8315F-1FD2-4E04-8DA4-3B598BC426A1}']
    function OnRegisterUser(const UserName: WideString; const Domain: WideString; 
                            const UserAgent: WideString; const FromIP: WideString; 
                            FromPort: Integer; RegId: Largeuint): HResult; dispid 1;
    function OnRegisterUserSuccess(const UserName: WideString; const FromIP: WideString; 
                                   FromPort: Integer; RegId: Largeuint): HResult; dispid 2;
    function OnRegisterUserFailed(const UserName: WideString; const FromIP: WideString; 
                                  FromPort: Integer; RegId: Largeuint): HResult; dispid 3;
    function OnUnRegisterUser(const UserName: WideString): HResult; dispid 4;
    function OnCallSessionCreated(SessionId: Largeuint; ReasonCode: Integer): HResult; dispid 5;
    function OnCallSessionClosed(SessionId: Largeuint; ReasonCode: Integer): HResult; dispid 6;
    function OnCallSessionConnecting(SessionId: Largeuint; StatusCode: Integer; 
                                     const ReasonPhrase: WideString): HResult; dispid 7;
    function OnCallSessionFailed(SessionId: Largeuint; StatusCode: Integer; 
                                 const ReasonPhrase: WideString; const Contact: WideString): HResult; dispid 8;
    function OnCallSessionConnected(SessionId: Largeuint): HResult; dispid 9;
    function OnIncomingCall(SessionId: Largeuint; const CallerName: WideString; 
                            const CallerId: WideString; const DialNo: WideString; 
                            FromPeerType: Integer; const FromPeerName: WideString; 
                            const UserAgent: WideString; const FromIP: WideString; FromPort: Integer): HResult; dispid 10;
    function OnCallSessionLost(SessionId: Largeuint): HResult; dispid 11;
    function OnCallSessionHangup(SessionId: Largeuint): HResult; dispid 12;
    function OnCallSessionTimeout(SessionId: Largeuint): HResult; dispid 13;
    function OnCallSessionCancelled(SessionId: Largeuint): HResult; dispid 14;
    function OnChatMessageText(ChatMsgId: Largeuint; const MsgFrom: WideString; 
                               const MsgTo: WideString; const MsgText: WideString; 
                               FromPeerType: Integer; const FromPeerName: WideString; 
                               const FromIP: WideString; FromPort: Integer): HResult; dispid 15;
    function OnChatMessageSuccess(ChatMsgId: Largeuint): HResult; dispid 16;
    function OnChatMessageFailed(ChatMsgId: Largeuint; StatusId: Integer; 
                                 const ReasonPhrase: WideString): HResult; dispid 17;
    function OnChatMessageTimeout(ChatMsgId: Largeuint): HResult; dispid 18;
    function OnVaxFunctionCallOpenAI(SessionId: Largeuint; const FuncName: WideString; 
                                     const CallId: WideString; 
                                     ParamNames: {NOT_OLEAUTO(PSafeArray)}OleVariant; 
                                     ParamValues: {NOT_OLEAUTO(PSafeArray)}OleVariant): HResult; dispid 19;
    function OnVaxSessionUpdatedOpenAI(SessionId: Largeuint): HResult; dispid 20;
    function OnVaxAudioOutputTranscriptOpenAI(SessionId: Largeuint; const Transcript: WideString): HResult; dispid 21;
    function OnVaxResponseDoneUsageOpenAI(SessionId: Largeuint; TotalTokens: Integer; 
                                          InputTokens: Integer; OutputTokens: Integer): HResult; dispid 22;
    function OnVaxStatusOpenAI(SessionId: Largeuint; StatusId: Integer; const tatus: WideString): HResult; dispid 23;
    function OnVaxErrorOpenAI(SessionId: Largeuint; const Msg: WideString): HResult; dispid 24;
    function OnLineRegisterTrying(const LineName: WideString): HResult; dispid 25;
    function OnLineRegisterFailed(const LineName: WideString; StatusCode: Integer; 
                                  const ReasonPhrase: WideString): HResult; dispid 26;
    function OnLineRegisterSuccess(const LineName: WideString): HResult; dispid 27;
    function OnLineUnRegisterTrying(const LineName: WideString): HResult; dispid 28;
    function OnLineUnRegisterFailed(const LineName: WideString; StatusCode: Integer; 
                                    const ReasonPhrase: WideString): HResult; dispid 29;
    function OnLineUnRegisterSuccess(const LineName: WideString): HResult; dispid 30;
    function OnAttackDetectedScanSIP(const ReqMethod: WideString; const AddrIP: WideString; 
                                     AddrPort: Integer; AddrType: Integer): HResult; dispid 31;
    function OnAttackDetectedFloodSIP(const AddrIP: WideString; AddrPort: Integer; AddrType: Integer): HResult; dispid 32;
    function OnAttackDetectedBruteForceSIP(const ReqMethod: WideString; AuthFailureCount: Integer; 
                                           const AddrIP: WideString; AddrPort: Integer; 
                                           AddrType: Integer): HResult; dispid 33;
    function OnSendReqTransferCallTimeout(SessionId: Largeuint): HResult; dispid 34;
    function OnSendReqTransferCallAccepted(SessionId: Largeuint): HResult; dispid 35;
    function OnSendReqTransferCallFailed(SessionId: Largeuint; StatusCode: Integer; 
                                         const ReasonPhrase: WideString): HResult; dispid 36;
    function OnServerConnectingREC(SessionId: Largeuint; StatusCode: Integer; 
                                   const ReasonPhrase: WideString): HResult; dispid 37;
    function OnServerConnectedREC(SessionId: Largeuint): HResult; dispid 38;
    function OnServerFailedREC(SessionId: Largeuint; StatusCode: Integer; 
                               const ReasonPhrase: WideString): HResult; dispid 39;
    function OnServerTimeoutREC(SessionId: Largeuint): HResult; dispid 40;
    function OnServerHungupREC(SessionId: Largeuint): HResult; dispid 41;
    function OnVaxVectorSearchStartedOpenAI(SessionId: Largeuint; const earchName: WideString; 
                                            const Query: WideString): HResult; dispid 42;
    function OnVaxVectorSearchTryingOpenAI(SessionId: Largeuint; const earchName: WideString): HResult; dispid 43;
    function OnVaxVectorSearchSuccessOpenAI(SessionId: Largeuint; const earchName: WideString; 
                                            const Content: WideString): HResult; dispid 44;
    function OnVaxVectorSearchFailedOpenAI(SessionId: Largeuint; const earchName: WideString; 
                                           const Msg: WideString): HResult; dispid 45;
    function OnCallSessionErrorLog(SessionId: Largeuint; ErrorCode: Integer; 
                                   const ErrorMsg: WideString): HResult; dispid 46;
    function OnVaxErrorLog(const FuncName: WideString; ErrorCode: Integer; 
                           const ErrorMsg: WideString): HResult; dispid 47;

    function OnVaxAudioInputTranscriptOpenAI(SessionId: Largeuint; const Transcript: WideString): HResult; dispid 48;
  end;

// *********************************************************************//
// Interface: IServerLibVoAI
// Flags:     (4544) Dual NonExtensible OleAutomation Dispatchable
// GUID:      {6390067F-595D-4B45-89B1-C8E87B41545F}
// *********************************************************************//
  IServerLibVoAI = interface(IDispatch)
    ['{6390067F-595D-4B45-89B1-C8E87B41545F}']
    function GetVaxErrorCode: Integer; safecall;
    function GetVaxErrorText: WideString; safecall;
    function GetVersionFile: WideString; safecall;
    function GetVersionSDK: WideString; safecall;
    procedure SetLicenseKey(const LicenseKey: WideString); safecall;
    function Initialize(const DomainRealm: WideString): WordBool; safecall;
    procedure UnInitialize; safecall;
    function SetListenPortRangeRTP(ListenStartPort: Integer; ListenEndPort: Integer): WordBool; safecall;
    function SetNetworkMediaRTP(const ListenIP: WideString; ListenStartPort: Integer): WordBool; safecall;
    function CryptoMediaNONE(Forced: WordBool): WordBool; safecall;
    function CryptoMediaSDP(Forced: WordBool): WordBool; safecall;
    function AddNetworkRouteSIP(const AssignedIP: WideString; const RouterIP: WideString): WordBool; safecall;
    function AddNetworkRouteRTP(const AssignedIP: WideString; const RouterIP: WideString): WordBool; safecall;
    function OpenNetworkUDP(const ListenIP: WideString; ListenPort: Integer): WordBool; safecall;
    function OpenNetworkTCP(const ListenIP: WideString; ListenPort: Integer): WordBool; safecall;
    function OpenNetworkTLS(const ListenIP: WideString; ListenPort: Integer; 
                            const CertPEM: WideString): WordBool; safecall;
    procedure CloseNetworkUDP; safecall;
    procedure CloseNetworkTCP; safecall;
    procedure CloseNetworkTLS; safecall;
    function AddUser(const UserName: WideString; const Password: WideString; 
                     const AudioCodecList: WideString): WordBool; safecall;
    procedure RemoveUser(const UserName: WideString); safecall;
    function RegisterUserExpiry(Expiry: Integer): WordBool; safecall;
    function AttachRegister(RegId: Largeuint; const UserName: WideString): WordBool; safecall;
    function AcceptRegister(RegId: Largeuint): WordBool; safecall;
    function RejectRegister(RegId: Largeuint; StatusCode: Integer; const ReasonPhrase: WideString): WordBool; safecall;
    function AuthRegister(RegId: Largeuint): WordBool; safecall;
    function AddLine(const LineName: WideString; LineType: Integer; const DisplayName: WideString; 
                     const UserName: WideString; const AuthLogin: WideString; 
                     const AuthPwd: WideString; const DomainRealm: WideString; 
                     const ServerAddr: WideString; ServerPort: Integer; 
                     const AudioCodecList: WideString): WordBool; safecall;
    procedure RemoveLine(const LineName: WideString); safecall;
    function RegisterLine(const LineName: WideString; Expire: Integer): WordBool; safecall;
    function UnRegisterLine(const LineName: WideString): WordBool; safecall;
    function AcceptCallSession(SessionId: Largeuint; Timeout: Integer; const KeyOpenAI: WideString;
                               const Prompt: WideString; const Model: WideString; const Voice: WideString;
                               OutputAudioSpeed: Double): WordBool; safecall;
    function RejectCallSession(SessionId: Largeuint; StatusCode: Integer; 
                               const ReasonPhrase: WideString): WordBool; safecall;
    function CloseCallSession(SessionId: Largeuint): WordBool; safecall;
    function DialCallSession(const CallerName: WideString; const CallerId: WideString; 
                             const DialNo: WideString; const ToPeerName: WideString; 
                             Timeout: Integer): Largeuint; safecall;
    function CallSessionSendStatusResponse(SessionId: Largeuint; StatusCode: Integer; 
                                           const ReasonPhrase: WideString; 
                                           const ContactURI: WideString): WordBool; safecall;
    function SendReqTransferCallBlind(SessionId: Largeuint; const ToUserName: WideString): WordBool; safecall;
    function SendReqTransferCallConsult(SessionId: Largeuint; ToSessionId: Largeuint): WordBool; safecall;
    function AcceptChatMessage(ChatMsgId: Largeuint; const ToPeerName: WideString): WordBool; safecall;
    procedure RejectChatMessage(ChatMsgId: Largeuint; StatusCode: Integer; 
                                const ReasonPhrase: WideString); safecall;
    function SendChatMessageText(const MsgFrom: WideString; const MsgTo: WideString; 
                                 const MsgText: WideString; const ToPeerName: WideString): Largeuint; safecall;
    function AudioSessionLost(Enable: WordBool; Timeout: Integer): WordBool; safecall;
    function SetUserAgentName(const Name: WideString): WordBool; safecall;
    function GetUserAgentName: WideString; safecall;
    function SetSessionNameSDP(const Name: WideString): WordBool; safecall;
    function GetSessionNameSDP: WideString; safecall;
    function SendDigitDTMF(SessionId: Largeuint; const DigitDTMF: WideString; TypeDTMF: Integer): WordBool; safecall;
    function DetectDigitDTMF(SessionId: Largeuint; TypeDTMF: Integer; Enable: WordBool; 
                             MilliSecTimeout: Integer): WordBool; safecall;
    function ActivateSemanticVAD(SessionId: Largeuint; const Eagerness: WideString): WordBool; safecall;
    function ActivateAcousticVAD(SessionId: Largeuint; Threshold: Double; PrefixPadding: Integer; 
                                 SilenceDuration: Integer): WordBool; safecall;
    function UpdateSessionOpenAI(SessionId: Largeuint; const Prompt: WideString; 
                                 OutputAudioSpeed: Double): WordBool; safecall;
    function SendInputOpenAI(SessionId: Largeuint; const Input: WideString): WordBool; safecall;
    function AddFunctionOpenAI(SessionId: Largeuint; const FuncName: WideString; 
                               const FuncDesc: WideString): WordBool; safecall;
    procedure RemoveFunctionOpenAI(SessionId: Largeuint; const FuncName: WideString); safecall;
    procedure RemoveFunctionAllOpenAI(SessionId: Largeuint); safecall;
    function AddFunctionParamOpenAI(SessionId: Largeuint; const FuncName: WideString; 
                                    const ParamName: WideString; const ParamDesc: WideString): WordBool; safecall;
    function AddFunctionParamEnumOpenAI(SessionId: Largeuint; const FuncName: WideString; 
                                        const ParamName: WideString; const EnumValue: WideString): WordBool; safecall;
    function SendFunctionResultOpenAI(SessionId: Largeuint; const CallId: WideString; 
                                      const Output: WideString): WordBool; safecall;
    function AttackDetectScanSIP(const DomainName: WideString): WordBool; safecall;
    function AttackDetectFloodSIP(ReqRecvLimit: Integer): WordBool; safecall;
    function AttackDetectBruteForceSIP(FailureCount: Integer; FailureInterval: Integer): WordBool; safecall;
    function CallSessionMuteVoice(SessionId: Largeuint; bListen: WordBool; bSpeak: WordBool): WordBool; safecall;
    function SetExtDataREC(SessionId: Largeuint; const ExtData: WideString): WordBool; safecall;
    function ConnectToServerREC(SessionId: Largeuint; const CallerName: WideString; 
                                const CallerId: WideString; const DialNo: WideString; 
                                const ToPeerName: WideString; nTimeout: Integer): WordBool; safecall;
    function MuteCallServerREC(SessionId: Largeuint; nMuteType: Integer): WordBool; safecall;
    function GetUserAgentNameCall(SessionId: Largeuint): WideString; safecall;
    function AddVectorStoreSearchOpenAI(SessionId: Largeuint; const SearchName: WideString; 
                                        const SearchDesc: WideString; 
                                        const VectorStoreId: WideString; const Filters: WideString; 
                                        nMaxNoResults: Integer): WordBool; safecall;
    procedure RemoveVectorStoreSearchOpenAI(SessionId: Largeuint; const SearchName: WideString); safecall;
    procedure RemoveVectorStoreSearchAllOpenAI(SessionId: Largeuint); safecall;
    function InputTranscriptOpenAI(SessionId: Largeuint; Activate: WordBool; const Model: WideString; const NoiseReduction: WideString): WordBool; safecall;
  end;

// *********************************************************************//
// DispIntf:  IServerLibVoAIDisp
// Flags:     (4544) Dual NonExtensible OleAutomation Dispatchable
// GUID:      {6390067F-595D-4B45-89B1-C8E87B41545F}
// *********************************************************************//
  IServerLibVoAIDisp = dispinterface
    ['{6390067F-595D-4B45-89B1-C8E87B41545F}']
    function GetVaxErrorCode: Integer; dispid 1;
    function GetVaxErrorText: WideString; dispid 2;
    function GetVersionFile: WideString; dispid 3;
    function GetVersionSDK: WideString; dispid 4;
    procedure SetLicenseKey(const LicenseKey: WideString); dispid 5;
    function Initialize(const DomainRealm: WideString): WordBool; dispid 6;
    procedure UnInitialize; dispid 7;
    function SetListenPortRangeRTP(ListenStartPort: Integer; ListenEndPort: Integer): WordBool; dispid 8;
    function SetNetworkMediaRTP(const ListenIP: WideString; ListenStartPort: Integer): WordBool; dispid 9;
    function CryptoMediaNONE(Forced: WordBool): WordBool; dispid 10;
    function CryptoMediaSDP(Forced: WordBool): WordBool; dispid 11;
    function AddNetworkRouteSIP(const AssignedIP: WideString; const RouterIP: WideString): WordBool; dispid 12;
    function AddNetworkRouteRTP(const AssignedIP: WideString; const RouterIP: WideString): WordBool; dispid 13;
    function OpenNetworkUDP(const ListenIP: WideString; ListenPort: Integer): WordBool; dispid 14;
    function OpenNetworkTCP(const ListenIP: WideString; ListenPort: Integer): WordBool; dispid 15;
    function OpenNetworkTLS(const ListenIP: WideString; ListenPort: Integer; 
                            const CertPEM: WideString): WordBool; dispid 16;
    procedure CloseNetworkUDP; dispid 17;
    procedure CloseNetworkTCP; dispid 18;
    procedure CloseNetworkTLS; dispid 19;
    function AddUser(const UserName: WideString; const Password: WideString; 
                     const AudioCodecList: WideString): WordBool; dispid 20;
    procedure RemoveUser(const UserName: WideString); dispid 21;
    function RegisterUserExpiry(Expiry: Integer): WordBool; dispid 22;
    function AttachRegister(RegId: Largeuint; const UserName: WideString): WordBool; dispid 23;
    function AcceptRegister(RegId: Largeuint): WordBool; dispid 24;
    function RejectRegister(RegId: Largeuint; StatusCode: Integer; const ReasonPhrase: WideString): WordBool; dispid 25;
    function AuthRegister(RegId: Largeuint): WordBool; dispid 26;
    function AddLine(const LineName: WideString; LineType: Integer; const DisplayName: WideString; 
                     const UserName: WideString; const AuthLogin: WideString; 
                     const AuthPwd: WideString; const DomainRealm: WideString; 
                     const ServerAddr: WideString; ServerPort: Integer; 
                     const AudioCodecList: WideString): WordBool; dispid 27;
    procedure RemoveLine(const LineName: WideString); dispid 28;
    function RegisterLine(const LineName: WideString; Expire: Integer): WordBool; dispid 29;
    function UnRegisterLine(const LineName: WideString): WordBool; dispid 30;
    function AcceptCallSession(SessionId: Largeuint; Timeout: Integer; const KeyOpenAI: WideString;
                               const Prompt: WideString; const Model: WideString; const Voice: WideString;
                               OutputAudioSpeed: Double): WordBool; dispid 31;
    function RejectCallSession(SessionId: Largeuint; StatusCode: Integer; 
                               const ReasonPhrase: WideString): WordBool; dispid 32;
    function CloseCallSession(SessionId: Largeuint): WordBool; dispid 33;
    function DialCallSession(const CallerName: WideString; const CallerId: WideString; 
                             const DialNo: WideString; const ToPeerName: WideString; 
                             Timeout: Integer): Largeuint; dispid 34;
    function CallSessionSendStatusResponse(SessionId: Largeuint; StatusCode: Integer; 
                                           const ReasonPhrase: WideString; 
                                           const ContactURI: WideString): WordBool; dispid 35;
    function SendReqTransferCallBlind(SessionId: Largeuint; const ToUserName: WideString): WordBool; dispid 36;
    function SendReqTransferCallConsult(SessionId: Largeuint; ToSessionId: Largeuint): WordBool; dispid 37;
    function AcceptChatMessage(ChatMsgId: Largeuint; const ToPeerName: WideString): WordBool; dispid 38;
    procedure RejectChatMessage(ChatMsgId: Largeuint; StatusCode: Integer; 
                                const ReasonPhrase: WideString); dispid 39;
    function SendChatMessageText(const MsgFrom: WideString; const MsgTo: WideString; 
                                 const MsgText: WideString; const ToPeerName: WideString): Largeuint; dispid 40;
    function AudioSessionLost(Enable: WordBool; Timeout: Integer): WordBool; dispid 41;
    function SetUserAgentName(const Name: WideString): WordBool; dispid 42;
    function GetUserAgentName: WideString; dispid 43;
    function SetSessionNameSDP(const Name: WideString): WordBool; dispid 44;
    function GetSessionNameSDP: WideString; dispid 45;
    function SendDigitDTMF(SessionId: Largeuint; const DigitDTMF: WideString; TypeDTMF: Integer): WordBool; dispid 46;
    function DetectDigitDTMF(SessionId: Largeuint; TypeDTMF: Integer; Enable: WordBool; 
                             MilliSecTimeout: Integer): WordBool; dispid 47;
    function ActivateSemanticVAD(SessionId: Largeuint; const Eagerness: WideString): WordBool; dispid 48;
    function ActivateAcousticVAD(SessionId: Largeuint; Threshold: Double; PrefixPadding: Integer; 
                                 SilenceDuration: Integer): WordBool; dispid 49;
    function UpdateSessionOpenAI(SessionId: Largeuint; const Prompt: WideString; 
                                 OutputAudioSpeed: Double): WordBool; dispid 50;
    function SendInputOpenAI(SessionId: Largeuint; const Input: WideString): WordBool; dispid 51;
    function AddFunctionOpenAI(SessionId: Largeuint; const FuncName: WideString; 
                               const FuncDesc: WideString): WordBool; dispid 52;
    procedure RemoveFunctionOpenAI(SessionId: Largeuint; const FuncName: WideString); dispid 53;
    procedure RemoveFunctionAllOpenAI(SessionId: Largeuint); dispid 54;
    function AddFunctionParamOpenAI(SessionId: Largeuint; const FuncName: WideString; 
                                    const ParamName: WideString; const ParamDesc: WideString): WordBool; dispid 55;
    function AddFunctionParamEnumOpenAI(SessionId: Largeuint; const FuncName: WideString; 
                                        const ParamName: WideString; const EnumValue: WideString): WordBool; dispid 56;
    function SendFunctionResultOpenAI(SessionId: Largeuint; const CallId: WideString; 
                                      const Output: WideString): WordBool; dispid 57;
    function AttackDetectScanSIP(const DomainName: WideString): WordBool; dispid 58;
    function AttackDetectFloodSIP(ReqRecvLimit: Integer): WordBool; dispid 59;
    function AttackDetectBruteForceSIP(FailureCount: Integer; FailureInterval: Integer): WordBool; dispid 60;
    function CallSessionMuteVoice(SessionId: Largeuint; bListen: WordBool; bSpeak: WordBool): WordBool; dispid 61;
    function SetExtDataREC(SessionId: Largeuint; const ExtData: WideString): WordBool; dispid 62;
    function ConnectToServerREC(SessionId: Largeuint; const CallerName: WideString; 
                                const CallerId: WideString; const DialNo: WideString; 
                                const ToPeerName: WideString; nTimeout: Integer): WordBool; dispid 63;
    function MuteCallServerREC(SessionId: Largeuint; nMuteType: Integer): WordBool; dispid 64;
    function GetUserAgentNameCall(SessionId: Largeuint): WideString; dispid 65;
    function AddVectorStoreSearchOpenAI(SessionId: Largeuint; const SearchName: WideString;
                                        const SearchDesc: WideString; 
                                        const VectorStoreId: WideString; const Filters: WideString; 
                                        nMaxNoResults: Integer): WordBool; dispid 66;
    procedure RemoveVectorStoreSearchOpenAI(SessionId: Largeuint; const SearchName: WideString); dispid 67;
    procedure RemoveVectorStoreSearchAllOpenAI(SessionId: Largeuint); dispid 68;
    function InputTranscriptOpenAI(SessionId: Largeuint; Activate: WordBool; const Model: WideString; const NoiseReduction: WideString): WordBool; dispid 69;
  end;

// *********************************************************************//
// The Class CoServerLibVoAI provides a Create and CreateRemote method to          
// create instances of the default interface IServerLibVoAI exposed by              
// the CoClass ServerLibVoAI. The functions are intended to be used by             
// clients wishing to automate the CoClass objects exposed by the         
// server of this typelibrary.                                            
// *********************************************************************//
  CoServerLibVoAI = class
    class function Create: IServerLibVoAI;
    class function CreateRemote(const MachineName: string): IServerLibVoAI;
  end;

  TServerLibVoAIOnRegisterUser = procedure(ASender: TObject; const UserName: WideString; 
                                                             const Domain: WideString; 
                                                             const UserAgent: WideString; 
                                                             const FromIP: WideString; 
                                                             FromPort: Integer; RegId: Largeuint) of object;
  TServerLibVoAIOnRegisterUserSuccess = procedure(ASender: TObject; const UserName: WideString; 
                                                                    const FromIP: WideString; 
                                                                    FromPort: Integer; 
                                                                    RegId: Largeuint) of object;
  TServerLibVoAIOnRegisterUserFailed = procedure(ASender: TObject; const UserName: WideString; 
                                                                   const FromIP: WideString; 
                                                                   FromPort: Integer; 
                                                                   RegId: Largeuint) of object;
  TServerLibVoAIOnUnRegisterUser = procedure(ASender: TObject; const UserName: WideString) of object;
  TServerLibVoAIOnCallSessionCreated = procedure(ASender: TObject; SessionId: Largeuint; 
                                                                   ReasonCode: Integer) of object;
  TServerLibVoAIOnCallSessionClosed = procedure(ASender: TObject; SessionId: Largeuint; 
                                                                  ReasonCode: Integer) of object;
  TServerLibVoAIOnCallSessionConnecting = procedure(ASender: TObject; SessionId: Largeuint; 
                                                                      StatusCode: Integer; 
                                                                      const ReasonPhrase: WideString) of object;
  TServerLibVoAIOnCallSessionFailed = procedure(ASender: TObject; SessionId: Largeuint; 
                                                                  StatusCode: Integer; 
                                                                  const ReasonPhrase: WideString; 
                                                                  const Contact: WideString) of object;
  TServerLibVoAIOnCallSessionConnected = procedure(ASender: TObject; SessionId: Largeuint) of object;
  TServerLibVoAIOnIncomingCall = procedure(ASender: TObject; SessionId: Largeuint; 
                                                             const CallerName: WideString; 
                                                             const CallerId: WideString; 
                                                             const DialNo: WideString; 
                                                             FromPeerType: Integer; 
                                                             const FromPeerName: WideString; 
                                                             const UserAgent: WideString; 
                                                             const FromIP: WideString; 
                                                             FromPort: Integer) of object;
  TServerLibVoAIOnCallSessionLost = procedure(ASender: TObject; SessionId: Largeuint) of object;
  TServerLibVoAIOnCallSessionHangup = procedure(ASender: TObject; SessionId: Largeuint) of object;
  TServerLibVoAIOnCallSessionTimeout = procedure(ASender: TObject; SessionId: Largeuint) of object;
  TServerLibVoAIOnCallSessionCancelled = procedure(ASender: TObject; SessionId: Largeuint) of object;
  TServerLibVoAIOnChatMessageText = procedure(ASender: TObject; ChatMsgId: Largeuint; 
                                                                const MsgFrom: WideString; 
                                                                const MsgTo: WideString; 
                                                                const MsgText: WideString; 
                                                                FromPeerType: Integer; 
                                                                const FromPeerName: WideString; 
                                                                const FromIP: WideString; 
                                                                FromPort: Integer) of object;
  TServerLibVoAIOnChatMessageSuccess = procedure(ASender: TObject; ChatMsgId: Largeuint) of object;
  TServerLibVoAIOnChatMessageFailed = procedure(ASender: TObject; ChatMsgId: Largeuint; 
                                                                  StatusId: Integer; 
                                                                  const ReasonPhrase: WideString) of object;
  TServerLibVoAIOnChatMessageTimeout = procedure(ASender: TObject; ChatMsgId: Largeuint) of object;
  TServerLibVoAIOnVaxFunctionCallOpenAI = procedure(ASender: TObject; SessionId: Largeuint; 
                                                                      const FuncName: WideString; 
                                                                      const CallId: WideString; 
                                                                      ParamNames: {NOT_OLEAUTO(PSafeArray)}OleVariant; 
                                                                      ParamValues: {NOT_OLEAUTO(PSafeArray)}OleVariant) of object;
  TServerLibVoAIOnVaxSessionUpdatedOpenAI = procedure(ASender: TObject; SessionId: Largeuint) of object;

  TServerLibVoAIOnVaxAudioOutputTranscriptOpenAI = procedure(ASender: TObject; SessionId: Largeuint;
                                                                               const Transcript: WideString) of object;

   TServerLibVoAIOnVaxAudioInputTranscriptOpenAI = procedure(ASender: TObject; SessionId: Largeuint;
                                                                               const Transcript: WideString) of object;


  TServerLibVoAIOnVaxResponseDoneUsageOpenAI = procedure(ASender: TObject; SessionId: Largeuint;
                                                                           TotalTokens: Integer; 
                                                                           InputTokens: Integer; 
                                                                           OutputTokens: Integer) of object;
  TServerLibVoAIOnVaxStatusOpenAI = procedure(ASender: TObject; SessionId: Largeuint; 
                                                                StatusId: Integer; 
                                                                const tatus: WideString) of object;
  TServerLibVoAIOnVaxErrorOpenAI = procedure(ASender: TObject; SessionId: Largeuint; 
                                                               const Msg: WideString) of object;
  TServerLibVoAIOnLineRegisterTrying = procedure(ASender: TObject; const LineName: WideString) of object;
  TServerLibVoAIOnLineRegisterFailed = procedure(ASender: TObject; const LineName: WideString; 
                                                                   StatusCode: Integer; 
                                                                   const ReasonPhrase: WideString) of object;
  TServerLibVoAIOnLineRegisterSuccess = procedure(ASender: TObject; const LineName: WideString) of object;
  TServerLibVoAIOnLineUnRegisterTrying = procedure(ASender: TObject; const LineName: WideString) of object;
  TServerLibVoAIOnLineUnRegisterFailed = procedure(ASender: TObject; const LineName: WideString; 
                                                                     StatusCode: Integer; 
                                                                     const ReasonPhrase: WideString) of object;
  TServerLibVoAIOnLineUnRegisterSuccess = procedure(ASender: TObject; const LineName: WideString) of object;
  TServerLibVoAIOnAttackDetectedScanSIP = procedure(ASender: TObject; const ReqMethod: WideString; 
                                                                      const AddrIP: WideString; 
                                                                      AddrPort: Integer; 
                                                                      AddrType: Integer) of object;
  TServerLibVoAIOnAttackDetectedFloodSIP = procedure(ASender: TObject; const AddrIP: WideString; 
                                                                       AddrPort: Integer; 
                                                                       AddrType: Integer) of object;
  TServerLibVoAIOnAttackDetectedBruteForceSIP = procedure(ASender: TObject; const ReqMethod: WideString; 
                                                                            AuthFailureCount: Integer; 
                                                                            const AddrIP: WideString; 
                                                                            AddrPort: Integer; 
                                                                            AddrType: Integer) of object;
  TServerLibVoAIOnSendReqTransferCallTimeout = procedure(ASender: TObject; SessionId: Largeuint) of object;
  TServerLibVoAIOnSendReqTransferCallAccepted = procedure(ASender: TObject; SessionId: Largeuint) of object;
  TServerLibVoAIOnSendReqTransferCallFailed = procedure(ASender: TObject; SessionId: Largeuint; 
                                                                          StatusCode: Integer; 
                                                                          const ReasonPhrase: WideString) of object;
  TServerLibVoAIOnServerConnectingREC = procedure(ASender: TObject; SessionId: Largeuint; 
                                                                    StatusCode: Integer; 
                                                                    const ReasonPhrase: WideString) of object;
  TServerLibVoAIOnServerConnectedREC = procedure(ASender: TObject; SessionId: Largeuint) of object;
  TServerLibVoAIOnServerFailedREC = procedure(ASender: TObject; SessionId: Largeuint; 
                                                                StatusCode: Integer; 
                                                                const ReasonPhrase: WideString) of object;
  TServerLibVoAIOnServerTimeoutREC = procedure(ASender: TObject; SessionId: Largeuint) of object;
  TServerLibVoAIOnServerHungupREC = procedure(ASender: TObject; SessionId: Largeuint) of object;
  TServerLibVoAIOnVaxVectorSearchStartedOpenAI = procedure(ASender: TObject; SessionId: Largeuint; 
                                                                             const earchName: WideString; 
                                                                             const Query: WideString) of object;
  TServerLibVoAIOnVaxVectorSearchTryingOpenAI = procedure(ASender: TObject; SessionId: Largeuint; 
                                                                            const earchName: WideString) of object;
  TServerLibVoAIOnVaxVectorSearchSuccessOpenAI = procedure(ASender: TObject; SessionId: Largeuint; 
                                                                             const earchName: WideString; 
                                                                             const Content: WideString) of object;
  TServerLibVoAIOnVaxVectorSearchFailedOpenAI = procedure(ASender: TObject; SessionId: Largeuint; 
                                                                            const earchName: WideString; 
                                                                            const Msg: WideString) of object;
  TServerLibVoAIOnCallSessionErrorLog = procedure(ASender: TObject; SessionId: Largeuint; 
                                                                    ErrorCode: Integer; 
                                                                    const ErrorMsg: WideString) of object;
  TServerLibVoAIOnVaxErrorLog = procedure(ASender: TObject; const FuncName: WideString; 
                                                            ErrorCode: Integer; 
                                                            const ErrorMsg: WideString) of object;


// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object    : TServerLibVoAI
// Help String      : VaxServerLibVoAI Class
// Default Interface: IServerLibVoAI
// Def. Intf. DISP? : No
// Event   Interface: _IServerLibVoAIEvents
// TypeFlags        : (2) CanCreate
// *********************************************************************//
  TServerLibVoAI = class(TOleServer)
  private
    FOnRegisterUser: TServerLibVoAIOnRegisterUser;
    FOnRegisterUserSuccess: TServerLibVoAIOnRegisterUserSuccess;
    FOnRegisterUserFailed: TServerLibVoAIOnRegisterUserFailed;
    FOnUnRegisterUser: TServerLibVoAIOnUnRegisterUser;
    FOnCallSessionCreated: TServerLibVoAIOnCallSessionCreated;
    FOnCallSessionClosed: TServerLibVoAIOnCallSessionClosed;
    FOnCallSessionConnecting: TServerLibVoAIOnCallSessionConnecting;
    FOnCallSessionFailed: TServerLibVoAIOnCallSessionFailed;
    FOnCallSessionConnected: TServerLibVoAIOnCallSessionConnected;
    FOnIncomingCall: TServerLibVoAIOnIncomingCall;
    FOnCallSessionLost: TServerLibVoAIOnCallSessionLost;
    FOnCallSessionHangup: TServerLibVoAIOnCallSessionHangup;
    FOnCallSessionTimeout: TServerLibVoAIOnCallSessionTimeout;
    FOnCallSessionCancelled: TServerLibVoAIOnCallSessionCancelled;
    FOnChatMessageText: TServerLibVoAIOnChatMessageText;
    FOnChatMessageSuccess: TServerLibVoAIOnChatMessageSuccess;
    FOnChatMessageFailed: TServerLibVoAIOnChatMessageFailed;
    FOnChatMessageTimeout: TServerLibVoAIOnChatMessageTimeout;
    FOnVaxFunctionCallOpenAI: TServerLibVoAIOnVaxFunctionCallOpenAI;
    FOnVaxSessionUpdatedOpenAI: TServerLibVoAIOnVaxSessionUpdatedOpenAI;
    FOnVaxAudioOutputTranscriptOpenAI: TServerLibVoAIOnVaxAudioOutputTranscriptOpenAI;
    FOnVaxAudioInputTranscriptOpenAI: TServerLibVoAIOnVaxAudioInputTranscriptOpenAI;
    FOnVaxResponseDoneUsageOpenAI: TServerLibVoAIOnVaxResponseDoneUsageOpenAI;
    FOnVaxStatusOpenAI: TServerLibVoAIOnVaxStatusOpenAI;
    FOnVaxErrorOpenAI: TServerLibVoAIOnVaxErrorOpenAI;
    FOnLineRegisterTrying: TServerLibVoAIOnLineRegisterTrying;
    FOnLineRegisterFailed: TServerLibVoAIOnLineRegisterFailed;
    FOnLineRegisterSuccess: TServerLibVoAIOnLineRegisterSuccess;
    FOnLineUnRegisterTrying: TServerLibVoAIOnLineUnRegisterTrying;
    FOnLineUnRegisterFailed: TServerLibVoAIOnLineUnRegisterFailed;
    FOnLineUnRegisterSuccess: TServerLibVoAIOnLineUnRegisterSuccess;
    FOnAttackDetectedScanSIP: TServerLibVoAIOnAttackDetectedScanSIP;
    FOnAttackDetectedFloodSIP: TServerLibVoAIOnAttackDetectedFloodSIP;
    FOnAttackDetectedBruteForceSIP: TServerLibVoAIOnAttackDetectedBruteForceSIP;
    FOnSendReqTransferCallTimeout: TServerLibVoAIOnSendReqTransferCallTimeout;
    FOnSendReqTransferCallAccepted: TServerLibVoAIOnSendReqTransferCallAccepted;
    FOnSendReqTransferCallFailed: TServerLibVoAIOnSendReqTransferCallFailed;
    FOnServerConnectingREC: TServerLibVoAIOnServerConnectingREC;
    FOnServerConnectedREC: TServerLibVoAIOnServerConnectedREC;
    FOnServerFailedREC: TServerLibVoAIOnServerFailedREC;
    FOnServerTimeoutREC: TServerLibVoAIOnServerTimeoutREC;
    FOnServerHungupREC: TServerLibVoAIOnServerHungupREC;
    FOnVaxVectorSearchStartedOpenAI: TServerLibVoAIOnVaxVectorSearchStartedOpenAI;
    FOnVaxVectorSearchTryingOpenAI: TServerLibVoAIOnVaxVectorSearchTryingOpenAI;
    FOnVaxVectorSearchSuccessOpenAI: TServerLibVoAIOnVaxVectorSearchSuccessOpenAI;
    FOnVaxVectorSearchFailedOpenAI: TServerLibVoAIOnVaxVectorSearchFailedOpenAI;
    FOnCallSessionErrorLog: TServerLibVoAIOnCallSessionErrorLog;
    FOnVaxErrorLog: TServerLibVoAIOnVaxErrorLog;
    FIntf: IServerLibVoAI;
    function GetDefaultInterface: IServerLibVoAI;
  protected
    procedure InitServerData; override;
    procedure InvokeEvent(DispID: TDispID; var Params: TVariantArray); override;
  public
    constructor Create(AOwner: TComponent); override;
    destructor  Destroy; override;
    procedure Connect; override;
    procedure ConnectTo(svrIntf: IServerLibVoAI);
    procedure Disconnect; override;
    function GetVaxErrorCode: Integer;
    function GetVaxErrorText: WideString;
    function GetVersionFile: WideString;
    function GetVersionSDK: WideString;
    procedure SetLicenseKey(const LicenseKey: WideString);
    function Initialize(const DomainRealm: WideString): WordBool;
    procedure UnInitialize;
    function SetListenPortRangeRTP(ListenStartPort: Integer; ListenEndPort: Integer): WordBool;
    function SetNetworkMediaRTP(const ListenIP: WideString; ListenStartPort: Integer): WordBool;
    function CryptoMediaNONE(Forced: WordBool): WordBool;
    function CryptoMediaSDP(Forced: WordBool): WordBool;
    function AddNetworkRouteSIP(const AssignedIP: WideString; const RouterIP: WideString): WordBool;
    function AddNetworkRouteRTP(const AssignedIP: WideString; const RouterIP: WideString): WordBool;
    function OpenNetworkUDP(const ListenIP: WideString; ListenPort: Integer): WordBool;
    function OpenNetworkTCP(const ListenIP: WideString; ListenPort: Integer): WordBool;
    function OpenNetworkTLS(const ListenIP: WideString; ListenPort: Integer; 
                            const CertPEM: WideString): WordBool;
    procedure CloseNetworkUDP;
    procedure CloseNetworkTCP;
    procedure CloseNetworkTLS;
    function AddUser(const UserName: WideString; const Password: WideString; 
                     const AudioCodecList: WideString): WordBool;
    procedure RemoveUser(const UserName: WideString);
    function RegisterUserExpiry(Expiry: Integer): WordBool;
    function AttachRegister(RegId: Largeuint; const UserName: WideString): WordBool;
    function AcceptRegister(RegId: Largeuint): WordBool;
    function RejectRegister(RegId: Largeuint; StatusCode: Integer; const ReasonPhrase: WideString): WordBool;
    function AuthRegister(RegId: Largeuint): WordBool;
    function AddLine(const LineName: WideString; LineType: Integer; const DisplayName: WideString; 
                     const UserName: WideString; const AuthLogin: WideString; 
                     const AuthPwd: WideString; const DomainRealm: WideString; 
                     const ServerAddr: WideString; ServerPort: Integer; 
                     const AudioCodecList: WideString): WordBool;
    procedure RemoveLine(const LineName: WideString);
    function RegisterLine(const LineName: WideString; Expire: Integer): WordBool;
    function UnRegisterLine(const LineName: WideString): WordBool;
    function AcceptCallSession(SessionId: Largeuint; Timeout: Integer; const KeyOpenAI: WideString;
                               const Prompt: WideString; const Model: WideString; const Voice: WideString;
                               OutputAudioSpeed: Double): WordBool;
    function RejectCallSession(SessionId: Largeuint; StatusCode: Integer; 
                               const ReasonPhrase: WideString): WordBool;
    function CloseCallSession(SessionId: Largeuint): WordBool;
    function DialCallSession(const CallerName: WideString; const CallerId: WideString; 
                             const DialNo: WideString; const ToPeerName: WideString; 
                             Timeout: Integer): Largeuint;
    function CallSessionSendStatusResponse(SessionId: Largeuint; StatusCode: Integer; 
                                           const ReasonPhrase: WideString; 
                                           const ContactURI: WideString): WordBool;
    function SendReqTransferCallBlind(SessionId: Largeuint; const ToUserName: WideString): WordBool;
    function SendReqTransferCallConsult(SessionId: Largeuint; ToSessionId: Largeuint): WordBool;
    function AcceptChatMessage(ChatMsgId: Largeuint; const ToPeerName: WideString): WordBool;
    procedure RejectChatMessage(ChatMsgId: Largeuint; StatusCode: Integer; 
                                const ReasonPhrase: WideString);
    function SendChatMessageText(const MsgFrom: WideString; const MsgTo: WideString; 
                                 const MsgText: WideString; const ToPeerName: WideString): Largeuint;
    function AudioSessionLost(Enable: WordBool; Timeout: Integer): WordBool;
    function SetUserAgentName(const Name: WideString): WordBool;
    function GetUserAgentName: WideString;
    function SetSessionNameSDP(const Name: WideString): WordBool;
    function GetSessionNameSDP: WideString;
    function SendDigitDTMF(SessionId: Largeuint; const DigitDTMF: WideString; TypeDTMF: Integer): WordBool;
    function DetectDigitDTMF(SessionId: Largeuint; TypeDTMF: Integer; Enable: WordBool; 
                             MilliSecTimeout: Integer): WordBool;
    function ActivateSemanticVAD(SessionId: Largeuint; const Eagerness: WideString): WordBool;
    function ActivateAcousticVAD(SessionId: Largeuint; Threshold: Double; PrefixPadding: Integer; 
                                 SilenceDuration: Integer): WordBool;
    function UpdateSessionOpenAI(SessionId: Largeuint; const Prompt: WideString; 
                                 OutputAudioSpeed: Double): WordBool;
    function SendInputOpenAI(SessionId: Largeuint; const Input: WideString): WordBool;
    function AddFunctionOpenAI(SessionId: Largeuint; const FuncName: WideString; 
                               const FuncDesc: WideString): WordBool;
    procedure RemoveFunctionOpenAI(SessionId: Largeuint; const FuncName: WideString);
    procedure RemoveFunctionAllOpenAI(SessionId: Largeuint);
    function AddFunctionParamOpenAI(SessionId: Largeuint; const FuncName: WideString; 
                                    const ParamName: WideString; const ParamDesc: WideString): WordBool;
    function AddFunctionParamEnumOpenAI(SessionId: Largeuint; const FuncName: WideString; 
                                        const ParamName: WideString; const EnumValue: WideString): WordBool;
    function SendFunctionResultOpenAI(SessionId: Largeuint; const CallId: WideString; 
                                      const Output: WideString): WordBool;
    function AttackDetectScanSIP(const DomainName: WideString): WordBool;
    function AttackDetectFloodSIP(ReqRecvLimit: Integer): WordBool;
    function AttackDetectBruteForceSIP(FailureCount: Integer; FailureInterval: Integer): WordBool;
    function CallSessionMuteVoice(SessionId: Largeuint; Listen: WordBool; Speak: WordBool): WordBool;
    function SetExtDataREC(SessionId: Largeuint; const ExtData: WideString): WordBool;
    function ConnectToServerREC(SessionId: Largeuint; const CallerName: WideString; 
                                const CallerId: WideString; const DialNo: WideString; 
                                const ToPeerName: WideString; Timeout: Integer): WordBool;
    function MuteCallServerREC(SessionId: Largeuint; nMuteType: Integer): WordBool;
    function GetUserAgentNameCall(SessionId: Largeuint): WideString;
    function AddVectorStoreSearchOpenAI(SessionId: Largeuint; const SearchName: WideString; 
                                        const SearchDesc: WideString; 
                                        const VectorStoreId: WideString; const Filters: WideString; 
                                        nMaxNoResults: Integer): WordBool;
    procedure RemoveVectorStoreSearchOpenAI(SessionId: Largeuint; const SearchName: WideString);
    procedure RemoveVectorStoreSearchAllOpenAI(SessionId: Largeuint);
    function InputTranscriptOpenAI(SessionId: Largeuint; Activate: WordBool; const Model: WideString; const NoiseReduction: WideString): WordBool;
    property DefaultInterface: IServerLibVoAI read GetDefaultInterface;
  published
    property OnRegisterUser: TServerLibVoAIOnRegisterUser read FOnRegisterUser write FOnRegisterUser;
    property OnRegisterUserSuccess: TServerLibVoAIOnRegisterUserSuccess read FOnRegisterUserSuccess write FOnRegisterUserSuccess;
    property OnRegisterUserFailed: TServerLibVoAIOnRegisterUserFailed read FOnRegisterUserFailed write FOnRegisterUserFailed;
    property OnUnRegisterUser: TServerLibVoAIOnUnRegisterUser read FOnUnRegisterUser write FOnUnRegisterUser;
    property OnCallSessionCreated: TServerLibVoAIOnCallSessionCreated read FOnCallSessionCreated write FOnCallSessionCreated;
    property OnCallSessionClosed: TServerLibVoAIOnCallSessionClosed read FOnCallSessionClosed write FOnCallSessionClosed;
    property OnCallSessionConnecting: TServerLibVoAIOnCallSessionConnecting read FOnCallSessionConnecting write FOnCallSessionConnecting;
    property OnCallSessionFailed: TServerLibVoAIOnCallSessionFailed read FOnCallSessionFailed write FOnCallSessionFailed;
    property OnCallSessionConnected: TServerLibVoAIOnCallSessionConnected read FOnCallSessionConnected write FOnCallSessionConnected;
    property OnIncomingCall: TServerLibVoAIOnIncomingCall read FOnIncomingCall write FOnIncomingCall;
    property OnCallSessionLost: TServerLibVoAIOnCallSessionLost read FOnCallSessionLost write FOnCallSessionLost;
    property OnCallSessionHangup: TServerLibVoAIOnCallSessionHangup read FOnCallSessionHangup write FOnCallSessionHangup;
    property OnCallSessionTimeout: TServerLibVoAIOnCallSessionTimeout read FOnCallSessionTimeout write FOnCallSessionTimeout;
    property OnCallSessionCancelled: TServerLibVoAIOnCallSessionCancelled read FOnCallSessionCancelled write FOnCallSessionCancelled;
    property OnChatMessageText: TServerLibVoAIOnChatMessageText read FOnChatMessageText write FOnChatMessageText;
    property OnChatMessageSuccess: TServerLibVoAIOnChatMessageSuccess read FOnChatMessageSuccess write FOnChatMessageSuccess;
    property OnChatMessageFailed: TServerLibVoAIOnChatMessageFailed read FOnChatMessageFailed write FOnChatMessageFailed;
    property OnChatMessageTimeout: TServerLibVoAIOnChatMessageTimeout read FOnChatMessageTimeout write FOnChatMessageTimeout;
    property OnVaxFunctionCallOpenAI: TServerLibVoAIOnVaxFunctionCallOpenAI read FOnVaxFunctionCallOpenAI write FOnVaxFunctionCallOpenAI;
    property OnVaxSessionUpdatedOpenAI: TServerLibVoAIOnVaxSessionUpdatedOpenAI read FOnVaxSessionUpdatedOpenAI write FOnVaxSessionUpdatedOpenAI;
    property OnVaxAudioOutputTranscriptOpenAI: TServerLibVoAIOnVaxAudioOutputTranscriptOpenAI read FOnVaxAudioOutputTranscriptOpenAI write FOnVaxAudioOutputTranscriptOpenAI;
    property OnVaxAudioInputTranscriptOpenAI: TServerLibVoAIOnVaxAudioInputTranscriptOpenAI read FOnVaxAudioInputTranscriptOpenAI write FOnVaxAudioInputTranscriptOpenAI;
    property OnVaxResponseDoneUsageOpenAI: TServerLibVoAIOnVaxResponseDoneUsageOpenAI read FOnVaxResponseDoneUsageOpenAI write FOnVaxResponseDoneUsageOpenAI;
    property OnVaxStatusOpenAI: TServerLibVoAIOnVaxStatusOpenAI read FOnVaxStatusOpenAI write FOnVaxStatusOpenAI;
    property OnVaxErrorOpenAI: TServerLibVoAIOnVaxErrorOpenAI read FOnVaxErrorOpenAI write FOnVaxErrorOpenAI;
    property OnLineRegisterTrying: TServerLibVoAIOnLineRegisterTrying read FOnLineRegisterTrying write FOnLineRegisterTrying;
    property OnLineRegisterFailed: TServerLibVoAIOnLineRegisterFailed read FOnLineRegisterFailed write FOnLineRegisterFailed;
    property OnLineRegisterSuccess: TServerLibVoAIOnLineRegisterSuccess read FOnLineRegisterSuccess write FOnLineRegisterSuccess;
    property OnLineUnRegisterTrying: TServerLibVoAIOnLineUnRegisterTrying read FOnLineUnRegisterTrying write FOnLineUnRegisterTrying;
    property OnLineUnRegisterFailed: TServerLibVoAIOnLineUnRegisterFailed read FOnLineUnRegisterFailed write FOnLineUnRegisterFailed;
    property OnLineUnRegisterSuccess: TServerLibVoAIOnLineUnRegisterSuccess read FOnLineUnRegisterSuccess write FOnLineUnRegisterSuccess;
    property OnAttackDetectedScanSIP: TServerLibVoAIOnAttackDetectedScanSIP read FOnAttackDetectedScanSIP write FOnAttackDetectedScanSIP;
    property OnAttackDetectedFloodSIP: TServerLibVoAIOnAttackDetectedFloodSIP read FOnAttackDetectedFloodSIP write FOnAttackDetectedFloodSIP;
    property OnAttackDetectedBruteForceSIP: TServerLibVoAIOnAttackDetectedBruteForceSIP read FOnAttackDetectedBruteForceSIP write FOnAttackDetectedBruteForceSIP;
    property OnSendReqTransferCallTimeout: TServerLibVoAIOnSendReqTransferCallTimeout read FOnSendReqTransferCallTimeout write FOnSendReqTransferCallTimeout;
    property OnSendReqTransferCallAccepted: TServerLibVoAIOnSendReqTransferCallAccepted read FOnSendReqTransferCallAccepted write FOnSendReqTransferCallAccepted;
    property OnSendReqTransferCallFailed: TServerLibVoAIOnSendReqTransferCallFailed read FOnSendReqTransferCallFailed write FOnSendReqTransferCallFailed;
    property OnServerConnectingREC: TServerLibVoAIOnServerConnectingREC read FOnServerConnectingREC write FOnServerConnectingREC;
    property OnServerConnectedREC: TServerLibVoAIOnServerConnectedREC read FOnServerConnectedREC write FOnServerConnectedREC;
    property OnServerFailedREC: TServerLibVoAIOnServerFailedREC read FOnServerFailedREC write FOnServerFailedREC;
    property OnServerTimeoutREC: TServerLibVoAIOnServerTimeoutREC read FOnServerTimeoutREC write FOnServerTimeoutREC;
    property OnServerHungupREC: TServerLibVoAIOnServerHungupREC read FOnServerHungupREC write FOnServerHungupREC;
    property OnVaxVectorSearchStartedOpenAI: TServerLibVoAIOnVaxVectorSearchStartedOpenAI read FOnVaxVectorSearchStartedOpenAI write FOnVaxVectorSearchStartedOpenAI;
    property OnVaxVectorSearchTryingOpenAI: TServerLibVoAIOnVaxVectorSearchTryingOpenAI read FOnVaxVectorSearchTryingOpenAI write FOnVaxVectorSearchTryingOpenAI;
    property OnVaxVectorSearchSuccessOpenAI: TServerLibVoAIOnVaxVectorSearchSuccessOpenAI read FOnVaxVectorSearchSuccessOpenAI write FOnVaxVectorSearchSuccessOpenAI;
    property OnVaxVectorSearchFailedOpenAI: TServerLibVoAIOnVaxVectorSearchFailedOpenAI read FOnVaxVectorSearchFailedOpenAI write FOnVaxVectorSearchFailedOpenAI;
    property OnCallSessionErrorLog: TServerLibVoAIOnCallSessionErrorLog read FOnCallSessionErrorLog write FOnCallSessionErrorLog;
    property OnVaxErrorLog: TServerLibVoAIOnVaxErrorLog read FOnVaxErrorLog write FOnVaxErrorLog;
  end;

procedure Register;

resourcestring
  dtlServerPage = 'Standard';

  dtlOcxPage = 'Standard';

implementation

uses System.Win.ComObj;

class function CoServerLibVoAI.Create: IServerLibVoAI;
begin
  Result := CreateComObject(CLASS_ServerLibVoAI) as IServerLibVoAI;
end;

class function CoServerLibVoAI.CreateRemote(const MachineName: string): IServerLibVoAI;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_ServerLibVoAI) as IServerLibVoAI;
end;

procedure TServerLibVoAI.InitServerData;
const
  CServerData: TServerData = (
    ClassID:   '{10C163D0-E66E-4685-A9BD-8BF5D4989220}';
    IntfIID:   '{6390067F-595D-4B45-89B1-C8E87B41545F}';
    EventIID:  '{61C8315F-1FD2-4E04-8DA4-3B598BC426A1}';
    LicenseKey: nil;
    Version: 500);
begin
  ServerData := @CServerData;
end;

procedure TServerLibVoAI.Connect;
var
  punk: IUnknown;
begin
  if FIntf = nil then
  begin
    punk := GetServer;
    ConnectEvents(punk);
    Fintf:= punk as IServerLibVoAI;
  end;
end;

procedure TServerLibVoAI.ConnectTo(svrIntf: IServerLibVoAI);
begin
  Disconnect;
  FIntf := svrIntf;
  ConnectEvents(FIntf);
end;

procedure TServerLibVoAI.DisConnect;
begin
  if Fintf <> nil then
  begin
    DisconnectEvents(FIntf);
    FIntf := nil;
  end;
end;

function TServerLibVoAI.GetDefaultInterface: IServerLibVoAI;
begin
  if FIntf = nil then
    Connect;
  Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call "Connect" or "ConnectTo" before this operation');
  Result := FIntf;
end;

constructor TServerLibVoAI.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
end;

destructor TServerLibVoAI.Destroy;
begin
  inherited Destroy;
end;

procedure TServerLibVoAI.InvokeEvent(DispID: TDispID; var Params: TVariantArray);
begin
  case DispID of
    -1: Exit;  // DISPID_UNKNOWN
    1: if Assigned(FOnRegisterUser) then
         FOnRegisterUser(Self,
                         Params[0] {const WideString},
                         Params[1] {const WideString},
                         Params[2] {const WideString},
                         Params[3] {const WideString},
                         Params[4] {Integer},
                         Params[5] {Largeuint});
    2: if Assigned(FOnRegisterUserSuccess) then
         FOnRegisterUserSuccess(Self,
                                Params[0] {const WideString},
                                Params[1] {const WideString},
                                Params[2] {Integer},
                                Params[3] {Largeuint});
    3: if Assigned(FOnRegisterUserFailed) then
         FOnRegisterUserFailed(Self,
                               Params[0] {const WideString},
                               Params[1] {const WideString},
                               Params[2] {Integer},
                               Params[3] {Largeuint});
    4: if Assigned(FOnUnRegisterUser) then
         FOnUnRegisterUser(Self, Params[0] {const WideString});
    5: if Assigned(FOnCallSessionCreated) then
         FOnCallSessionCreated(Self,
                               Params[0] {Largeuint},
                               Params[1] {Integer});
    6: if Assigned(FOnCallSessionClosed) then
         FOnCallSessionClosed(Self,
                              Params[0] {Largeuint},
                              Params[1] {Integer});
    7: if Assigned(FOnCallSessionConnecting) then
         FOnCallSessionConnecting(Self,
                                  Params[0] {Largeuint},
                                  Params[1] {Integer},
                                  Params[2] {const WideString});
    8: if Assigned(FOnCallSessionFailed) then
         FOnCallSessionFailed(Self,
                              Params[0] {Largeuint},
                              Params[1] {Integer},
                              Params[2] {const WideString},
                              Params[3] {const WideString});
    9: if Assigned(FOnCallSessionConnected) then
         FOnCallSessionConnected(Self, Params[0] {Largeuint});
    10: if Assigned(FOnIncomingCall) then
         FOnIncomingCall(Self,
                         Params[0] {Largeuint},
                         Params[1] {const WideString},
                         Params[2] {const WideString},
                         Params[3] {const WideString},
                         Params[4] {Integer},
                         Params[5] {const WideString},
                         Params[6] {const WideString},
                         Params[7] {const WideString},
                         Params[8] {Integer});
    11: if Assigned(FOnCallSessionLost) then
         FOnCallSessionLost(Self, Params[0] {Largeuint});
    12: if Assigned(FOnCallSessionHangup) then
         FOnCallSessionHangup(Self, Params[0] {Largeuint});
    13: if Assigned(FOnCallSessionTimeout) then
         FOnCallSessionTimeout(Self, Params[0] {Largeuint});
    14: if Assigned(FOnCallSessionCancelled) then
         FOnCallSessionCancelled(Self, Params[0] {Largeuint});
    15: if Assigned(FOnChatMessageText) then
         FOnChatMessageText(Self,
                            Params[0] {Largeuint},
                            Params[1] {const WideString},
                            Params[2] {const WideString},
                            Params[3] {const WideString},
                            Params[4] {Integer},
                            Params[5] {const WideString},
                            Params[6] {const WideString},
                            Params[7] {Integer});
    16: if Assigned(FOnChatMessageSuccess) then
         FOnChatMessageSuccess(Self, Params[0] {Largeuint});
    17: if Assigned(FOnChatMessageFailed) then
         FOnChatMessageFailed(Self,
                              Params[0] {Largeuint},
                              Params[1] {Integer},
                              Params[2] {const WideString});
    18: if Assigned(FOnChatMessageTimeout) then
         FOnChatMessageTimeout(Self, Params[0] {Largeuint});
    19: if Assigned(FOnVaxFunctionCallOpenAI) then
         FOnVaxFunctionCallOpenAI(Self,
                                  Params[0] {Largeuint},
                                  Params[1] {const WideString},
                                  Params[2] {const WideString},
                                  Params[3] { NOT_OLEAUTO(PSafeArray) OleVariant},
                                  Params[4] { NOT_OLEAUTO(PSafeArray) OleVariant});
    20: if Assigned(FOnVaxSessionUpdatedOpenAI) then
         FOnVaxSessionUpdatedOpenAI(Self, Params[0] {Largeuint});
    21: if Assigned(FOnVaxAudioOutputTranscriptOpenAI) then
         FOnVaxAudioOutputTranscriptOpenAI(Self,
                                           Params[0] {Largeuint},
                                           Params[1] {const WideString});
    22: if Assigned(FOnVaxResponseDoneUsageOpenAI) then
         FOnVaxResponseDoneUsageOpenAI(Self,
                                       Params[0] {Largeuint},
                                       Params[1] {Integer},
                                       Params[2] {Integer},
                                       Params[3] {Integer});
    23: if Assigned(FOnVaxStatusOpenAI) then
         FOnVaxStatusOpenAI(Self,
                            Params[0] {Largeuint},
                            Params[1] {Integer},
                            Params[2] {const WideString});
    24: if Assigned(FOnVaxErrorOpenAI) then
         FOnVaxErrorOpenAI(Self,
                           Params[0] {Largeuint},
                           Params[1] {const WideString});
    25: if Assigned(FOnLineRegisterTrying) then
         FOnLineRegisterTrying(Self, Params[0] {const WideString});
    26: if Assigned(FOnLineRegisterFailed) then
         FOnLineRegisterFailed(Self,
                               Params[0] {const WideString},
                               Params[1] {Integer},
                               Params[2] {const WideString});
    27: if Assigned(FOnLineRegisterSuccess) then
         FOnLineRegisterSuccess(Self, Params[0] {const WideString});
    28: if Assigned(FOnLineUnRegisterTrying) then
         FOnLineUnRegisterTrying(Self, Params[0] {const WideString});
    29: if Assigned(FOnLineUnRegisterFailed) then
         FOnLineUnRegisterFailed(Self,
                                 Params[0] {const WideString},
                                 Params[1] {Integer},
                                 Params[2] {const WideString});
    30: if Assigned(FOnLineUnRegisterSuccess) then
         FOnLineUnRegisterSuccess(Self, Params[0] {const WideString});
    31: if Assigned(FOnAttackDetectedScanSIP) then
         FOnAttackDetectedScanSIP(Self,
                                  Params[0] {const WideString},
                                  Params[1] {const WideString},
                                  Params[2] {Integer},
                                  Params[3] {Integer});
    32: if Assigned(FOnAttackDetectedFloodSIP) then
         FOnAttackDetectedFloodSIP(Self,
                                   Params[0] {const WideString},
                                   Params[1] {Integer},
                                   Params[2] {Integer});
    33: if Assigned(FOnAttackDetectedBruteForceSIP) then
         FOnAttackDetectedBruteForceSIP(Self,
                                        Params[0] {const WideString},
                                        Params[1] {Integer},
                                        Params[2] {const WideString},
                                        Params[3] {Integer},
                                        Params[4] {Integer});
    34: if Assigned(FOnSendReqTransferCallTimeout) then
         FOnSendReqTransferCallTimeout(Self, Params[0] {Largeuint});
    35: if Assigned(FOnSendReqTransferCallAccepted) then
         FOnSendReqTransferCallAccepted(Self, Params[0] {Largeuint});
    36: if Assigned(FOnSendReqTransferCallFailed) then
         FOnSendReqTransferCallFailed(Self,
                                      Params[0] {Largeuint},
                                      Params[1] {Integer},
                                      Params[2] {const WideString});
    37: if Assigned(FOnServerConnectingREC) then
         FOnServerConnectingREC(Self,
                                Params[0] {Largeuint},
                                Params[1] {Integer},
                                Params[2] {const WideString});
    38: if Assigned(FOnServerConnectedREC) then
         FOnServerConnectedREC(Self, Params[0] {Largeuint});
    39: if Assigned(FOnServerFailedREC) then
         FOnServerFailedREC(Self,
                            Params[0] {Largeuint},
                            Params[1] {Integer},
                            Params[2] {const WideString});
    40: if Assigned(FOnServerTimeoutREC) then
         FOnServerTimeoutREC(Self, Params[0] {Largeuint});
    41: if Assigned(FOnServerHungupREC) then
         FOnServerHungupREC(Self, Params[0] {Largeuint});
    42: if Assigned(FOnVaxVectorSearchStartedOpenAI) then
         FOnVaxVectorSearchStartedOpenAI(Self,
                                         Params[0] {Largeuint},
                                         Params[1] {const WideString},
                                         Params[2] {const WideString});
    43: if Assigned(FOnVaxVectorSearchTryingOpenAI) then
         FOnVaxVectorSearchTryingOpenAI(Self,
                                        Params[0] {Largeuint},
                                        Params[1] {const WideString});
    44: if Assigned(FOnVaxVectorSearchSuccessOpenAI) then
         FOnVaxVectorSearchSuccessOpenAI(Self,
                                         Params[0] {Largeuint},
                                         Params[1] {const WideString},
                                         Params[2] {const WideString});
    45: if Assigned(FOnVaxVectorSearchFailedOpenAI) then
         FOnVaxVectorSearchFailedOpenAI(Self,
                                        Params[0] {Largeuint},
                                        Params[1] {const WideString},
                                        Params[2] {const WideString});
    46: if Assigned(FOnCallSessionErrorLog) then
         FOnCallSessionErrorLog(Self,
                                Params[0] {Largeuint},
                                Params[1] {Integer},
                                Params[2] {const WideString});
    47: if Assigned(FOnVaxErrorLog) then
         FOnVaxErrorLog(Self,
                        Params[0] {const WideString},
                        Params[1] {Integer},
                        Params[2] {const WideString});

    48: if Assigned(FOnVaxAudioInputTranscriptOpenAI) then
         FOnVaxAudioInputTranscriptOpenAI(Self,
                                           Params[0] {Largeuint},
                                           Params[1] {const WideString});

  end; {case DispID}
end;

function TServerLibVoAI.GetVaxErrorCode: Integer;
begin
  Result := DefaultInterface.GetVaxErrorCode;
end;

function TServerLibVoAI.GetVaxErrorText: WideString;
begin
  Result := DefaultInterface.GetVaxErrorText;
end;

function TServerLibVoAI.GetVersionFile: WideString;
begin
  Result := DefaultInterface.GetVersionFile;
end;

function TServerLibVoAI.GetVersionSDK: WideString;
begin
  Result := DefaultInterface.GetVersionSDK;
end;

procedure TServerLibVoAI.SetLicenseKey(const LicenseKey: WideString);
begin
  DefaultInterface.SetLicenseKey(LicenseKey);
end;

function TServerLibVoAI.Initialize(const DomainRealm: WideString): WordBool;
begin
  Result := DefaultInterface.Initialize(DomainRealm);
end;

procedure TServerLibVoAI.UnInitialize;
begin
  DefaultInterface.UnInitialize;
end;

function TServerLibVoAI.SetListenPortRangeRTP(ListenStartPort: Integer; ListenEndPort: Integer): WordBool;
begin
  Result := DefaultInterface.SetListenPortRangeRTP(ListenStartPort, ListenEndPort);
end;

function TServerLibVoAI.SetNetworkMediaRTP(const ListenIP: WideString; ListenStartPort: Integer): WordBool;
begin
  Result := DefaultInterface.SetNetworkMediaRTP(ListenIP, ListenStartPort);
end;

function TServerLibVoAI.CryptoMediaNONE(Forced: WordBool): WordBool;
begin
  Result := DefaultInterface.CryptoMediaNONE(Forced);
end;

function TServerLibVoAI.CryptoMediaSDP(Forced: WordBool): WordBool;
begin
  Result := DefaultInterface.CryptoMediaSDP(Forced);
end;

function TServerLibVoAI.AddNetworkRouteSIP(const AssignedIP: WideString; const RouterIP: WideString): WordBool;
begin
  Result := DefaultInterface.AddNetworkRouteSIP(AssignedIP, RouterIP);
end;

function TServerLibVoAI.AddNetworkRouteRTP(const AssignedIP: WideString; const RouterIP: WideString): WordBool;
begin
  Result := DefaultInterface.AddNetworkRouteRTP(AssignedIP, RouterIP);
end;

function TServerLibVoAI.OpenNetworkUDP(const ListenIP: WideString; ListenPort: Integer): WordBool;
begin
  Result := DefaultInterface.OpenNetworkUDP(ListenIP, ListenPort);
end;

function TServerLibVoAI.OpenNetworkTCP(const ListenIP: WideString; ListenPort: Integer): WordBool;
begin
  Result := DefaultInterface.OpenNetworkTCP(ListenIP, ListenPort);
end;

function TServerLibVoAI.OpenNetworkTLS(const ListenIP: WideString; ListenPort: Integer; 
                                       const CertPEM: WideString): WordBool;
begin
  Result := DefaultInterface.OpenNetworkTLS(ListenIP, ListenPort, CertPEM);
end;

procedure TServerLibVoAI.CloseNetworkUDP;
begin
  DefaultInterface.CloseNetworkUDP;
end;

procedure TServerLibVoAI.CloseNetworkTCP;
begin
  DefaultInterface.CloseNetworkTCP;
end;

procedure TServerLibVoAI.CloseNetworkTLS;
begin
  DefaultInterface.CloseNetworkTLS;
end;

function TServerLibVoAI.AddUser(const UserName: WideString; const Password: WideString; 
                                const AudioCodecList: WideString): WordBool;
begin
  Result := DefaultInterface.AddUser(UserName, Password, AudioCodecList);
end;

procedure TServerLibVoAI.RemoveUser(const UserName: WideString);
begin
  DefaultInterface.RemoveUser(UserName);
end;

function TServerLibVoAI.RegisterUserExpiry(Expiry: Integer): WordBool;
begin
  Result := DefaultInterface.RegisterUserExpiry(Expiry);
end;

function TServerLibVoAI.AttachRegister(RegId: Largeuint; const UserName: WideString): WordBool;
begin
  Result := DefaultInterface.AttachRegister(RegId, UserName);
end;

function TServerLibVoAI.AcceptRegister(RegId: Largeuint): WordBool;
begin
  Result := DefaultInterface.AcceptRegister(RegId);
end;

function TServerLibVoAI.RejectRegister(RegId: Largeuint; StatusCode: Integer; 
                                       const ReasonPhrase: WideString): WordBool;
begin
  Result := DefaultInterface.RejectRegister(RegId, StatusCode, ReasonPhrase);
end;

function TServerLibVoAI.AuthRegister(RegId: Largeuint): WordBool;
begin
  Result := DefaultInterface.AuthRegister(RegId);
end;

function TServerLibVoAI.AddLine(const LineName: WideString; LineType: Integer; 
                                const DisplayName: WideString; const UserName: WideString; 
                                const AuthLogin: WideString; const AuthPwd: WideString; 
                                const DomainRealm: WideString; const ServerAddr: WideString; 
                                ServerPort: Integer; const AudioCodecList: WideString): WordBool;
begin
  Result := DefaultInterface.AddLine(LineName, LineType, DisplayName, UserName, AuthLogin, AuthPwd, 
                                     DomainRealm, ServerAddr, ServerPort, AudioCodecList);
end;

procedure TServerLibVoAI.RemoveLine(const LineName: WideString);
begin
  DefaultInterface.RemoveLine(LineName);
end;

function TServerLibVoAI.RegisterLine(const LineName: WideString; Expire: Integer): WordBool;
begin
  Result := DefaultInterface.RegisterLine(LineName, Expire);
end;

function TServerLibVoAI.UnRegisterLine(const LineName: WideString): WordBool;
begin
  Result := DefaultInterface.UnRegisterLine(LineName);
end;

function TServerLibVoAI.AcceptCallSession(SessionId: Largeuint; Timeout: Integer; 
                                          const KeyOpenAI: WideString; const Prompt: WideString; 
                                          const Model: WideString; const Voice: WideString; OutputAudioSpeed: Double): WordBool;
begin
  Result := DefaultInterface.AcceptCallSession(SessionId, Timeout, KeyOpenAI, Prompt, Model, Voice, OutputAudioSpeed);
end;

function TServerLibVoAI.RejectCallSession(SessionId: Largeuint; StatusCode: Integer; 
                                          const ReasonPhrase: WideString): WordBool;
begin
  Result := DefaultInterface.RejectCallSession(SessionId, StatusCode, ReasonPhrase);
end;

function TServerLibVoAI.CloseCallSession(SessionId: Largeuint): WordBool;
begin
  Result := DefaultInterface.CloseCallSession(SessionId);
end;

function TServerLibVoAI.DialCallSession(const CallerName: WideString; const CallerId: WideString; 
                                        const DialNo: WideString; const ToPeerName: WideString; 
                                        Timeout: Integer): Largeuint;
begin
  Result := DefaultInterface.DialCallSession(CallerName, CallerId, DialNo, ToPeerName, Timeout);
end;

function TServerLibVoAI.CallSessionSendStatusResponse(SessionId: Largeuint; StatusCode: Integer; 
                                                      const ReasonPhrase: WideString; 
                                                      const ContactURI: WideString): WordBool;
begin
  Result := DefaultInterface.CallSessionSendStatusResponse(SessionId, StatusCode, ReasonPhrase, 
                                                           ContactURI);
end;

function TServerLibVoAI.SendReqTransferCallBlind(SessionId: Largeuint; const ToUserName: WideString): WordBool;
begin
  Result := DefaultInterface.SendReqTransferCallBlind(SessionId, ToUserName);
end;

function TServerLibVoAI.SendReqTransferCallConsult(SessionId: Largeuint; ToSessionId: Largeuint): WordBool;
begin
  Result := DefaultInterface.SendReqTransferCallConsult(SessionId, ToSessionId);
end;

function TServerLibVoAI.AcceptChatMessage(ChatMsgId: Largeuint; const ToPeerName: WideString): WordBool;
begin
  Result := DefaultInterface.AcceptChatMessage(ChatMsgId, ToPeerName);
end;

procedure TServerLibVoAI.RejectChatMessage(ChatMsgId: Largeuint; StatusCode: Integer; 
                                           const ReasonPhrase: WideString);
begin
  DefaultInterface.RejectChatMessage(ChatMsgId, StatusCode, ReasonPhrase);
end;

function TServerLibVoAI.SendChatMessageText(const MsgFrom: WideString; const MsgTo: WideString; 
                                            const MsgText: WideString; const ToPeerName: WideString): Largeuint;
begin
  Result := DefaultInterface.SendChatMessageText(MsgFrom, MsgTo, MsgText, ToPeerName);
end;

function TServerLibVoAI.AudioSessionLost(Enable: WordBool; Timeout: Integer): WordBool;
begin
  Result := DefaultInterface.AudioSessionLost(Enable, Timeout);
end;

function TServerLibVoAI.SetUserAgentName(const Name: WideString): WordBool;
begin
  Result := DefaultInterface.SetUserAgentName(Name);
end;

function TServerLibVoAI.GetUserAgentName: WideString;
begin
  Result := DefaultInterface.GetUserAgentName;
end;

function TServerLibVoAI.SetSessionNameSDP(const Name: WideString): WordBool;
begin
  Result := DefaultInterface.SetSessionNameSDP(Name);
end;

function TServerLibVoAI.GetSessionNameSDP: WideString;
begin
  Result := DefaultInterface.GetSessionNameSDP;
end;

function TServerLibVoAI.SendDigitDTMF(SessionId: Largeuint; const DigitDTMF: WideString; 
                                      TypeDTMF: Integer): WordBool;
begin
  Result := DefaultInterface.SendDigitDTMF(SessionId, DigitDTMF, TypeDTMF);
end;

function TServerLibVoAI.DetectDigitDTMF(SessionId: Largeuint; TypeDTMF: Integer; Enable: WordBool; 
                                        MilliSecTimeout: Integer): WordBool;
begin
  Result := DefaultInterface.DetectDigitDTMF(SessionId, TypeDTMF, Enable, MilliSecTimeout);
end;

function TServerLibVoAI.ActivateSemanticVAD(SessionId: Largeuint; const Eagerness: WideString): WordBool;
begin
  Result := DefaultInterface.ActivateSemanticVAD(SessionId, Eagerness);
end;

function TServerLibVoAI.ActivateAcousticVAD(SessionId: Largeuint; Threshold: Double; 
                                            PrefixPadding: Integer; SilenceDuration: Integer): WordBool;
begin
  Result := DefaultInterface.ActivateAcousticVAD(SessionId, Threshold, PrefixPadding, 
                                                 SilenceDuration);
end;

function TServerLibVoAI.UpdateSessionOpenAI(SessionId: Largeuint; const Prompt: WideString; 
                                            OutputAudioSpeed: Double): WordBool;
begin
  Result := DefaultInterface.UpdateSessionOpenAI(SessionId, Prompt, OutputAudioSpeed);
end;

function TServerLibVoAI.SendInputOpenAI(SessionId: Largeuint; const Input: WideString): WordBool;
begin
  Result := DefaultInterface.SendInputOpenAI(SessionId, Input);
end;

function TServerLibVoAI.AddFunctionOpenAI(SessionId: Largeuint; const FuncName: WideString; 
                                          const FuncDesc: WideString): WordBool;
begin
  Result := DefaultInterface.AddFunctionOpenAI(SessionId, FuncName, FuncDesc);
end;

procedure TServerLibVoAI.RemoveFunctionOpenAI(SessionId: Largeuint; const FuncName: WideString);
begin
  DefaultInterface.RemoveFunctionOpenAI(SessionId, FuncName);
end;

procedure TServerLibVoAI.RemoveFunctionAllOpenAI(SessionId: Largeuint);
begin
  DefaultInterface.RemoveFunctionAllOpenAI(SessionId);
end;

function TServerLibVoAI.AddFunctionParamOpenAI(SessionId: Largeuint; const FuncName: WideString; 
                                               const ParamName: WideString; 
                                               const ParamDesc: WideString): WordBool;
begin
  Result := DefaultInterface.AddFunctionParamOpenAI(SessionId, FuncName, ParamName, ParamDesc);
end;

function TServerLibVoAI.AddFunctionParamEnumOpenAI(SessionId: Largeuint; 
                                                   const FuncName: WideString; 
                                                   const ParamName: WideString; 
                                                   const EnumValue: WideString): WordBool;
begin
  Result := DefaultInterface.AddFunctionParamEnumOpenAI(SessionId, FuncName, ParamName, EnumValue);
end;

function TServerLibVoAI.SendFunctionResultOpenAI(SessionId: Largeuint; const CallId: WideString; 
                                                 const Output: WideString): WordBool;
begin
  Result := DefaultInterface.SendFunctionResultOpenAI(SessionId, CallId, Output);
end;

function TServerLibVoAI.AttackDetectScanSIP(const DomainName: WideString): WordBool;
begin
  Result := DefaultInterface.AttackDetectScanSIP(DomainName);
end;

function TServerLibVoAI.AttackDetectFloodSIP(ReqRecvLimit: Integer): WordBool;
begin
  Result := DefaultInterface.AttackDetectFloodSIP(ReqRecvLimit);
end;

function TServerLibVoAI.AttackDetectBruteForceSIP(FailureCount: Integer; FailureInterval: Integer): WordBool;
begin
  Result := DefaultInterface.AttackDetectBruteForceSIP(FailureCount, FailureInterval);
end;

function TServerLibVoAI.CallSessionMuteVoice(SessionId: Largeuint; Listen: WordBool;
                                             Speak: WordBool): WordBool;
begin
  Result := DefaultInterface.CallSessionMuteVoice(SessionId, Listen, Speak);
end;

function TServerLibVoAI.SetExtDataREC(SessionId: Largeuint; const ExtData: WideString): WordBool;
begin
  Result := DefaultInterface.SetExtDataREC(SessionId, ExtData);
end;

function TServerLibVoAI.ConnectToServerREC(SessionId: Largeuint; const CallerName: WideString; 
                                           const CallerId: WideString; const DialNo: WideString; 
                                           const ToPeerName: WideString; Timeout: Integer): WordBool;
begin
  Result := DefaultInterface.ConnectToServerREC(SessionId, CallerName, CallerId, DialNo, 
                                                ToPeerName, Timeout);
end;

function TServerLibVoAI.MuteCallServerREC(SessionId: Largeuint; nMuteType: Integer): WordBool;
begin
  Result := DefaultInterface.MuteCallServerREC(SessionId, nMuteType);
end;

function TServerLibVoAI.GetUserAgentNameCall(SessionId: Largeuint): WideString;
begin
  Result := DefaultInterface.GetUserAgentNameCall(SessionId);
end;

function TServerLibVoAI.AddVectorStoreSearchOpenAI(SessionId: Largeuint; 
                                                   const SearchName: WideString; 
                                                   const SearchDesc: WideString; 
                                                   const VectorStoreId: WideString; 
                                                   const Filters: WideString; nMaxNoResults: Integer): WordBool;
begin
  Result := DefaultInterface.AddVectorStoreSearchOpenAI(SessionId, SearchName, SearchDesc, 
                                                        VectorStoreId, Filters, nMaxNoResults);
end;

procedure TServerLibVoAI.RemoveVectorStoreSearchOpenAI(SessionId: Largeuint; 
                                                       const SearchName: WideString);
begin
  DefaultInterface.RemoveVectorStoreSearchOpenAI(SessionId, SearchName);
end;

procedure TServerLibVoAI.RemoveVectorStoreSearchAllOpenAI(SessionId: Largeuint);
begin
  DefaultInterface.RemoveVectorStoreSearchAllOpenAI(SessionId);
end;

function TServerLibVoAI.InputTranscriptOpenAI(SessionId: Largeuint; Activate: WordBool; const Model: WideString; const NoiseReduction: WideString): WordBool;
begin
  Result := DefaultInterface.InputTranscriptOpenAI(SessionId, Activate, Model, NoiseReduction);
end;

procedure Register;
begin
  RegisterComponents(dtlServerPage, [TServerLibVoAI]);
end;

end.
