Skip to main content
Version: 2026.0

cti

JDitoFunktionen für die Telefonie

Methods​

answer​

answer(pJDitoCallID): void

Answers a phone call.

Parameters​

pJDitoCallID
string | number | boolean

The ID of the phone call.

Returns​

void

Throws​

May throw an exception.


Example​

cti.answer("1");

call​

call(pPhoneAddress, pAddress?): void

Calls a certain address (i.e. phone number).

Parameters​

pPhoneAddress
string | number | boolean

The address (phone number) of the phone to be used.

pAddress?
string | number | boolean

The address (phone number) to be called.

Returns​

void

Throws​

May throw an exception.


Example​

cti.call("00874396640222", "00874396640");

formatPhoneNumber​

formatPhoneNumber(pPhoneNumber, pRawInputOnInvalid, pCountry?): string

Converts a phone number to an intarnational formatted one.

Parameters​

pPhoneNumber
string | number | boolean

The phone number to check. Has to contain the country code if pCountry is not set.

pRawInputOnInvalid
boolean

If true you get the input-string back if it is not a valid phone number. If false you get an empty string back if it is not a valid phone number.

pCountry?
string | number | boolean

The country (ISO2-code) for the phone number. Is only needed if the phone number is not provided with a country code (e.g. +49 for germany) Null is possible if you know that the phone number contains a country code. Note: if pCountry does not fit the country code of the phone number, the parameter pCountry is ignored.

Returns​

string

Formatted phone number or empty string / input string (based on pRawInputOnInvalid) if input is not a valid phone number

Throws​

May throw an exception.


getAvailableAddresses​

getAvailableAddresses(pProvider): string[]

Returns the addresses available within the telephone system (PBX system).

Parameters​

pProvider
string | number | boolean

The telephone system (PBX system) for which the phone addresses are required.

Returns​

string[]

A string array that contains all addresses found.

Throws​

May throw an exception.


Example​


// SYS_PREFERENCES (telephony_address.contentProcess)
var provider = vars.getString("$comp.telephony_provider");
if (provider == undefined || provider.length == 0)
result.object(new Array());
else
{
try
{
var addr = cti.getAvailableAddresses(provider);
var resultAddr = new Array();
for (i = 0; i < addr.length; i++)
{
resultAddr[i] = new Array(addr[i]);
}
resultAddr.sort();
result.object(resultAddr);
}
catch (ex)
{
logging.log(ex);
result.object(new Array());
}
}

getAvailablePhoneAddresses​

getAvailablePhoneAddresses(): string[]

Returns all valid phone addresses (phone numbers) that can be passed to cti.call().

Returns​

string[]

The valid phone addresses (phone numbers).

Throws​

May throw an exception.


Example​

var addresses = cti.getAvailablePhoneAddresses();

getCurrentCallCount​

getCurrentCallCount(): number

Returns the current phone call count.

Returns​

number

The number of phone calls.

Throws​

May throw an exception.


Example​

var callcount = cti.getCurrentCallCount();

getCurrentCalls​

getCurrentCalls(): Map<any, any>[]

Returns the current phone calls.

Returns​

Map<any, any>[]

The active phone calls as a map

Throws​

May throw an exception.


Example​

var calls = cti.getCurrentCalls();

hangup​

hangup(pJDitoCallID): void

Terminates a phone call.

Parameters​

pJDitoCallID
string | number | boolean

The ID of the phone call.

Returns​

void

Throws​

May throw an exception.


Example​

cti.hangup("1");

isValidPhoneNumber​

isValidPhoneNumber(pPhoneNumber, pTestForMatchingCountry?, pCountry?): boolean

Validates whether a phone number format is valid for its region. The validation only checks if the number format is valid - it does not verify if the number is actually assigned or reachable.

Example: The phone number "+49 (0) 30 1234567" is parsed into country code "49" and national significant number "301234567", which represents a valid number format.

Validation is performed using libphonenumber. Refer to the library documentation for more details.

Parameters​

pPhoneNumber
string | number | boolean

The phone number to validate. Must include country code if pCountry is not specified.

pTestForMatchingCountry?
boolean

If true, verifies that the phone number's country code matches the given country code, otherwise returns false. If false (or null), allows phone numbers with different country codes and uses pCountry only for numbers without an explicit country code.

pCountry?
string | number | boolean

The country's ISO2 code (e.g. "DE" for Germany). Only required for phone numbers without an explicit country code (e.g., leading zero instead of a +49 for Germany). Can be null if the phone number includes a country code.

Returns​

boolean

true if valid, false if invalid

Throws​

May throw an exception.


join​

join(pFirstJDitoCallID, pSecondJDitoCallID): void

Connects two phone calls to start a conference.

Parameters​

pFirstJDitoCallID
string | number | boolean

The ID of the first phone call.

pSecondJDitoCallID
string | number | boolean

The ID of the second phone call.

Returns​

void

Throws​

May throw an exception.


Example​

cti.join("1", "2");

joinFinish​

joinFinish(pFirstJDitoCallID, pSecondJDitoCallID): void

Terminates a phone conference.

Parameters​

pFirstJDitoCallID
string | number | boolean

The ID of the first phone call.

pSecondJDitoCallID
string | number | boolean

die ID des zweiten Calls

Returns​

void

Throws​

May throw an exception.


joinSetup​

joinSetup(pJDitoCallID, pAddress): void

Prepares a phone conference.

Parameters​

pJDitoCallID
string | number | boolean

The ID of the phone call.

pAddress
string | number | boolean

The phone number of the new attendee (participant).

Returns​

void

Throws​

May throw an exception.


Example​

cti.joinSetup("1", "323");

sendPrivateData​

sendPrivateData(pJDitoCallID, pData): void

Sends commands specific to the telephone system (PBX system) that are tied to a certain phone call.

Parameters​

pJDitoCallID
string | number | boolean

The ID of the phone call.

pData
number[]

The command / data.

Returns​

void

Throws​

May throw an exception.


Example​

cti.sendPrivateData("1", 1);

sendStaticPrivateData​

sendStaticPrivateData(pPhoneAddress, pData): void

Sends commands specific to the telephone system (PBX system) that are not tied to a certain phone call, but are static and will be passed to the telephone system.

Parameters​

pPhoneAddress
string | number | boolean

The address (phone number) of the phone to be used.

pData
number[]

The command / data.

Returns​

void

Throws​

May throw an exception.


Example​

cti.sendStaticPrivateData("234", 1);

setCallEndProcess​

setCallEndProcess(pName): void

Sets the process to be executed when terminating a phone call.

Parameters​

pName
string | number | boolean

The name of the process.

Returns​

void

Example​

cti.setCallEndProcess("callEndProcess");

setCallStartProcess​

setCallStartProcess(pName): void

Sets the process to be executed when initiating a phone call.

Parameters​

pName
string | number | boolean

The process to be set.

Returns​

void

Example​

cti.setCallStartProcess("callStartProcess");

setCallStateChangedProcess​

setCallStateChangedProcess(pName): void

Sets the process to be executed when changing the phone call status.

Parameters​

pName
string | number | boolean

The process to be set.

Returns​

void

Example​

cti.setCallStateChangedProcess("callStateChangedProcess");

setPrivateDataCallbackProcess​

setPrivateDataCallbackProcess(pName): void

Sets the process to be executed when performing a private data callback.

Parameters​

pName
string | number | boolean

The process to be set

Returns​

void

Example​

cti.setPrivateDataCallbackProcess("totallyWeirdProcessName");

switchHold​

switchHold(pJDitoCallID): void

Sets the status of the phone call from "Talking" to "Hold" and vice versa.

Parameters​

pJDitoCallID
string | number | boolean

The ID of the phone call.

Returns​

void

Throws​

May throw an exception.


Example​

cti.switchHold("1");

transfer​

transfer(pJDitoCallID, pNewAddress): void

Forwards a phone call.

Parameters​

pJDitoCallID
string | number | boolean

The ID of the phone call.

pNewAddress
string | number | boolean

The phone number of the new attendee (participant).

Returns​

void

Throws​

May throw an exception.


Example​

cti.transfer("1", "253");

transferFinish​

transferFinish(pFirstJDitoCallID, pSecondJDitoCallID): void

Terminates a forwarded call.

Parameters​

pFirstJDitoCallID
string | number | boolean

The ID of the first phone call.

pSecondJDitoCallID
string | number | boolean

The ID of the second phone call.

Returns​

void

Throws​

May throw an exception.


Example​

cti.transferFinish("1", "2");

transferSetup​

transferSetup(pJDitoCallID, pNewAddress): void

Prepares a phone call forwarding action.

Parameters​

pJDitoCallID
string | number | boolean

The ID of the phone call.

pNewAddress
string | number | boolean

The phone number of the new attendee (participant).

Returns​

void

Throws​

May throw an exception.

Properties​

Example​

cti.transferSetup("1", "2");

ADDRESS​

string

Phone number of the counterpart (empty string if the phone number was suppressed)


CALLID​

string

ID of the phone call


CALLSTATE_BUSY​

number

Constant for telephony, here busy.


CALLSTATE_CONNECTING​

number

Constant for telephony, here connecting.


CALLSTATE_CONNECTION_RINGING​

number

Constant for telephony, here connection ringing.


CALLSTATE_CREATED​

number

Constant for telephony, here created.


CALLSTATE_DISCONNECTED​

number

Constant for telephony, here disconnected.


CALLSTATE_ON_HOLD​

number

Constant for telephony, here on hold.


CALLSTATE_RINGING​

number

Constant for telephony, here ringing.


CALLSTATE_TALKING​

number

Constant for telephony, here talking.


CALLSTATE_UNKNOWN​

number

Constant for telephony, here unknown.


ISINCOMING​

string

TRUE for incoming phone calls


LOCALADDRESS​

string

Constant for retrieving the data from the telephony map, here the address of the telephony device.


LOCALID​

string

Constant for retrieving the data from the telephony map, here the ID of the telephony device.


STATE​

string

Status of the phone call.