To make manual calls, is is needed to have campaigns configured and data for the user to select.
Campaigns with manual calls enabled
To get the list of the campaigns with manual calls enabled, execute the method GetCampaignsRelated wich on success, returns: onCampaigns, and in case of error it returns: errorOnCampaignsRelated
nuxibaIntegration.getCampaignsRelated();
Campaign list event
Returns the event onCampaigns
/**
* @description Campaigns list
* @event onCampaigns
* @param {Array} Campaigns [{id:uint, name:String }]
* @example [{id:1,name:"Campaña 1"},{id:2,name:"Cobranza"}]
*/
function onCampaigns(data) {
if (data.length === 0) {
setTimeout(() => {
nuxibaIntegration.getCampaignsRelated();
}, 250);
} else {
console.log("onCampaigns ", data);
let Campaigns = document.getElementById("Campaigns");
if (data) {
array = data;
Campaigns.innerHTML = "";
for (var property in array) {
if (array[property] !== undefined) {
let option = document.createElement("option");
option.text = array[property].name;
option.value = array[property].id;
Campaigns.add(option);
}
}
}
}
}
Manual Call
To do manual dialing, we need to know to wich campaigns with manual calls enabled the user is assigned. To dial with the method: makeManualCall the parameters clientName and calKey are optionals.
/**
* @description To do manual dialing
* @fires CORE_APIEvents#wrongNumber returns on error
* @fires CORE_APIEvents#onDialingNumber returns on sucess the call information
* @fires CORE_APIEvents#onAgentStatusChange cchange the user's state.
* @fires CORE_APIEvents#numberOnDoNotCallList Number on blacklist
* @fires CORE_APIEvents#timeZoneNumber Not valid time zone.
* @param {String} phoneNum Phone number to dial.
* @param {int} campId Campaign id
* @param {String} clientName (optional) Client's name.
* @param {String} callKey (optional) Unique identifier per call, it is provided by the client.
* @example makeManualCall('11078510',1,'Jesus','4582 3423 4865') //All the parameters
* @example makeManualCall('11078510',10) //Only required parameters
* @see getUnavailables
*/
nuxibaIntegration.makeManualCall(phoneNum, campID, clientName, callKey);
All the parameters
makeManualCall('11 07 85 10',1,'Jesus','4582 3423 4865')
With client's name
makeManualCall('11 07 85 10',1,'Jesus')
Only phone number and campaign id
makeManualCall('11078510',10)
To cancel manual call
This method allows to cancel the call before the client can answer.
nuxibaIntegration.hangUpManualDial();
To Hang up the call
This method allows to hang up the call when it is in dialog. It works for both inbound and aoutbound campaigns.
nuxibaIntegration.hangUpCall();
Hang up the call and leave a message
This method allows to hang up the call and leave a message if the campaign is previously configured to do so.
nuxibaIntegration.HangUpAndLeaveMessage();