Skip to main content

Zoho CRM C2C

Add a call button to your Zoho CRM contacts. When an agent clicks it, didlogic rings the agent's phone first and then connects the call to the contact.

How it works​

  1. Custom button. You add a button to the Contacts module in Zoho CRM.
  2. Deluge function. The button runs a function that sends a request to the didlogic Click2Call API.
  3. Agent's phone rings. didlogic calls the agent's SIP account first.
  4. Contact is connected. Once the agent answers, didlogic dials the contact and bridges the call.

Before you begin​

You need:

  • A didlogic API token. Create one on the API & Webhooks page with + Create Token. The token is shown only once, so copy it and store it securely right away.
  • The agent's SIP account. Find the five-digit SIP account number on the SIP Accounts page. The agent's phone, softphone or webphone must be registered with this account to ring.
  • A caller ID. One of your didlogic numbers, in E.164 format, to show on the call.
  • Zoho CRM administrator access, to create custom buttons and functions.

Create the button​

  1. In Zoho CRM, click Setup (the gear icon) in the top right corner.

  2. Under Customization, click Modules and Fields, then open the Contacts module.

  3. Open the Buttons tab and click + Create Custom Button.

  4. Configure the button:

    • Button Name: a descriptive name, for example Call via didlogic
    • Define Action: Function
    • Select Page: In List
    • Select Position: Each Record

    Custom button settings in Zoho CRM

  5. Under Configured Function, click Write your own.

  6. Enter a display name and a function name, for example didlogic_click2call, select Deluge as the language and click Create.

    New Deluge function in Zoho CRM

  7. Replace the default code in the Deluge editor with the script below, then replace YOUR_SIP_ACCOUNT, YOUR_CALLER_ID and YOUR_DIDLOGIC_API_TOKEN with your values:

    string button.didlogic_click2call(String contactId)
    {
    contactDetails = zoho.crm.getRecordById("Contacts", contactId.toLong());
    rawPhone = contactDetails.get("Phone");
    if(rawPhone == null || rawPhone == "")
    {
    return "This contact has no phone number";
    }
    cleanDigits = rawPhone.replaceAll("[^0-9]", "");
    payload = Map();
    payload.put("a_type", "sip_account");
    payload.put("a_endpoint", "YOUR_SIP_ACCOUNT");
    payload.put("b_number", cleanDigits);
    payload.put("a_cli", "YOUR_CALLER_ID");
    headers = Map();
    headers.put("Authorization", "Bearer YOUR_DIDLOGIC_API_TOKEN");
    response = invokeurl
    [
    url: "https://app.didlogic.com/api/v1/click2call"
    type: POST
    parameters: payload.toString()
    headers: headers
    content-type: "application/json"
    ];
    info response;
    return "Calling: your phone will ring first";
    }

    Note: The contact's phone number must include the country code, for example +44 20 1234 5678. The script strips everything except digits, so a number saved without a country code can't be dialed.

  8. Click Save, then click Associate. In the Value field on the right, type #, select Contacts and choose Contact Id.

    Associating the Contact Id argument

  9. Select the user profiles that should see the button, for example Administrator or Standard.

  10. Click Save on the button configuration page.

Warning: The API token in the script gives full access to your didlogic account. Anyone who can view or edit functions in Zoho CRM can see it, so limit who has that access.

Make a call​

  1. Make sure the agent's SIP account is registered, for example by opening the webphone.

  2. Open the Contacts list in Zoho CRM.

  3. Click the button next to a contact. The agent's phone rings first; once the agent answers, didlogic calls the contact.

Request parameters​

ParameterTypeRequiredDescription
a_typestringYesMust be sip_account
a_endpointstringYesThe agent's five-digit SIP account number
b_numberstringYesThe contact's number in E.164 format
a_clistringNoCaller ID in E.164 format, shown on the agent's phone while it rings

See the Click2Call API reference for all request parameters and responses.

Troubleshooting​

If nothing happens when you click the button, open the function in Zoho CRM and check its execution logs: the info response line shows didlogic's reply, including any error message.

See WebSocket Calls for message formats, signaling payloads and event types.