
Configuring CallBack on your site
Any user of the auto-dialer system CRM Krusher, can for a couple of minutes set up on his website CallBack (the mechanism for ordering a call by a client who visit your site).
Description of parameters:
| # | Name * | Description |
|---|---|---|
| 1 | Phone | specifies the client number, for example: 380443643694 |
| 2 | exten | determine where to send the client if he answered, for example: 1000, where 1000 is the queue number |
| 3 | Aid | identifier – which is issued individually to each user, employee of our company |
| 4 | url | the domain on which the CRM Krusher is installed |
* – all fields are mandatory
An example of JavaScript code that must be added to the end of the HTML page where the chime mechanism should work.
<script>
function callBack() {
// init default model data.
var model = {
"phone": null,
"exten": 1000,
"Aid": 10,
};
var url = `domain.krusher.biz`;
//Set model from form
model.phone = document.getElementById('entry_phone').value;
if (!model.phone || !model.exten)
{
alert('Please Fill All Fields');
}
// AJAX code to submit form.
$.ajax({
url:`https://${url}:3002/originate`,
type:"POST",
data:JSON.stringify(model),
contentType:"application/json; charset=utf-8",
dataType:"json",
success: function(){
console.log(`Done`);
}
})
}
</script>
And for running the CallBack script in the work, it only remains to add a call to it in HTML code
<!DOCTYPE html>
<html>
<head>
<title>An example of an HTML form:</title>
</head>
<body>
<input placeholder='Your phone number' id='entry_phone'> </input><button onclick='callBack()'>Request a call</button>
<script src="http://code.jquery.com/jquery.js"></script>
</body>
</html>
You will have to save this code and refresh the page!
PS: do not forget that while in CRM Krusher everything is already set up for calls.



