---
schema_version: "1"
id: 3a7bcdae958af4906f45e365ece679968433a588d484048ecc8c4cad7a93ea07
title: enableClickToDial() for Salesforce Classic
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/api-cti/guides/sforce-api-cti-enableclicktodial.md
canonical_url: https://developer.salesforce.com/docs/service/api-cti/guide/sforce-api-cti-enableclicktodial.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: e8d256b8ee9c5df2d0de68fdc2645c899e5ae2b3a7216e57b31a7bee5da9f779
products:
  - Open CTI Developer Guide
  - Service Cloud Developer Content
---

# enableClickToDial() for Salesforce Classic

## Usage

Enables click-to-dial.

## Syntax

```javascript
sforce.interaction.cti.enableClickToDial( (optional) callback:function )
```

## Arguments

|Name|Type|Description|
|------|------|-------------|
|`callback`|function|JavaScript method executed when the API method call is completed.|


## Sample Code–JavaScript

<!-- javascript set_clipboard -->
```javascript
<html>
<head>
   <script type="text/javascript" src="http://domain:port/support/api/25.0/interaction.js"></script>
   <script type="text/javascript">
       var callback = function (response) {
           if (response.result) {
              alert('Click to dial was enabled.');
           } else { 
              alert('Click to dial was not enabled.');
           } 
        };
        function enableClickToDial() {
   //Invokes API method
   sforce.interaction.cti.enableClickToDial(callback);
   }
</script>
</head>
<body>
   <button onclick="enableClickToDial();">enable click to dial</button>
</body>
</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.

|Name|Type|Description|
|------|------|-------------|
|`result`|boolean|`true` if click-to-dial was enabled, `false` if click-to-dial wasn’t enabled.|
|`error`|string|If the API call was successful, this variable is undefined. If the API call failed, this variable returns an error message.|


