Click here to Skip to main content
14,126,835 members
   

Delphi

 
GeneralRe: dbx.sql in an unrecognized command type error Pin
Richard MacCutchan9-Jun-15 5:06
protectorRichard MacCutchan9-Jun-15 5:06 
GeneralRe: dbx.sql in an unrecognized command type error Pin
Member 117531599-Jun-15 5:28
memberMember 117531599-Jun-15 5:28 
GeneralRe: dbx.sql in an unrecognized command type error Pin
Richard MacCutchan9-Jun-15 5:43
protectorRichard MacCutchan9-Jun-15 5:43 
QuestionWhat will be compressed when using Compress function in FastReport Pin
Thanhtrung.xl12-May-15 22:44
memberThanhtrung.xl12-May-15 22:44 
SuggestionRe: What will be compressed when using Compress function in FastReport Pin
smags1318-May-15 20:14
membersmags1318-May-15 20:14 
QuestionProblems with .QRP files Pin
Matheus Pombo10-Mar-15 5:30
memberMatheus Pombo10-Mar-15 5:30 
QuestionRe: Problems with .QRP files Pin
Richard MacCutchan10-Mar-15 6:00
protectorRichard MacCutchan10-Mar-15 6:00 
QuestionReceive Call TAPI3 with delphi Pin
delphix526-Nov-14 11:47
memberdelphix526-Nov-14 11:47 
hi,
When I program tapi3 in delphi 7 using the code below, I can make a
outgoing call, but I can't catch any events. Has anybody face the same
problem ?

Wensheng


unit Unit10;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
  Dialogs, TAPI3Lib_TLB, StdCtrls, ActiveX, ComObj, OleServer;
{
type
  TTapiEventsSink = class( TObject, IConnectionPointContainer, I)
    procedure TAPI1Event(ASender: TObject; TapiEvent: TOleEnum;
      const pEvent: IDispatch);
  end;
}
type
  TForm1 = class(TForm)
    ComboBox1: TComboBox;
    Button1: TButton;
    Button2: TButton;
    Edit1: TEdit;
    Button3: TButton;
    Edit2: TEdit;
    Button4: TButton;
    TAPI1: TTAPI;
    Memo1: TMemo;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure TAPI1Event(ASender: TObject; TapiEvent: TOleEnum;
      const pEvent: IDispatch);
  private
    { Private declarations }
  public
    { Public declarations }
    tapi3 : ITTAPI;
    addr : ITAddress;
    media : ITMediaSupport;
    addrs : IEnumAddress;
    term : ITTerminal;
    terminalSupport : ITTerminalSupport;
    basicall :ITBasicCallControl;
    dir : TOleEnum;

    streamControl : ITStreamControl;
    enumStream : IEnumStream;
    stream : ITStream;
    mediatype : Integer;
    direct : TERMINAL_DIRECTION;
    lAddressType : Integer;
    bHold : Boolean;

    event : ITCallNotificationEvent;
    tapievent : ITTAPIEventNotification;
    unknown : IUnknown;

  end;

const TAPI3_CALL_EVENTS =
        TE_CALLMEDIA OR
        TE_CALLNOTIFICATION OR
        TE_CALLSTATE;
const
  TAPIMEDIATYPE_AUDIO = $8;
  TAPIMEDIATYPE_VEDIO = $8000;
  TAPIMEDIATYPE_DATEMODEM = $10;
  TAPIMEDIATYPE_G3FAX = $20;
  LINEADDRESSTYPE_PHONENUMBER = $00000001;
  EVENT_FILTER =
    TE_TAPIOBJECT OR
    TE_ADDRESS OR
    TE_CALLNOTIFICATION OR
    TE_CALLSTATE OR
    TE_CALLMEDIA OR
    TE_CALLHUB OR
    TE_CALLINFOCHANGE OR
    TE_PRIVATE OR
    TE_REQUEST OR
    TE_AGENT OR
    TE_AGENTSESSION OR
    TE_QOSEVENT OR
    TE_AGENTHANDLER OR
    TE_ACDGROUP OR
    TE_QUEUE OR
    TE_DIGITEVENT OR
    TE_GENERATEEVENT;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
  lwCeltFetched : Cardinal;
  cookievar : Integer;
begin
  bHold := false;

  tapi1.Initialize;
  tapi1.Connect;

  { Select an address }
  // list address
  addrs := tapi1.DefaultInterface.EnumerateAddresses;
  //addrs := tapi3.EnumerateAddresses;
  while ( S_OK = addrs.Next(1,addr,lwCeltFetched) ) do
  begin
    ComboBox1.Items.Add(addr.AddressName);
  end;

end;

procedure TForm1.Button1Click(Sender: TObject);
begin

    basicall.Disconnect(DC_NORMAL);

end;

procedure TForm1.Button2Click(Sender: TObject);
var
  lwCeltFetched : Cardinal;
  iRes : Integer;
  i : Integer;
  hr : Integer;

begin

  { Select an address }
  addrs.Reset;
  while ( S_OK = addrs.Next(1,addr,lwCeltFetched) ) do
    begin
      hr := addr.QueryInterface(IID_ITMediaSupport,media);
      if ( true = media.QueryMediaType(TAPIMEDIATYPE_AUDIO) ) then
        break;
    end;


  tapi1.EventFilter := EVENT_FILTER;

tapi1.RegisterCallNotifications(addr,true,false,TAPIMEDIATYPE_AUDIO,1);


end;

procedure TForm1.Button3Click(Sender: TObject);
var
  phonenum : array [0..30] of char;
begin
    lAddressType := LINEADDRESSTYPE_PHONENUMBER;
    StrPCopy( phonenum, Edit1.Text );
    basicall :=
addr.CreateCall(phonenum,lAddressType,TAPIMEDIATYPE_AUDIO);
    basicall.Connect(false);


end;

procedure TForm1.TAPI1Event(ASender: TObject; TapiEvent: TOleEnum;
  const pEvent: IDispatch);
var
  callinfo : ITCallInfo;
  event : ITCallNotificationEvent;
begin
  Memo1.Lines.Add('hi');
  Memo1.Refresh;
  case TapiEvent of
  TE_CALLNOTIFICATION :
    begin
    Memo1.Lines.Add('call notification');
    end;
  end;

end;

QuestionFTKernelAPI BitTorrent Protocol Library & Demo Source not working for downloading1080pixel filel file Pin
Member 1101132619-Aug-14 5:04
memberMember 1101132619-Aug-14 5:04 
AnswerRe: FTKernelAPI BitTorrent Protocol Library & Demo Source not working for downloading1080pixel filel file Pin
Richard MacCutchan19-Aug-14 5:11
protectorRichard MacCutchan19-Aug-14 5:11 
Questioncreate transparent form in vcl Pin
fatemehsoleimani12-Feb-14 20:13
memberfatemehsoleimani12-Feb-14 20:13 
GeneralRe: create transparent form in vcl Pin
smags1316-Mar-14 17:29
membersmags1316-Mar-14 17:29 
AnswerRe: create transparent form in vcl Pin
future201512-Jun-14 2:35
memberfuture201512-Jun-14 2:35 
GeneralRe: create transparent form in vcl Pin
fatemehsoleimani6-Oct-14 3:38
memberfatemehsoleimani6-Oct-14 3:38 
Questionimage curve mode for background form Pin
fatemehsoleimani8-Feb-14 20:07
memberfatemehsoleimani8-Feb-14 20:07 
AnswerRe: image curve mode for background form Pin
raja1always10-Feb-14 19:42
memberraja1always10-Feb-14 19:42 
GeneralRe: image curve mode for background form Pin
fatemehsoleimani11-Feb-14 4:59
memberfatemehsoleimani11-Feb-14 4:59 
Questionchang form Pin
fatemehsoleimani8-Feb-14 17:42
memberfatemehsoleimani8-Feb-14 17:42 
AnswerRe: chang form Pin
raja1always10-Feb-14 19:43
memberraja1always10-Feb-14 19:43 
GeneralRe: chang form Pin
fatemehsoleimani6-Oct-14 3:40
memberfatemehsoleimani6-Oct-14 3:40 
AnswerRe: chang form Pin
smags1314-Mar-14 19:52
membersmags1314-Mar-14 19:52 
GeneralRe: chang form Pin
fatemehsoleimani6-Oct-14 3:40
memberfatemehsoleimani6-Oct-14 3:40 
Question.Net Com Class Callback to Delphi Pin
P1kfr1k9-Oct-13 1:35
memberP1kfr1k9-Oct-13 1:35 
AnswerRe: .Net Com Class Callback to Delphi Pin
smags1311-Oct-13 7:55
membersmags1311-Oct-13 7:55 
QuestionXE4 FMX.TCanvas.DrawLine Pin
Black68cougar28-Aug-13 18:12
memberBlack68cougar28-Aug-13 18:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web05 | 2.8.190518.1 | Last Updated 25 Apr 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid