[
  uuid(7C974670-6AD1-4A9C-A49D-BC802D5B7925), 
  version(1.0), 
  helpstring("GTSIPCtrl ActiveX Control module"), 
  helpfile("C:\\temp\\projects\\bin\\GTSIPCtrl.hlp"), 
  control, 
  custom(DE77BA64-517C-11D1-A2DA-0000F8773CE9, 83951780), 
  custom(DE77BA63-517C-11D1-A2DA-0000F8773CE9, 1198040693)
    
]
library GTSIPCTRLLib
{

  importlib("stdole2.tlb");
  importlib("stdvcl40.dll");

  [
    uuid(F2A6A592-BBB1-41DF-9653-D069B4D5C977), 
    helpstring("Dispatch interface for GTSIPAPI Control"), 
    hidden
  ]
   dispinterface _DGTSIPAPI
  {
    properties:
    methods:
    [
    id(0x00000001)
    ]
    VARIANT_BOOL CFGKeyExists(BSTR sKey );
    [
    id(0x00000002)
    ]
    BSTR CFGGetValue(BSTR sKey, BSTR sDef );
    [
    id(0x00000003)
    ]
    long CFGGetIntValue(BSTR sKey, long Def );
    [
    id(0x00000004)
    ]
    long CFGGetLongValue(BSTR sKey, long Def );
    [
    id(0x00000005)
    ]
    void CFGSetValue(BSTR sKey, BSTR sVal );
    [
    id(0x00000006)
    ]
    void Log(long nLevel, BSTR sInfo );
    [
    id(0x00000007)
    ]
    VARIANT_BOOL CreateEnv( void );
    [
    id(0x00000008)
    ]
    VARIANT_BOOL DestroyEnv( void );
    [
    id(0x00000009)
    ]
    VARIANT_BOOL StartServer( void );
    [
    id(0x0000000A)
    ]
    VARIANT_BOOL StopServer( void );
    [
    id(0x0000000B)
    ]
    void SendMake(long ChanID, BSTR sCallee, BSTR sCaller );
    [
    id(0x0000000C)
    ]
    void SendAnswer(long ChanID );
    [
    id(0x0000000D)
    ]
    void SendHungUp(long ChanID );
    [
    id(0x0000000E)
    ]
    void SendHold(long ChanID );
    [
    id(0x0000000F)
    ]
    void SendTransfer(long ChanID, BSTR sTransferTo );
    [
    id(0x00000010)
    ]
    void SendHandle(long ChanID1, long ChanID2 );
    [
    id(0x00000011)
    ]
    void SendGetStatus(long ChanID );
    [
    id(0x00000012)
    ]
    void SendGetRegStatus(long SIPAccID );
    [
    id(0x00000013)
    ]
    void SendPlayDTMFStr(long ChanID, BSTR DTMFStr );
    [
    id(0x00000014)
    ]
    void SendEnableDTMF(long ChanID );
    [
    id(0x00000015)
    ]
    void SendDisableDTMF(long ChanID );
    [
    id(0x00000016)
    ]
    void SendDuplexConnect(long ChanID1, long ChanID2 );
    [
    id(0x00000017)
    ]
    void SendDuplexDisconnect(long ChanID1, long ChanID2 );
    [
    id(0x00000018)
    ]
    void SendHalfConnect(long ChanID1, long ChanID2 );
    [
    id(0x00000019)
    ]
    void SendHalfDisconnect(long ChanID1, long ChanID2 );
    [
    id(0x0000001A)
    ]
    void SendPlayAudio(long ChanID, BSTR AudioFileName, long MaxDigits, BSTR TermStr, long TimeOut );
    [
    id(0x0000001B)
    ]
    void SendRecordAudio(long ChanID, BSTR AudioFileName, long MaxDigits, BSTR TermStr, long TimeOut );
    [
    id(0x0000001C)
    ]
    void SendAddAudio(long ChanID, BSTR AudioFileName );
    [
    id(0x0000001D)
    ]
    void SendClearAudio(long ChanID );
    [
    id(0x0000001E)
    ]
    void SendStopAudio(long ChanID );
    [
    id(0x0000001F)
    ]
    void SendSetAudioFormat(long ChanID, long AudioCode, long AudioSample, long AudioBit );
    [
    id(0x00000020)
    ]
    void SendGetAudioStatus(long ChanID );
    [
    id(0x00000021)
    ]
    void SendStartDXAudio(long ChanID );
    [
    id(0x00000022)
    ]
    void SendStopDXAudio(long ChanID );
    [
    id(0x00000023)
    ]
    void SendResetDXAudio(long ChanID );
    [
    id(0x00000024)
    ]
    long GetTotalChannelNumber( void );
    [
    id(0x00000025)
    ]
    short GetLocalSIPPort( void );
    [
    id(0x00000026)
    ]
    short GetLocalRTPPort( void );
    [
    id(0x00000027)
    ]
    void SetMicVolume(float v );
    [
    id(0x00000028)
    ]
    float GetMicVolume( void );
    [
    id(0x00000029)
    ]
    void SetSpeakerVolume(float v );
    [
    id(0x0000002A)
    ]
    float GetSpeakerVolume( void );
    [
    id(0x0000002B)
    ]
    long GetDetectedNATType( void );
    [
    id(0x0000002C)
    ]
    BSTR GetMappedPublicSIPIPAddress( void );
    [
    id(0x0000002D)
    ]
    short GetMappedPublicSIPIPPort( void );
    [
    id(0x0000002E)
    ]
    BSTR GetAppName( void );
    [
    id(0x0000002F)
    ]
    void SetAppName(BSTR sAppName );
    [
    id(0x00000030)
    ]
    BSTR GetLicTo( void );
    [
    id(0x00000031)
    ]
    long GetChanAudioCodec(long ChanID );
    [
    id(0x00000032)
    ]
    VARIANT_BOOL PlayNumberTone(short num );
    [
    id(0x00000033)
    ]
    VARIANT_BOOL PlayLocalRingSound( void );
    [
    id(0x00000034)
    ]
    VARIANT_BOOL PlayRemoteRingSound( void );
    [
    id(0x00000035)
    ]
    VARIANT_BOOL PlayBusySound( void );
    [
    id(0x00000036)
    ]
    long GetChanStatus(long ChanID );
    [
    id(0x00000037)
    ]
    BSTR GetChanCallerNum(short ChanID );
    [
    id(0x00000038)
    ]
    BSTR GetChanCalleeNum(long ChanID );
    [
    id(0x00000039)
    ]
    DATE GetChanCallStartTime(long ChanID );
    [
    id(0x0000003A)
    ]
    DATE GetChanCallEndTime(long ChanID );
    [
    id(0x0000003B)
    ]
    VARIANT_BOOL GetChanCallOriginate(long ChanID );
    [
    id(0x0000003C)
    ]
    void ProcessGTAPIEvent( void );
    [
    id(0x0000003D)
    ]
    long GetChanLastMsgCode(long ChanID );
    [
    id(0x0000003E)
    ]
    BSTR GetChanLastMsgText(long ChanID );
    [
    id(0x0000003F)
    ]
    void StartTimer(long ChanID, long MilliSeconds );
    [
    id(0x00000040)
    ]
    void StopTimer(long ChanID );
    [
    id(0xFFFFFDD8)
    ]
    void AboutBox( void );
  };

  [
    uuid(46AD66D3-4B95-44C5-9615-B03C9ED4FE15), 
    helpstring("Event interface for GTSIPAPI Control")
  ]
   dispinterface _DGTSIPAPIEvents
  {
    properties:
    methods:
    [
    id(0x00000001)
    ]
    void OnCallConnected(long ChanID );
    [
    id(0x00000002)
    ]
    void OnCallOffered(long ChanID, BSTR Caller, BSTR Callee, BSTR DestAddr, BSTR ViaAddr, BSTR IPAddr, long IPPort );
    [
    id(0x00000003)
    ]
    void OnCallDialing(long ChanID, BSTR Caller, BSTR Callee );
    [
    id(0x00000004)
    ]
    void OnCallRinging(long ChanID );
    [
    id(0x00000005)
    ]
    void OnCallIdle(long ChanID );
    [
    id(0x00000006)
    ]
    void OnCallHolding(long ChanID, long HoldOnStatus );
    [
    id(0x00000007)
    ]
    void OnCallTransfering(long ChanID, BSTR DestAddr );
    [
    id(0x00000008)
    ]
    void OnAudioPlayDone(long ChanID, long DoneReason, BSTR DTMFStr );
    [
    id(0x00000009)
    ]
    void OnAudioRecordDone(long ChanID, long DoneReason, BSTR DTMFStr );
    [
    id(0x0000000A)
    ]
    void OnAudioStatus(long ChanID, long ResType, long StatusCode );
    [
    id(0x0000000B)
    ]
    void OnDTMFDone(long ChanID, long DoneReason, BSTR DTMFStr );
    [
    id(0x0000000C)
    ]
    void OnDTMFKeyDown(long ChanID, short KeyValue, long ClockTicks );
    [
    id(0x0000000D)
    ]
    void OnDTMFKeyUp(long ChanID, short KeyValue, long ClockTicks );
    [
    id(0x0000000E)
    ]
    void OnRecvStatus(long ChanID1, long ChanID2, long ChanStatus );
    [
    id(0x0000000F)
    ]
    void OnRecvRegStatus(long SIPAccID, long Status, long RegUnixTime );
    [
    id(0x00000010)
    ]
    void OnRecvError(long ChanID, long ErrCode );
    [
    id(0x00000011)
    ]
    void OnNotifySimpleMsgSummary(BSTR MsgWaiting, BSTR MsgAccount, BSTR VoiceMsg );
    [
    id(0x00000012)
    ]
    void OnRecvTimer(long ChanID );
  };

  [
    uuid(FF888D2E-39C2-42CC-879E-2D7BA36480E7), 
    helpstring("GTSIPAPI Control"), 
    control
  ]
  coclass GTSIPAPI
  {
    [default] dispinterface _DGTSIPAPI;
    [default, source] dispinterface _DGTSIPAPIEvents;
  };

};