CTI Client SQL functions (C++ CTI API)

SQL

Contents  Back  Next

Use of SQL functions

In telephony applications it is often necessary to access a database, in order, for example, to display further information beyond a telephone number: address, notes, etc. The CTI-server already uses database connections in order to identify caller numbers and save call data records. You may use a third database connection to perform your own queries. First configure the data source on the CTI-Server. This can be set on the "Database interface" page of the server control panel.

 

clip0065

It is then recommended to test the commands CTI_SQLLogin, CTI_SQLBegin, CTI_SQLNext and CTI_SQLEnd using the CTI-Browser.

 

Prefix

The SQL functions start with the prefix "SQL_".

 

Retrieve addresses from the master database

The database for caller number identification can also be used in reverse to get a number from a name.

 

CTI_SQLGetDbBook

Retrieves particular records or a complete address list from the master database.

 

Queries with additional database connections

Use the following commands for your own database queries.

 

CTI_SQLLogin

Log client on to database.

CTI_SQLBegin

Start a database query

CTI_SQLNext

Continue a query

CTI_SQLEnd

End a query

 

Steps in an example session

1.Log on to database with CTI_SQLLogin("Password");
2.SQL_LOGIN returns TRUE in wParam: logon succeeded
3.Request 50 records using CTI_SQLBegin("SELECT * FROM Members",50); Function returns Query ID of 1.
4.Data records arrive in event SQL_DATA
5.A further 30 records are requested for query number 1: CTI_SQLNext(1,30);
6.Data records arrive in event SQL_DATA
7.End query number 1 using CTI_SQLEnd(1);
8.Event SQL_END confirms the end of the query.

 

See also

C++ CTI API overview

 


Send feedback to TAPIMaster®

© 2020 Tino Kasubke. All rights reserved.