Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 21 Current »

Preparing and initializing of separate CLI library, parameter <pbx_name> is the name of your daktela pbx.

<script type="text/javascript">
var daktelaCli = document.createElement('script');
daktelaCli.src = 'https://<pbx_name>.daktela.com/external/web/cli.js';
daktelaCli.type = 'text/javascript'; daktelaCli.charset = 'utf-8'; daktelaCli.async = true;
daktelaCli.onload = function() {
	var cli = new daktelaCliClass();
	cli.init();
	...
};
document.getElementsByTagName('head')[0].appendChild(daktelaCli);
</script>

Most of the following functions return data using the callback return function, it has two parameters, namely "data" where newly retrieved data and "error" are the possible error state.

var callback = function(data, error) {
	...
};

Loading queue settings and status

The retrieved queue data is returned in the callback function and is temporarily stored in localStorage with which it is advisable to work with the "helpers" object of our library.

cli.getQueue(server, queue, callback); // server - absolute url of daktela pbx, queue - object of queue containing at least values "name" and "accessToken"
// for exmaple
cli.getQueue('https://<pbx_name>.daktela.com/', {name:'200',accessToken:'sa67fas84fsa6df4sa68d7'}, callback);

CTC (Click to call)

Inicializing of click to call

You should first get the queue object using cli.getQueue, when you can for example verify queue availability, or you can only fold it from two values, from queue name and accessToken.

cli.ctc.init(server, queue); // server - absolute url of daktela pbx, queue - object of CTC queue
// for example
cli.ctc.init('https://<pbx_name>.daktela.com/', {name:'200',accessToken:'sa67fas84fsa6df4sa68d7'});

Submit a request

cli.ctc.sendRequest(inputs, callback); // inputs - object containing pair values (field name = value)
// for example
cli.ctc.sendRequest({phone:'987654321',nextcall:'now',_options:{test:'test'}}, callback);

Web chat

Inicializing of webchat

You should first get the queue object using cli.getQueue (or if there is chat from the localStorage value "daktela_chat_queue") when you can for example verify queue availability, or you can fold it only from two values, from queue name and accessToken.
The chat object is empty (or if there is chat from the localStorage value "daktela_chat_chat").

cli.chat.init(server, queue, chat); // queue - object of chat queue, chat - object of an ongoing chat
// for example
cli.chat.init('https://<pbx_name>.daktela.com/', {name:'200',accessToken:'sa67fas84fsa6df4sa68d7'}, {});


DISCONTINUED .. description will be completed as soon as possible

  • No labels