Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can test API methods on the interactive API browser page and without writing code
Some of the resources described on the page may not be available by default due to the type of application (see Creating and authorizing applications).

This resource is intended to differentiate the possibilities to manage current calls from a telephone terminal: pickup, whisper, eavesdrop. Absence of rules implies the ability to pick up a call within the entire PBX and to prohibit any other actions.  

Table of Contents

Description of Data Structures 

Expand
titleCallControlPermissions

Name 

Type 

Description 

allow_all 

boolean 

Allows globally any actions if true (everyone can intercept and listen to everyone) 

pickup_all 

boolean 

Ability to pick up calls within the entire PBX (if the value is false, pickup is possible only within pickup_share_groups). The default value is true

groups 

Object 

Contains a simple listing of groups with the names of extensions numbers that may be in different groups. There can be no more than 100 groups, each of which contains no more than 200 extension numbers (their existence is not checked) 

pickup_share_groups 

array 

Groups, which interception is possible within without specifying an extension number. When "pickup_all": false, the pickup is possible only within groups. If an extension number is included to several pickup groups and the pickup takes place on its behalf, the groups are combined into one group 

eavesdrop_{ext} 

array 

Where the suffix "ext" is the extension number name: the groups that the ext extension number can listen to. If no such group is found, then the action is prohibited. 

whisper_{ext} 

array 

Where the suffix "ext" is the extension number name: the groups that the ext"extension number can whisper to. If no such group is found, then the action is prohibited. 

Example 

Create pickups: 

  • “100": the pickup is possible without specifying the extension numbers "102", "101" and with specifying all the other numbers ("pickup_all": true);

  • “101": the pickup is possible without specifying the extension numbers "102", "100" and with specifying all the other numbers ("pickup_all": true);

  • "102": the pickup is possible without specifying the extension numbers "101", "100" and with specifying all the other numbers ("pickup_all": true);

Listening: "101" may listen to the groups "sales", "hr" (the extension numbers "102", "100"). No other PBX extension numbers has the permission to listen to the calls. 

Hint: "100" can connect to the dialogue in the hint mode to the extension numbers of the "support" group ("101"). 

Tabs
[{"content":{"version":1,"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"In the "},{"type":"text","text":"authentication ","marks":[{"type":"strong"}]},{"type":"text","text":"section enter the "},{"type":"text","text":"Application_ID","marks":[{"type":"strong"}]},{"type":"text","text":" and "},{"type":"text","text":"Application_Secret","marks":[{"type":"strong"}]},{"type":"text","text":" values obtained during the application registration in the "},{"type":"text","text":"client_id ","marks":[{"type":"strong"}]},{"type":"text","text":"and "},{"type":"text","text":"client_secret","marks":[{"type":"strong"}]},{"type":"text","text":" fields, then click on the \""},{"type":"text","text":"Try it out!","marks":[{"type":"strong"}]},{"type":"text","text":"\" button. If the application data is correct, an access token ("},{"type":"text","text":"access_token","marks":[{"type":"strong"}]},{"type":"text","text":") will be returned in response. The received access token should be entered into the \""},{"type":"text","text":"Access Token Field","marks":[{"type":"strong"}]},{"type":"text","text":"\" at the top of the page and saved by clicking the \""},{"type":"text","text":"Set Token","marks":[{"type":"strong"}]},{"type":"text","text":"\" button."}]},{"type":"table","attrs":{"isNumberColumnEnabled":false,"layout":"default"},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Method","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"ResourseResource","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Data","marks":[{"type":"strong"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"PUT"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"/client/@me/call_control_group/"}]},{"type":"paragraph","content":[{"type":"text","text":" "}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"{"},{"type":"hardBreak"},{"type":"text","text":"\"allow_all\": false,"},{"type":"hardBreak"},{"type":"text","text":"\"pickup_all\": true,"},{"type":"hardBreak"},{"type":"text","text":"\"groups\":"},{"type":"hardBreak"},{"type":"text","text":"{"},{"type":"hardBreak"},{"type":"text","text":"    \"support\": [\"100\", \"101\"],"},{"type":"hardBreak"},{"type":"text","text":"    \"sales\": [\"102\", \"101\"],"},{"type":"hardBreak"},{"type":"text","text":"    \"hr\": [\"100\", \"101\", \"103\"]"},{"type":"hardBreak"},{"type":"text","text":"},"},{"type":"hardBreak"},{"type":"text","text":"\"pickup_share_groups\": [\"support\", \"sales\"],"},{"type":"hardBreak"},{"type":"text","text":"\"eavesdrop_100\": [\"support\"],"},{"type":"hardBreak"},{"type":"text","text":"\"whisper_101\": [\"sales\", \"hr\"]"},{"type":"hardBreak"},{"type":"text","text":"}"}]}]}]}]},{"type":"paragraph","content":[]}]},"id":"528992ae-ea09-4146-8b5c-fc7a09007b35","label":"Interactive API Browser","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"To send requests using the cURL program, set the values of the "},{"type":"text","text":"url ","marks":[{"type":"strong"}]},{"type":"text","text":"and "},{"type":"text","text":"access_token","marks":[{"type":"strong"}]},{"type":"text","text":" variables:"}]},{"type":"paragraph","content":[{"type":"text","text":"export url=\"https://<hostname>/api/ver1.0\"","marks":[{"type":"code"}]},{"type":"text","text":" "},{"type":"hardBreak"},{"type":"text","text":"(where the hostname — is the hostname of the API-server provider of IP-telephony),"}]},{"type":"paragraph","content":[{"type":"text","text":"export access_token=\"8SNsrS0jV35vfmKqKeKtRrHfpbg4UX\"","marks":[{"type":"code"}]},{"type":"text","text":" "},{"type":"hardBreak"},{"type":"text","text":"(the received access token)."}]},{"type":"paragraph","content":[{"type":"text","text":"Send a request:"}]},{"type":"codeBlock","attrs":{"language":"shell"},"content":[{"type":"text","text":"curl \\\n-H \"Authorization: Bearer ${access_token}\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n  \"allow_all\": false,\n  \"pickup_all\": true,\n  \"groups\": {\n    \"support\": [\"100\", \"101\"],\n    \"sales\": [\"102\", \"101\"],\n    \"hr\": [\"100\", \"101\", \"103\"]\n  },\n  \"pickup_share_groups\": [\n    \"support\",\n    \"sales\"\n  ],\n  \"eavesdrop_100\": [\n    \"support\"\n  ],\n  \"whisper_101\": [\n    \"sales\",\n    \"hr\"\n  ]\n}' \\\n-X PUT ${url}/client/@me/call_control_group/"}]}]},"id":"ec777324-957c-48ed-bfc6-a7a3c073a055","label":"cURL Program","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"To send requests in Python, set the values of the variables URL and ACCESS_TOKEN:"}]},{"type":"paragraph","content":[{"type":"text","text":"URL = \"https://<hostname>/api/ver1.0\"","marks":[{"type":"code"}]},{"type":"hardBreak"},{"type":"text","text":"(where the hostname — is the hostname of the API-server provider of IP-telephony),"}]},{"type":"paragraph","content":[{"type":"text","text":"ACCESS_TOKEN = \"8SNsrS0jV35vfmKqKeKtRrHfpbg4UX\"","marks":[{"type":"code"}]},{"type":"hardBreak"},{"type":"text","text":"(the received access token)."}]},{"type":"codeBlock","attrs":{"language":"python"},"content":[{"type":"text","text":"#!/usr/bin/python\n\nimport requests\n\nurl = f'{URL}/client/@me/call_control_group/'\nheaders = {\n    'Authorization': f'Bearer {ACCESS_TOKEN}',\n    'Content-Type': 'application/json'\n}\ndata = '''{\n    \"allow_all\": false,\n    \"pickup_all\": true,\n    \"groups\": {\n        \"support\": [\"100\", \"101\"],\n        \"sales\": [\"102\", \"101\"],\n        \"hr\": [\"100\", \"101\", \"103\"]\n    },\n    \"pickup_share_groups\": [\n        \"support\",\n        \"sales\"\n    ],\n    \"eavesdrop_100\": [\n        \"support\"\n    ],\n    \"whisper_101\": [\n        \"sales\",\n        \"hr\"\n    ]\n}'''\nresponse = requests.put(url, headers=headers, data=data)\nprint(response.text)"}]}]},"id":"118efa44-705e-44ae-a26b-c08f998e976f","label":"In Python3","type":"tab"}]

System response: 

Expand
titleExpand
Code Block
languagejson
{
  "allow_all": false,
  "pickup_all": true,
  "groups": {
    "support": [
      "100",
      "101"
    ],
    "sales": [
      "102",
      "101"
    ],
    "hr": [
      "100",
      "101",
      "103"
    ]
  },
  "pickup_share_groups": [
    "support",
    "sales"
  ],
  "eavesdrop_100": [
    "support"
  ],
  "whisper_101": [
    "sales",
    "hr"
  ]
}

"Client" Section Resources 

Expand
titlePUT /client/{client_id}/call_control_group/

PUT /client/{client_id}/call_control_group/ 

URL Options 

Name 

Type 

client_id 

string 

JSON Options 

Name 

Type 

call_control_groups  

string 

Expand
titleGET /client/{client_id}/call_control_group/

GET /client/{client_id}/call_control_group/ 

URL Options 

Name 

Type 

client_id 

string