disableClickToDial() for Salesforce Classic

Usage 

Disables click-to-dial.

Syntax 

1sforce.interaction.cti.disableClickToDial( (optional) callback:function )

Arguments 

NameTypeDescription
callbackfunctionJavaScript method executed when the API method call is completed.

Sample Code–JavaScript 

1<html>
2<head>
3   <script type="text/javascript" src="http://domain:port/support/api/25.0/interaction.js"></script>
4   <script type="text/javascript">
5       var callback = function (response) {
6           if (response.result) {
7              alert('Click to dial was disabled.');
8           } else { 
9              alert('Click to dial was not disabled.');
10           } 
11        };
12        function disableClickToDial() {
13   //Invokes API method
14   sforce.interaction.cti.disableClickToDial(callback);
15   }
16</script>
17</head>
18<body>
19   <button onclick="disableClickToDial();">disable click to dial</button>
20</body>
21</html>

Response 

This method is asynchronous. The response is returned in an object passed to a callback method. The response object contains the following fields.

NameTypeDescription
resultbooleantrue if click-to-dial was disabled, false if click-to-dial wasn’t disabled.
errorstringIf the API call was successful, this variable is undefined. If the API call failed, this variable returns an error message.