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).

Table of Contents

Description of data structures

Expand
titlePhone Terminal Properties (PhoneProperties)

Phone Terminal Properties (PhoneProperties)

Tabs
[{"content":{"version":1,"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"In the "},{"type":"text","text":"authentication ","marks":[{"type":"strong"}]},

Name

Type

Mandatory

Default value

Description

label

string

none

Displays the name of the internal number. Displayed on the called terminal for outgoing calls (if supported)

announce_sound_upon_outgoing_call

long

none

ID of the sound file that will be played on an outgoing call as an information declaration

announce_sound_upon_incoming_call

long

none

ID of the sound file that will be played when answering an incoming call as an information announcement. The file will be played, including when replying through the queue

append_to_cid_name_on_transfer

string

none

Adding a translation attribute to the name of the conference participant that is requested and transmitted when joining the conference. It can be useful for "blind translation" to understand where the call was translated from

auth_type

string

none

"digest"

The type of authentication of internal number requests on the SIP server. Accepts one of the values:

  • digest - using password

  • network - only from the predefined networks

  • both- using password from the predefined networks

call_screening_enabled

boolean

none

false

Managing the incoming call confirmation mechanism. If the parameter is set to true, then during a call to an internal number, when you pick up the handset, the subscriber will hear information about the caller's number and the external number to which the call was made. To answer the call in this case, press the number 1, to cancel the call, hang up the phone

conference_announce_caller_name

boolean

none

true

Local conference of the internal number *8<internal_number>. This parameter specifies whether to send the user name of the internal number that joins the local conference. The announcement does not work for invitees

conference_end_on_exit

boolean

none

true

Local conference of the internal number *8<internal_number>. This parameter specifies whether the conference ends when the internal number that created the conference exits it.

conference_pin

string

none

Local conference of the internal number *8<internal_number>. PIN code for entering the conference of other internal numbers

external_number

string

none

If this parameter is defined, the SIP server sends a call there. This number can be, for example, a mobile number. The call is processed in the same way as if it came directly to the terminal (all the rules for call forwarding, conversation recordings, translation resolution, etc. work).

geo_list

string

none

Sets the list of countries from which IP addresses the use of the SIP account is allowed. Countries are listed in the ISO 3166 Codes A2 format, for example "RU US BY". If the list is not specified, the resource parameter of the same name is used “Client (/client/)”. If the list is set to "*", then all countries are allowed and the client parameter is ignored

hangup_timeout

long

none

60

The maximum time to wait for an internal number to respond to an incoming call, in seconds. After this time, the call is considered unanswered and the incoming call rules may be activated (if any) or a hang-up may occur

hold_music

long

none

0

ID of the sound file that sounds on the other side of the dialog when the terminal puts the call on hold. If not specified, the preset system file will sound

ignore_early_media

boolean

none

true

If this parameter is set to true, early media, such as autoresponders, will be ignored when calling the internal number. May be useful in case of external number registration or FMC application

incoming_limit

long

none

0

Sets how many calls the internal number can receive at the same time: "0" - without restrictions, "1" - no more than one (analogous to turning off "call waiting"), "2" - no more than two, etc.

network_permission_group_id

long

none

0

Sets the ID of the client's trusted networks for authorization on the sip server with 'auth_type':'network' or 'auth_type':'both'

preserve_caller_id_number_att_tr

boolean

none

true

A parameter that specifies whether to pass the caller's number to the call recipient when translating a call with the *2 command (translation with accompaniment). By default, when transferring a call *2, the caller's number is placed in the caller's name, and the caller's number reflects the internal number from which the call is transferred

record_enabled

boolean

none

true

A parameter that specifies whether to include call recording in the file. Saved files are available through the "Conversation Records" resource, disk quota-through the client properties, occupied disk space-through the "Disk Space" resource.

record_format

string

none

None

Format of the conversation recording files. Possible options: 'mp3’ ‘' wav’, None. If the record format is not specified, the setting specified in the client configuration (resource “Client (/client/)”). The size of the recording files depends on the recording format. The full specification is given at the end of this page

record_stereo

boolean

none

None

A parameter that specifies whether to record a conversation in stereo or mono format. Possible options: 'yes', 'no', None. If this parameter is not specified, the configuration specified in the client configuration (resource “Client (/client/)”). The size of the recording files depends on the recording format. The full specification is given at the end of this page

record_transfer

boolean

none

true

A parameter that specifies whether to record the conversation when transferring a call (if after the transfer the call gets to another internal number with a record, the recording on the translating internal number stops). Works only when the record_enabled function is active

record_on_transfer

boolean

none

false

By default, the internal number conversation is recorded. If the record_on_transfer function is activated, the opposite side of the conversation from the internal number is recorded.
With the record_on_transfer function inactive, recording will stop when the internal number hangs up, and with the record_on_transfer function active, it will stop only when the opposite side of the conversation hangs up

ringback_sound

long

none

0

The melody played instead of beeps (183 progress, by default - 180 Ringing (beeps))

static_reg_address

string

none

If the terminal cannot register on the server for any reason, the registration can be specified explicitly, and all calls will be directed to this address. At the same time, the terminal can continue to register on the server, but calls will still go away according to static_reg_address. Specified as address:port (for example: 8.8.8.8:5068)

transfer_caller_id_number

string

none

Fixed number of the caller, which is always displayed when the call is forwarded inside the PBX (can be changed by the telephony provider when the call is forwarded further)

vm_attach_file

boolean

none

true

This parameter specifies whether to attach a file with a voice message when sending a receipt notification. Relevant for vm_enabled

vm_enabled

boolean

none

true

This option activates voice mail

vm_greeting

long

none

0

ID of the audio file that sounds like a voicemail greeting. Relevant for vm_enabled

vm_mailto

string

none

E-mail address for receiving notifications about a new voice message (multiple addresses separated by commas are possible). Relevant for vm_enabled

intercom

long

none

None

Autoreply, when 0 is set to auto-answer immediately, 1 or more is an answer after a specified time in seconds.

To disable it, set to None

Example

For the internal number with the ID 54, we will set the binding of the external mobile number +79876543210: 

bundle

Object

none

{
"bundle_list": null, "bundle_id": null
}

bundle structure.
Contains:
1. bundle_list
bundle_list is an Object datatype where additional extensions from the bundle are written. Example: { "124": { "active": false}, "29196": { "active": true}}

"124" - id of additional extension

”active” - data type bool, indicates whether the additional extension is active in the bundle or not

2.bundle_id

id of main extension in bundle (int)

Example

For the internal number with the ID 54, we will set the binding of the external mobile number +79876543210: 

{   "auth_type": "digest",   "hold_music": null,   "preserve_caller_id_number_att_tr": false,   "conference_pin
334dac8ea1bf","label":"In Python3","type":"tab"}]
Tabs
[{"content":{"version":1,"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"sectionIn enter the "},{"type":"text","text":"Application_IDauthentication ","marks":[{"type":"strong"}]},{"type":"text","text":"section enter andthe "},{"type":"text","text":"Application_SecretID","marks":[{"type":"strong"}]},{"type":"text","text":" values obtained during the application registration in the and "},{"type":"text","text":"clientApplication_id Secret","marks":[{"type":"strong"}]},{"type":"text","text":"and "},{" values obtained during the application registration in the "},{"type":"text","text":"client_secretid ","marks":[{"type":"strong"}]},{"type":"text","text":" fields, then click on the \"and "},{"type":"text","text":"Try it out!client_secret","marks":[{"type":"strong"}]},{"type":"text","text":"\" button.fields, Ifthen theclick applicationon data is correct, an access token (the \""},{"type":"text","text":"access_tokenTry it out!","marks":[{"type":"strong"}]},{"type":"text","text":"\") button. willIf bethe returnedapplication indata response.is Thecorrect, receivedan access token should be entered into the \"("},{"type":"text","text":"Access Token Fieldaccess_token","marks":[{"type":"strong"}]},{"type":"text","text":"\") atwill thebe topreturned ofin theresponse. pageThe and saved by clickingreceived access token should be entered into the \""},{"type":"text","text":"SetAccess Token Field","marks":[{"type":"strong"}]},{"type":"text","text":"\" button."}] at the top of the page and saved by clicking the \""},{"type":"tabletext","attrstext":{"isNumberColumnEnabledSet Token":false,"layoutmarks":"default"},"content":[{"type":"tableRowstrong"}]},{"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":"Resourse","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":"/extension/54/phone/"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"{"},{"type":"hardBreak"},{"type":"text","text":"\"external_number\": \"+79876543210\""},{"type":"hardBreak"},{"type":"text","text":"}"}]}]}]}]}]},"id":"2b8b1b4c-8a0b-4659-8082-6a2a94082fdf","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 '{\"external_number\": \"+79876543210\"} \\\n-X PUT ${url}/extension/54/phone/"}]}]},"id":"158c382f-6746-4b1e-a278-0b4b8513a8d2","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\nimport json\n\nurl = f'{URL}/extension/54/phone/'\nheaders = {\n    'Authorization': f'Bearer {ACCESS_TOKEN}',\n    'content-type': 'application/json'\n}\ndata = {\"external_number\": \"+79876543210\"}\nresponse = requests.put(url, headers=headers, data=json.dumps(data))\nprint(response.text)"}]}]},"id":"d9f15ec1-0458-48b7-9618-334dac8ea1bf","label":"In Python3","type":"tab"}]
Expand
titleSystem response:
Code Block
languagejson
Expand
titleSystem response:
Code Block
languagejson
{
  "auth_type": "digest",
  "hold_music": null,
  "preserve_caller_id_number_att_tr": false,
  "conference_pin": null,
  "conference_end_on_exit": true,
  "network_permission_group_id": 1,
  "append_to_cid_name_on_transfer": null,
  "record_stereo": false,
  "incoming_limit": 1,
  "vm_mailto": null,
  "vm_enabled": false,
  "hangup_timeout": 5,
  "record_enabled": true,
  "vm_attach_file": true,
  "conference_announce_caller_name": true,
  "announce_sound_upon_outgoing_call": null,
  "conference_end_on_exitvm_greeting": truenull,
  "networkignore_permissionearly_group_idmedia": 1false,
  "appendstatic_to_cid_name_on_transferreg_address": null,
  "recordgeo_stereolist": false"RU",
  "incomingcall_screening_limitenabled": 1true,
  "vmringback_mailtosound": null,
  "vmrecord_enabledformat": false"mp3",
  "hangup_timeouttransfer_caller_id_number": 5null,
  "record_enabledtransfer": true,
  "vmexternal_attach_filenumber": true"+79876543210",
   "conference_announce_caller_namebundle": true,
  "announce_sound_upon_outgoing_call": null,
  "vm_greeting": null,
  "ignore_early_media": false,
  "static_reg_address": null,
  "geo_list": "RU",
  "call_screening_enabled": true,
  "ringback_sound": null,
  "record_format": "mp3",
  "transfer_caller_id_number": null,
  "record_transfer": true,
  "external_number": "+79876543210"{
    "bundle_list": {
      "124": {
        "active": false
      },
      "29196": {
        "active": true
      }
    },
    "bundle_id": 3
  }
}

Conversation recording specification

mp3_mono
Bit rate : 16.0 kb/s
Channel(s) : 1 channel
Sampling rate : 8 000 Hz

mp3_stereo
Bit rate : 32.0 kb/s
Channel(s) : 2 channels
Sampling rate : 8 000 Hz

wav_mono
Bit rate : 128 kb/s
Channel(s) : 1 channel
Sampling rate : 8 000 Hz

wav_stereo
Bit rate : 256 kb/s
Channel(s) : 2 channels
Sampling rate : 8 000 Hz

Resources of the "Internal number" section

Expand
titleGET /extension/{extension_id}/phone/

GET /extension/{extension_id}/phone/

Get phone terminal properties

URL Parameters

Name

Type

Description

extension_id

integer

unique identifier of the internal number, can take the value @me in the case of a user of the "internal number" type

Expand
titlePUT /extension/{extension_id}/phone/

PUT /extension/{extension_id}/phone/

Change phone terminal properties

URL Parameters

Name

Type

Description

extension_id

integer

unique identifier of the internal number, can take the value @me in the case of a user of the "internal number" type

JSON parameters

See Phone Terminal Properties (PhoneProperties)