
The TAPI interface also offers the option of carrying out a dialing process asynchronously (in the background). A new option has been added to the TAPI interface with regard to this functionality.
Introduction
The TAPI interface in conzept 16 makes it easy to add telephony functions to an existing application. The API offers commands for establishing connections as well as for monitoring lines to register incoming calls. In addition, the TAPI interface offers extended functions such as conference calls and call forwarding. For an introduction to the TAPI interface, I recommend that interested readers read the blog articles TAPI Ereignisse und TAPI Monitoring.
TapiDial
The TAPI interface offers the command TapiDial()
for carrying out a dialing process. In addition to the telephone number to be dialed, an additional option can also be passed here. If this is not specified, the system waits for the connection with the call partner to be established. By specifying _TapiAsyncDial
, however, the dialing process is only started. The command therefore returns while the connection is being established asynchronously. This enables the caller to monitor and react to events of the TAPI interface.
TapiLists
Events are monitored using the TapiListen()
function. This results in the problem that events are triggered by the TapiDial()
command, which in turn are also recorded by the monitoring via TapiListen()
. The events are therefore triggered twice: once for the outgoing line (TapiDial()
) and once for the monitored line (TapiListen()
). As the call ID of the connection generated by TapiDial()
is not known, no distinction can be made here as to which events relate to the outgoing or incoming line.
Tell me who you are…
The problem can be solved from the upcoming version 5.7.07 by an additional option for TapiDial()
. By specifying _TapiReturnCallID
, an asynchronous dialing process is started, as is already possible with _TapiAsyncDial
. However, TapiDial()
returns the call ID of the generated call if successful.
// Asynchronous dialing process with return of the call ID.
gCallID # TapiDial('123456',_TapiReturnCallID).
As the call ID of the outgoing call is now known, the events in the EvtTapi
can be filtered accordingly.
sub EvtTapi
(
aEvt : event;
aTapiDevice : handle;
aCallID : int;
...
)
: logic;
{
if (gCallID > 0 and aCallID = gCallID)
{
// Event was triggered by asynchronous TapiDial.
...
}
else
{
// Monitoring event
...
}
...
}