0

I am using the Async Professional library in delphi 6 to perform tapi calls to an Avaya Ip Office call center.

I have succesfully performed outgoing-internal calls via the vcl components (ApdTapiDevice1,ApdTapiStatus1,ApdComPort1).

I'd like to detect the incoming phone number of a call. Is this possible?

Thanks in advance!

gman
  • 27
  • 7

1 Answers1

0

TApdTapiDevice has an OnTapiCallerID event you can hook onto to get the CallerID string and CallerIDName.

It also provides a CopyCallInfo method which provides an ITCallInfo interface (see : MSDN ITCallInfo). This exposes a method get_CallInfo (MSDN : get_CallInfo) which can retrieve information strings enumerated by the CALLINFO_STRING enum (MSDN : CALLINFO_STRING).

The TApdVoIP component also provides a CallInfo property which contains an extended record of information about a call.

TApdVoIPCallInfo = record
    InfoAvailable : Boolean;       { True if we get the info, False if the }
                                   { ITCallInfo interface isn't available  }
    { string type fields }
    CallerIDName,                  { the name of the caller }
    CallerIDNumber,                { the number of the caller }
    CalledIDName,                  { the name of the called location }
    CalledIDNumber,                { the number of the called location }
    ConnectedIDName,               { the name of the connected location }
    ConnectedIDNumber,             { the number of the connected location }
    CalledPartyFriendlyName,       { the called party friendly name }
    Comment,                       { a comment about the call provided by the originator }
    DisplayableAddress,            { a displayable version of the called or calling address }
    CallingPartyID : string;       { the identifier of the calling party }
    { DWORD types }
    MediaTypesAvailable,           { the media types available on the call (TAPIMEDIATYPE_*) }
    CallerIDAddressType,           { the address types (LINEADDRESSTYPE_*) }
    CalledIDAddressType,
    ConnectedIDAddressType,
    Origin,                        { the origin of the call (LINECALLORIGIN_*) }
    Reason,                        { the reason for the call (LINECALLREASON_*) }
    MinRate,                       { the minimun data rate in bps }
    MaxRate,                       { the maximum data rate in bps }
    Rate : DWORD;                  { the current rate of the call in bps }
  end;

If you're doing serious development with AsyncPro, it is well worth it to keep a copy of the reference manual handy.

J...
  • 30,968
  • 6
  • 66
  • 143
  • Thanks J for the reply. I already tried the ontapicallerid but nothing seems to fire the specific event. Is there any chance that the voip physical phone that is binded with a user from the call center to prevent the software ip phone with the same usernane from getting the data stream? I haven't tried the TApdVoIP i'll give it a try. Yes the reference is very good i've been studying this for the last 2 days. – gman Dec 17 '15 at 14:08
  • @gman The event only fires after a connection is made *if* there are ID strings returned. The documentation states pretty clearly that the device and telephone service have to support this function for it to work. You would have to check to see if that is the case. – J... Dec 17 '15 at 14:19
  • Strange thing is that a connection is made!Maybe it has something to do then with the call center and it's setup-parameters. Hope to find something there. Again thanks for the reply! – gman Dec 17 '15 at 14:32