Click To Call

Schema

Click-to-call allows you to create URLs that can be POSTed to with a phone number or SIP URI and create a phone call from the provided contact information to a destination you have pre-determined.

KeyDescriptionTypeDefaultRequiredSupport Level
auth_requiredDetermines if this click to call requires valid auth-tokens when invokedboolean()truefalse
bypass_mediaDefault bypass media mode (The string type is deprecated, please use this as a boolean)`boolean()string(‘auto’‘false’‘true’)`
caller_id_numberExplicitly set caller id numberstring()false
custom_application_vars./[a-zA-Z0-9\-_]+/string()false
custom_application_varsKey-value pairs to set as custom_application_vars on the channelobject(){}false
custom_sip_headers.inCustom SIP Headers to be applied to calls inbound to Kazoo from the endpoint#/definitions/custom_sip_headersfalse
custom_sip_headers.outCustom SIP Headers to be applied to calls outbound from Kazoo to the endpoint#/definitions/custom_sip_headersfalse
custom_sip_headers.^[a-zA-z0-9_\-]+$The SIP header to add`string()boolean()integer()`
custom_sip_headersA property list of SIP headersobject()false
dial_firstDetermines what will be dialed first: extension or contact`string(‘extension’‘contact’)`false
extensionThe extension to connect to when the click to call is invokedstring()true
media.ignore_early_mediaThe option to determine if early media from the endpoint should always be ignoredboolean()false
mediaobject()false
music_on_hold.media_idThe ID of a media object that should be used as the music on holdstring(0..2048)false
music_on_hold.options.[]`string(‘preserve-position’‘random-start’)`false
music_on_hold.optionsOptions for playing music on hold`array(string(‘preserve-position’‘random-start’))`false
music_on_holdThe music on hold parameters used if not a property of the device ownerobject()false
nameA friendly name for the click to callstring(1..128)true
outbound_callee_id_nameCallee ID Name of the device calling out to the contact numberstring()false
outbound_callee_id_numberCallee ID Number of the device calling out to the contact numberstring()false
presence_idStatic presence ID (used instead of SIP username)string()falsesupported
ringbackRingback to usestring()false
throttleThe rate that this click to call can be invokedinteger()false
timeoutHow long, in seconds, to wait for the call to progressinteger()false
whitelist.[]string(1..)false
whitelistA list of regular expressions that the click to call can dial toarray(string(1..))false

custom_sip_headers

Custom SIP headers applied to an INVITE

KeyDescriptionTypeDefaultRequiredSupport Level
^[a-zA-z0-9_\-]+$The SIP header to add`string()boolean()integer()`

List all clicktocall endpoints

GET /v2/accounts/{ACCOUNT_ID}/clicktocall

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/clicktocall
{
    "auth_token":"{AUTH_TOKEN}",
    "data": [
        {
            "extension": "{EXTENSION}",
            "id": "{C2C_ID}",
            "name": "{NAME}"
        }
    ],
    "node": "{NODE_HASH}",
    "page_size": 1,
    "request_id": "{REQUEST_ID}",
    "revision": "{REVISION}",
    "status": "success",
    "timestamp": "{TIMESTAMP}",
    "version": "4.3.1"
}

Create a clicktocall endpoint

PUT /v2/accounts/{ACCOUNT_ID}/clicktocall

curl -v -X PUT \
    -H "Content-Type:application/json" \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    -d '{"data":{"name":"{NAME}, "auth_required":false, "extension":"{EXTENSION}"}}'
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/clicktocall
{
    "auth_token":"{AUTH_TOKEN}",
    "data": {
        "auth_required": false,
        "custom_application_vars": {},
        "extension": "{EXTENSION}",
        "id": "{C2C_ID}",
        "name": "{NAME}"
    },
    "node": "{NODE_HASH}",
    "request_id": "{REQUEST_ID}",
    "revision": "{REVISION}",
    "status": "success",
    "timestamp": "{TIMESTAMP}",
    "version": "4.3.1"
}

Fetch

GET /v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}
{
    "auth_token":"{AUTH_TOKEN}",
    "data": {
        "auth_required": false,
        "custom_application_vars": {},
        "extension": "{EXTENSION}",
        "id": "{C2C_ID}",
        "name": "{NAME}"
    },
    "node": "{NODE_HASH}",
    "request_id": "{REQUEST_ID}",
    "revision": "{REVISION}",
    "status": "success",
    "timestamp": "{TIMESTAMP}",
    "version": "4.3.1"
}

Change

POST /v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}

curl -v -X POST \
    -H "Content-Type:application/json" \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}

Patch

PATCH /v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}

curl -v -X PATCH \
    -H "Content-Type:application/json" \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}

Remove

DELETE /v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}

curl -v -X DELETE \
    -H "Content-Type:application/json" \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}

Fetch

GET /v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}/history

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}/history

Execute the clicktocall with a supplied number

GET/POST /v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}/connect

Non-blocking version

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}/connect?contact={CONTACT}

Will return immediately with a 202

    "data": {
        "application_data": {
            "route": "{CONTACT}"
        },
        "application_name": "transfer",
        "continue_on_fail": true,
        "custom_application_vars": {
            "contact": "{CONTACT}"
        },
        "custom_channel_vars": {
            "account_id": "{ACCOUNT_ID}",
            "authorizing_id": "{C2C_ID}",
            "authorizing_type": "clicktocall",
            "auto_answer_loopback": true,
            "from_uri": "{EXTENSION}@{ACCOUNT_REALM}",
            "inherit_codec": false,
            "loopback_request_uri": "{CONTACT}@{ACCOUNT_REALM}",
            "request_uri": "{CONTACT}@{ACCOUNT_REALM}",
            "retain_cid": true
        },
        "dial_endpoint_method": "single",
        "endpoints": [
            {
                "invite_format": "loopback",
                "route": "{EXTENSION}",
                "to_did": "{EXTENSION}",
                "to_realm": "{ACCOUNT_REALM}"
            }
        ],
        "export_custom_channel_vars": [
            "Account-ID",
            "Authorizing-ID",
            "Authorizing-Type",
            "Loopback-Request-URI",
            "From-URI",
            "Request-URI"
        ],
        "ignore_early_media": true,
        "loopback_bowout": "false",
        "outbound_call_id": "c2c-{C2C_ID}-{RANDOM}",
        "outbound_callee_id_name": "{EXTENSION}",
        "outbound_callee_id_number": "{EXTENSION}",
        "outbound_caller_id_name": "{C2C NAME}",
        "outbound_caller_id_number": "{CONTACT}",
        "simplify_loopback": "false",
        "start_control_process": "false",
        "timeout": 30
    },
    "node": "{NODE_HASH}",
    "request_id": "{REQUEST_ID}",
    "revision": "{REVISION}",
    "status": "success",
    "timestamp": "{TIMESTAMP}",
    "version": "4.3.1"
}

Change

POST /v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}/connect

curl -v -X POST \
    -H "Content-Type:application/json" \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}/connect

On this Page