Phone Types Management

Listing available phone types

GET /api/v1/configs_mngt/phone_types/

Return the list of all the phone types supported.

Example request:

GET /api/v1/configs_mngt/phone_types/ HTTP/1.1
Host: example.com
Content-Type: "application/json"

{
   "addCapabilities": true,
   "forMainDevice": true
}
Request JSON Object:
  • addCapabilities (boolean) – if set it will return also the capabilities (see Phone Type Capabilities) for each phone type.

  • _include_hidden (boolean) – if set it will return also the phone types that are supposed to not be exposed. It is an “_” attribute to indicate that this attribute should not be used in nomral circumstancies but only there for exceptional or APIO internal usage.

  • forMainDevice (boolean) – if set it will filter the response with devices that can be used as main devices. Mutual exclusive with forExtraDevice. Only value true has a meaning.

  • forExtraDevice (boolean) – if set it will filter the response with devices that can be used as extra devices. Mutual exclusive with forMainDevice. Only value true has a meaning.

Example response:

HTTP/1.1 200 OK
Content-Type: "application/json"
      {
          "phoneTypes": [
              {
                  "technicalName": "Yealink-T0G",
                  "displayName": "Yealink-T0G",
                  "vendor": {
                      "phoneVendor": None,
                      "phonVendorModel": "",
                      "targetUrl": "",
                      "useRedirect": false,
                  },
                  "capabilities": {
                      "phoneDefinition": {
                          "needMac": 2,
                          "needLogin": 0,
                          "needHost": 0,
                          "needPort": 0,
                          "needSerialNumber": 1,
                          "isDECT": false,
                      },
                      "phoneProperties": {
                          "brandName": None,
                          "imageUrl": None,
                          "mainDevice": True,
                          "extraDevice": True,
                      },
                  },
                  "addData": {},
                  "phoneButtons": {
                      "MANAGED_KEYS": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
                      "ACTIONS": [
                          "DIRECT_CALL",
                          "BLF",
                          "BLF_CP",
                          "BLF_CALL",
                          "BLF_CP_CALL",
                          "DND_TOGGLE",
                          "LINE",
                          "CF_ACTIVATION_WITH_NUMBER",
                          "CF_DEACTIVATION",
                          "CALL_PICKUP"
                      ],
                      "TAGS": {
                          "ACTION": "%FLEX_KEY_ACT_{}%",
                          "PARAM": "%FLEX_KEY_ARG_{}%",
                          "PARAM_2":  "%FLEX_KEY_ARG2_{}%",
                          "LABEL": "%FLEX_KEY_LABEL_{}%",
                          "COMBINED": "%LINE_FUNCTION-{}%",
                          "CALCULATED_1": "%PLK-{}%"
                      },
                      "CONSTRAINTS": {
                          "MAX_LABEL": 99,
                          "MAX_ARG": 99,
                          "MAX_PHONE_NUMB": 99,
                          "ALLOWED_LINE_ID": [1, 2, 3, 4, 5, 6]
                      },
                      "PHONE_NUMBER_REQUIRED": [
                          "DIRECT_CALL",
                          "BLF",
                          "BLF_CP",
                          "BLF_CALL",
                          "BLF_CP_CALL"
                      ],
                      "LINE_ID_REQUIRED": ["LINE"],
                      "LABEL_REQUIRED": ["DIRECT_CALL"],
                      "PARAMETER_2_DEFAULT": {
                          "DIRECT_CALL": "1"
                      },
                      "CALCULATED_1_MODE": "CISCO",
                      "ACTIONS_NOT_FOR_FREE_KEYS": ["LINE"],
                      "DIRECT_CALL_ACTION": "DIRECT_CALL",
                      "APIO_ACTIONS_VALUES": {
                          "CF_ACTIVATION_WITH_NUMBER": {"shortCode": "*72{}", "needNumber": True},
                          "CF_DEACTIVATION": {"shortCode": "*73", "needNumber": False},
                          "CALL_PICKUP": {"shortCode": "*98", "needNumber": False}
                      },
                      "BLF": {
                          "MANAGE": True,
                          "BUILD": False
                      },
                      "BLF_ACTIONS": [
                          "BLF",
                          "BLF_CP",
                          "BLF_CALL",
                          "BLF_CP_CALL"
                      ],
                      "LINE_ACTIONS": ["LINE"],
                      "FORCED_KEYS": {"1": ["LINE", "1", ""]},
                      "VENDOR_ACTIONS": {
                          "DIRECT_CALL": "sd",
                          "BLF": "blf",
                          "BLF_CP": "blf+cp",
                          "BLF_CALL": "blf+spd",
                          "BLF_CP_CALL": "blf+cp+spd",
                          "DND_TOGGLE":"dnd"
                      },
                      "COMBINED_RULES": {
                          "DIRECT_CALL": "fnc=%FLEX_KEY_ACT_{}%;ext=%FLEX_KEY_ARG_{}%@$PROXY;nme=%FLEX_KEY_LABEL_{}%",
                          "BLF": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
                          "BLF_CP": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
                          "BLF_CALL": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
                          "BLF_CP_CALL": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
                          "DND_TOGGLE": ["fnc=%FLEX_KEY_ACT_{}%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%"]
                      }
                  }
              }
          ]
      }
Response JSON Object:
Status Codes:

Display phone type instance

GET /api/v1/configs_mngt/phone_types/(string: instance_name)/

Retrieve information about the specified phone type instance.

Example request:

GET /api/v1/configs_mngt/phone_types/Yealink-T40G/ HTTP/1.1
Host: example.com

Example response:

HTTP/1.1 200 OK
Content-Type: "application/json"

{
   "technicalName": "Yealink-T40G",
   "displayName": "Yealink-T40G",
   "vendor": {
      "phoneVendor" : "Yealink",
      "phoneVendorModel": "edge 40",
      "targetUrl" : "http://myhome.it",
      "useRedirect" : false,
   },
   "capabilities": {
      "phoneDefinition": {
         "needMac": 2,
         "needLogin": 0,
         "needHost": 0,
         "needPort": 0,
         "needSerialNumber": 1,
         "isDECT": false
      },
      "phoneProperties": {
         "brandName": "Yealink",
         "imageUrl": "http://www.foourl.be/img.jpg",
         "mainDevice": true,
         "extraDevice": true,
     }
   }
}
Response JSON Object:
Status Codes:

Create a new phone type

POST /api/v1/configs_mngt/phone_types/

Creates a new phone type.

Authorization Right: System Admin.

Example request:

HTTP/1.1 200 OK
Content-Type: "application/json"

{
   "technicalName": "Yealink-T40G",
   "displayName": "Yealink-T40G",
   "vendor": {
      "phoneVendor" : "Yealink",
      "phoneVendorModel": "edge 40",
      "targetUrl" : "http://myhome.it",
      "useRedirect" : false,
   },
   "capabilities": {
      "phoneDefinition": {
         "needMac": 2,
         "needLogin": 0,
         "needHost": 0,
         "needPort": 0,
         "needSerialNumber": 1,
         "isDECT": false
      },
      "phoneProperties": {
         "brandName": "Yealink",
         "imageUrl": "http://www.foourl.be/img.jpg",
         "mainDevice": true,
         "extraDevice": true,
      },
   },
   "addData": {
      "hiddenParam": {
          "enabled": true,
          "type": "String",
          "hidden": true
      },
      "TAGS": {
          "hiddenParam": "%HIDDEN_PARAM%"
      }
   },
  "phoneButtons": {
      "MANAGED_KEYS": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
      "ACTIONS": [
          "DIRECT_CALL",
          "BLF",
          "BLF_CP",
          "BLF_CALL",
          "BLF_CP_CALL",
          "DND_TOGGLE",
          "LINE",
          "CF_ACTIVATION_WITH_NUMBER",
          "CF_DEACTIVATION",
          "CALL_PICKUP"
      ],
      "TAGS": {
          "ACTION": "%FLEX_KEY_ACT_{}%",
          "PARAM": "%FLEX_KEY_ARG_{}%",
          "PARAM_2":  "%FLEX_KEY_ARG2_{}%",
          "LABEL": "%FLEX_KEY_LABEL_{}%",
          "COMBINED": "%LINE_FUNCTION-{}%",
          "CALCULATED_1": "%PLK-{}%"
      },
      "CONSTRAINTS": {
          "MAX_LABEL": 99,
          "MAX_ARG": 99,
          "MAX_PHONE_NUMB": 99,
          "ALLOWED_LINE_ID": [1, 2, 3, 4, 5, 6]
      },
      "PHONE_NUMBER_REQUIRED": [
          "DIRECT_CALL",
          "BLF",
          "BLF_CP",
          "BLF_CALL",
          "BLF_CP_CALL"
      ],
      "LINE_ID_REQUIRED": ["LINE"],
      "LABEL_REQUIRED": ["DIRECT_CALL"],
      "PARAMETER_2_DEFAULT": {
          "DIRECT_CALL": "1"
      },
      "CALCULATED_1_MODE": "CISCO",
      "ACTIONS_NOT_FOR_FREE_KEYS": ["LINE"],
      "DIRECT_CALL_ACTION": "DIRECT_CALL",
      "APIO_ACTIONS_VALUES": {
          "CF_ACTIVATION_WITH_NUMBER": {"shortCode": "*72{}", "needNumber": True},
          "CF_DEACTIVATION": {"shortCode": "*73", "needNumber": False},
          "CALL_PICKUP": {"shortCode": "*98", "needNumber": False}
      },
      "BLF": {
          "MANAGE": True,
          "BUILD": False
      },
      "BLF_ACTIONS": [
          "BLF",
          "BLF_CP",
          "BLF_CALL",
          "BLF_CP_CALL"
      ],
      "LINE_ACTIONS": ["LINE"],
      "FORCED_KEYS": {"1": ["LINE", "1", ""]},
      "VENDOR_ACTIONS": {
          "DIRECT_CALL": "sd",
          "BLF": "blf",
          "BLF_CP": "blf+cp",
          "BLF_CALL": "blf+spd",
          "BLF_CP_CALL": "blf+cp+spd",
          "DND_TOGGLE":"dnd"
      },
      "COMBINED_RULES": {
          "DIRECT_CALL": "fnc=%FLEX_KEY_ACT_{}%;ext=%FLEX_KEY_ARG_{}%@$PROXY;nme=%FLEX_KEY_LABEL_{}%",
          "BLF": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
          "BLF_CP": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
          "BLF_CALL": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
          "BLF_CP_CALL": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
          "DND_TOGGLE": ["fnc=%FLEX_KEY_ACT_{}%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%"]
      }
  }

}
Request JSON Object:

Example response:

HTTP/1.1 200 OK
Content-Type: "application/json"

{
   "technical_name": "Yealink-T40G",
   "display_name": "Yealink-T40G",
   "vendor": {
      "phoneVendor" : "Yealink",
      "phoneVendorModel": "edge 40",
      "targetUrl" : "http://myhome.it",
      "useRedirect" : false,
   },
   "capabilities": {
      "phoneDefinition": {
         "needMac": 2,
         "needLogin": 0,
         "needHost": 0,
         "needPort": 0,
         "needSerialNumber": 1,
         "isDECT": false
      },
      "phoneProperties": {
         "brandName": "Yealink",
         "imageUrl": "http://www.foourl.be/img.jpg",
         "mainDevice": true,
         "extraDevice": true,
     }
   }
}
Response JSON Object:
Status Codes:
  • 200 OK – no error.

  • 400 Bad Request – format of the JSON input data not valid or phone type already exists.

Modify an existing phone type

PUT /api/v1/configs_mngt/phone_types/(string: phone_type)/

Modifies an existing phone type.

Authorization Right: System Admin.

Example request:

PUT /api/v1/configs_mngt/phone_types/Yealink-T40G/ HTTP/1.1
Host: example.com
Content-Type: "application/json"

{
   "display_name": "Yealink-T40G",
   "vendor": {
      "phoneVendor" : "Snom",
   },
   "capabilities": {
      "phoneDefinition": {
         "needMac": 2,
         "needLogin": 0,
      },
      "phoneProperties": {
         "imageUrl": "http://www.foourl.be/img.jpg",
     },
   },
    "addData": {
      "hiddenParam": {
          "enabled": false,
          "type": "String",
          "hidden": true
      },
      "TAGS": {
          "hiddenParam": "%HIDDEN_PARAM%"
      }
    },
   "phoneButtons": {
      "MANAGED_KEYS": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
      "ACTIONS": [
          "DIRECT_CALL",
          "BLF",
          "BLF_CP",
          "BLF_CALL",
          "BLF_CP_CALL",
          "DND_TOGGLE",
          "LINE",
          "CF_ACTIVATION_WITH_NUMBER",
          "CF_DEACTIVATION",
          "CALL_PICKUP"
      ],
      "TAGS": {
          "ACTION": "%FLEX_KEY_ACT_{}%",
          "PARAM": "%FLEX_KEY_ARG_{}%",
          "PARAM_2":  "%FLEX_KEY_ARG2_{}%",
          "LABEL": "%FLEX_KEY_LABEL_{}%",
          "COMBINED": "%LINE_FUNCTION-{}%",
          "CALCULATED_1": "%PLK-{}%"
      },
      "CONSTRAINTS": {
          "MAX_LABEL": 99,
          "MAX_ARG": 99,
          "MAX_PHONE_NUMB": 99,
          "ALLOWED_LINE_ID": [1, 2, 3, 4, 5, 6]
      },
      "PHONE_NUMBER_REQUIRED": [
          "DIRECT_CALL",
          "BLF",
          "BLF_CP",
          "BLF_CALL",
          "BLF_CP_CALL"
      ],
      "LINE_ID_REQUIRED": ["LINE"],
      "LABEL_REQUIRED": ["DIRECT_CALL"],
      "PARAMETER_2_DEFAULT": {
          "DIRECT_CALL": "1"
      },
      "CALCULATED_1_MODE": "CISCO",
      "ACTIONS_NOT_FOR_FREE_KEYS": ["LINE"],
      "DIRECT_CALL_ACTION": "DIRECT_CALL",
      "APIO_ACTIONS_VALUES": {
          "CF_ACTIVATION_WITH_NUMBER": {"shortCode": "*72{}", "needNumber": True},
          "CF_DEACTIVATION": {"shortCode": "*73", "needNumber": False},
          "CALL_PICKUP": {"shortCode": "*98", "needNumber": False}
      },
      "BLF": {
          "MANAGE": True,
          "BUILD": False
      },
      "BLF_ACTIONS": [
          "BLF",
          "BLF_CP",
          "BLF_CALL",
          "BLF_CP_CALL"
      ],
      "LINE_ACTIONS": ["LINE"],
      "FORCED_KEYS": {"1": ["LINE", "1", ""]},
      "VENDOR_ACTIONS": {
          "DIRECT_CALL": "sd",
          "BLF": "blf",
          "BLF_CP": "blf+cp",
          "BLF_CALL": "blf+spd",
          "BLF_CP_CALL": "blf+cp+spd",
          "DND_TOGGLE":"dnd"
      },
      "COMBINED_RULES": {
          "DIRECT_CALL": "fnc=%FLEX_KEY_ACT_{}%;ext=%FLEX_KEY_ARG_{}%@$PROXY;nme=%FLEX_KEY_LABEL_{}%",
          "BLF": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
          "BLF_CP": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
          "BLF_CALL": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
          "BLF_CP_CALL": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
          "DND_TOGGLE": ["fnc=%FLEX_KEY_ACT_{}%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%"]
      }
   }
}
Request JSON Object:
  • displayName (string) – It’s a friendly name of the phone to be displayed.

  • vendor (object) – vendor detail of the phone type. See Phone Type - Phone Vendor.

  • capabilities (object) – Definition and Properties of the phone type. See Phone Type: Phone Definition and See Phone Type: Properties.

  • addData – Additional data in JSON format. If the element “addData” is present it will full replace the existing values. No partial update. See Phone Type Extra Capabilities Concept. Set it to null (None) to remove the key entry.

  • phoneButtons – Phone Buttons data in JSON format. See Phone Type Phone Buttons. If the element “phoneButtons” is present it will full replace the existing values. No partial update.

Example response:

HTTP/1.1 200 OK
Content-Type: "application/json"

{
   "technical_name": "Yealink-T40G",
   "display_name": "Yealink-T40G",
   "vendor": {
      "phoneVendor" : "Yealink",
      "phoneVendorModel": "edge 40",
      "targetUrl" : "http://myhome.it",
      "useRedirect" : false,
      "deviceActivationCode": ""
   },
   "capabilities": {
      "phoneDefinition": {
         "needMac": 2,
         "needLogin": 0,
         "needHost": 0,
         "needPort": 0,
         "needSerialNumber": 1,
         "isDECT": false
      },
      "phoneProperties": {
         "brandName": "Yealink",
         "imageUrl": "http://www.foourl.be/img.jpg",
         "mainDevice": true,
         "extraDevice": true
     }
   },
  "addData": {
      "hiddenParam": {
          "enabled": false,
          "type": "String",
          "hidden": true
      },
      "TAGS": {
          "hiddenParam": "%HIDDEN_PARAM%"
      }
     }
}
Response JSON Object:
Status Codes:

Delete a phone type

DELETE /api/v1/configs_mngt/phone_types/(string: phone_type)/

Delete an existing phone type.

Authorization Right: System Admin.

Example request:

DELETE /api/v1/configs_mngt/phone_types/Yealink-T40G/ HTTP/1.1
Host: example.com

Example response:

HTTP/1.1 200 OK
Content-Type: "application/json"

{}
Status Codes:

Phone Type - Phone Vendor

The information configurable here are more detailed than in Phone Type Vendor (Limited info) as it contains also the configuration information for the internal logic of the APIO.

Name

Type

Method

Description

GET

POST

PUT

phoneVendor

String / Null

A

O

O

Vendor of the phone type. Possible values: “Yealink, “Panasonic”, “Snom”, “Polycom”, “Grandstream” Set it to null (None) to remove the key entry.

phoneVendorModel

String

A

O

O

Model name of the phone type. Set it to “” (empty string) to remove the key entry.

targetUrl

String

A

O

O

DMS url or logical name representing it. Set it to “” (empty string) to remove the key entry.

useRedirect

Boolean

A

O

O

Insert also the Mac Address in the Redirect Server (legacy)

deviceActivationCode

String

A

O

O

Device Activation Code for this model (at Phone Vendor Server side) Set it to “” (empty string) to remove the key entry.

Phone Type Extra Capabilities Concept

The APIO allows to define extra capabilities for a phone type that are managed in a generic way, meaning that there is no specific logic associated to it in APIO logic just a translation logic.

This allow to extend the capabilities of a specific phone type based on what it supports and what the operator would like to expose. This cna be configured for individual phones or for all the phones of a certain type in one specific Group.

In the AS it will be saved as Custom Tags and of course the phone type template configuration file must use these tags otherwise they will have no effect.

Some tags are standard from the phone vendor or from the AS, but most are proposals of Netaxis and are therefore not available by default in the template file of the phone in the AS..

The definition is split into 2 main parts:

  • the description of the field: name, type, level and some extra parameters

  • the mapping of a field to a Custom Tags

The key of the entry in the json dict data will be the name of the attributes.

The value ill be an object as defined below.

Name

Type

Method

Description

POST

GET

PUT

enabled

Boolean

A

A

O

If the property is enabled or not.

type

String

A

A

O

The type of the property. Possible values “Boolean”, “String”, “Integer”, “Password”. If “Password” an empty string will be returned if the Tag is present.

default

Boolean

O

O

O

It’s the default value of that property. During creation if the property is not provided in the data and the enabled flag is True, than the default value is used. It is only relevant for Boolean fields at Device level .

hidden

Boolean

O

A

O

This property should not be displayed. Default is False

level

String

A

A

O

The level(s) where the attribute is exposed. “Device”, “Group”, “All”. It allows knowing if the attribute is for one level only or for all levels.

Then there is a key with a fixed name “TAGS” that contains the mapping between the name of an attribute (the key) and the corresponding Custom Tag name (the value).

Phone Type Phone Buttons

The APIO allows to configure some of the buttoons of the phones. These buttons are very often called Line Keys.

In order to achieve this a quite complex configuration is needed in the AS but the goal of the APIO is to hide this complex configuration by exposing an interface as unified as possible and indication on the properties of the phone.

The Phone Buttons configuration will then be composed of several sub-parts:

  • Definition of the number of keys

  • Definition of the allowed actions

  • Definition of the constraints for the action s (must have a label, must have a parameter, ….)

  • Definition of the Custom Tags to be used

  • Definition of the values to be used for these Custom Tags

It must be noted that each phone vendor will have a slightly different configuration due to their specificities. The example of configuration that will be used in this chapter is a melting-pot of several configurations. Do not try to use it as such for any real phone.

The Phone Buttons configuration will be used to generate the fastkeys element of the classical Phone Types APIs (see Phone Types).

The complete configuration

Here is the full configuration of the phone buttons:

{
    "MANAGED_KEYS": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
    "ACTIONS": [
        "DIRECT_CALL",
        "BLF",
        "BLF_CP",
        "BLF_CALL",
        "BLF_CP_CALL",
        "DND_TOGGLE",
        "LINE",
        "CF_ACTIVATION_WITH_NUMBER",
        "CF_DEACTIVATION",
        "CALL_PICKUP"
    ],
    "TAGS": {
        "ACTION": "%FLEX_KEY_ACT_{}%",
        "PARAM": "%FLEX_KEY_ARG_{}%",
        "PARAM_2":  "%FLEX_KEY_ARG2_{}%",
        "LABEL": "%FLEX_KEY_LABEL_{}%",
        "COMBINED": "%LINE_FUNCTION-{}%",
        "CALCULATED_1": "%PLK-{}%"
    },
    "CONSTRAINTS": {
        "MAX_LABEL": 99,
        "MAX_ARG": 99,
        "MAX_PHONE_NUMB": 99,
        "ALLOWED_LINE_ID": [1, 2, 3, 4, 5, 6]
    },
    "PHONE_NUMBER_REQUIRED": [
        "DIRECT_CALL",
        "BLF",
        "BLF_CP",
        "BLF_CALL",
        "BLF_CP_CALL"
    ],
    "LINE_ID_REQUIRED": ["LINE"],
    "LABEL_REQUIRED": ["DIRECT_CALL"],
    "PARAMETER_2_DEFAULT": {
            "DIRECT_CALL": "1"
    },
    "CALCULATED_1_MODE": "CISCO",
    "ACTIONS_NOT_FOR_FREE_KEYS": ["LINE"],
    "DIRECT_CALL_ACTION": "DIRECT_CALL",
    "APIO_ACTIONS_VALUES": {
        "CF_ACTIVATION_WITH_NUMBER": {"shortCode": "*72{}", "needNumber": true},
        "CF_DEACTIVATION": {"shortCode": "*73", "needNumber": false},
        "CALL_PICKUP": {"shortCode": "*98", "needNumber": false}
    },
    "BLF": {
        "MANAGE": true,
        "BUILD": false
    },
    "BLF_ACTIONS": [
        "BLF",
        "BLF_CP",
        "BLF_CALL",
        "BLF_CP_CALL"
    ],
    "LINE_ACTIONS": ["LINE"],
    "FORCED_KEYS": {"1": ["LINE", "1", ""]},
    "VENDOR_ACTIONS": {
        "DIRECT_CALL": "sd",
        "BLF": "blf",
        "BLF_CP": "blf+cp",
        "BLF_CALL": "blf+spd",
        "BLF_CP_CALL": "blf+cp+spd",
        "DND_TOGGLE":"dnd"
    },
    "COMBINED_RULES": {
        "DIRECT_CALL": "fnc=%FLEX_KEY_ACT_{}%;ext=%FLEX_KEY_ARG_{}%@$PROXY;nme=%FLEX_KEY_LABEL_{}%",
        "BLF": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
        "BLF_CP": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
        "BLF_CALL": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
        "BLF_CP_CALL": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
        "DND_TOGGLE": ["fnc=%FLEX_KEY_ACT_{}%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%"]
    }
}

The ACTIONS and the MANAGED_KEYS

The MANAGED_KEYS is a list of the ids of the keys that are managed. It can be integers or strings.

This element is mandatory.

Example of a phone type with 10 keys:

"MANAGED_KEYS": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],

The ACTIONS defines the names of the possible actions that can be assigned to a key at APIO level. It means in the APIs used to configure the keys of a phone and in the other configuration element of this chapter.

This element is mandatory.

Example:

"ACTIONS": [
    "DIRECT_CALL",
    "BLF",
    "BLF_CP",
    "BLF_CALL",
    "BLF_CP_CALL",
    "DND_TOGGLE",
    "LINE"
],

It must be noted that very often for all the phone models of a same vendor almost the complete configuration could remain the same except these 2 elements.

The TAGS

This element is mandatory.

The TAGS is the definition of the mapping between an input parameter and a Custom Tag:

"TAGS": {
    "ACTION": "%FLEX_KEY_ACT_{}%",
    "PARAM": "%FLEX_KEY_ARG_{}%",
    "PARAM_2":  "%FLEX_KEY_ARG2_{}%",
    "LABEL": "%FLEX_KEY_LABEL_{}%",
    "COMBINED": "%LINE_FUNCTION-{}%",
    "CALCULATED_1": "%PLK-{}%"
}

The name of keys are hardcoded in the code so they are not free. The values are free with one constraint: they must contain ‘{}’. This element will be replaced by the id of the key. For example %FLEX_KEY_ACT_1%, %FLEX_KEY_ACT_2%, %FLEX_KEY_ACT_3%.

Their explanation:

  • ACTION is the action to run when the corresponding button is pressed. It is the only parameter that is always mandatory.

  • LABEL is a human-readable label that describes the action on the phone

  • PARAM and PARAM_2 are optional parameters that has to be passed to some actions to run it. For example a phone number, an extension, a line id.

  • COMBINED has been introduced in 1.9.1 to support Cisco phones where the template file does not require separate parameters but one big parameter that is the combination of several inputs.

  • CALCULATED_1 has been introduced in 1.9.1 to support Cisco phones where an additional parameter had to be set when aline ley is configured and could be not linked to input values.

The different constraints that will apply at API level

There are different fields expressing constraints on the behaviour and signature of the APIs to manage the Phone Buttons. They grouped here.

The CONSTRAINTS are related to the size of the input fields:

"CONSTRAINTS": {
    "MAX_LABEL": 99,
    "MAX_ARG": 99,
    "MAX_PHONE_NUMB": 99
}

They mean:

  • MAX_LABEL: Maximum length for the label input field

  • MAX_PHONE_NUMB: Maximum length for the parameter input field when it is a phone number

  • MAX_ARG: Maximum length for the parameter input field when it is something else than a phone number

The PHONE_NUMBER_REQUIRED is defining constraints on the presence of a parameter when a specific Action is selected:

"PHONE_NUMBER_REQUIRED": [
    "DIRECT_CALL",
    "BLF",
    "BLF_CP",
    "BLF_CALL",
    "BLF_CP_CALL"
]

It is the list of Actions that will require that a phone number, or an extension, is provided for the parameter input field.

The LINE_ID_REQUIRED is defining constraints on the presence of a parameter when a specific Action is selected:

"LINE_ID_REQUIRED": [
    "LINE"
],

It is the list of Actions that will require that a line id is provided for the parameter input field.

The LABEL_REQUIRED is defining constraints on the presence of a parameter when a specific Action is selected:

"LABEL_REQUIRED": [
    "DIRECT_CALL"
],

It is the list of Actions that will require that a value is provided for the lable input field.

The FORCED_KEYS is defining that some keys will have some values automatically set at device creation by APIO an dcan not be changed afterwards:

"FORCED_KEYS": {
    "1": ["LINE", "1", ""]
},

The ACTIONS_NOT_FOR_FREE_KEYS is defining that these specific actions can not be used on normal keys but will be used only for the fixed keys

"ACTIONS_NOT_FOR_FREE_KEYS": [
    "LINE"
],

The parameters that control the logic

The parameters that are described here will not be directly reflected in the API signature but control the APIO logic itself.

The PARAMETER_2_DEFAULT allow to specific a value that will be set by default for the PARAM_2 if none is defined:

"PARAMETER_2_DEFAULT": {
    "DIRECT_CALL": "1"
},

The CALCULATED_1_MODE defines the logic that will be launched to build the CALCULATED_1 tag. Today (1.9.1) there is only one possible value “CISCO” that must be set when defining a Cisco phone and it has to be omitted in all the other cases:

"CALCULATED_1_MODE": "CISCO",

The LINE_ACTIONS defines which actions are of type LINE configuration. Today (1.9.1) it is only used in the case of Cisco but moire usage will be added later:

"LINE_ACTIONS": ["LINE"],

The BLF and BLF_ACTION are defining what Actions are linked to Busy Lamp Field keys.

The BLF sections defines the global behaviour:

"BLF": {
    "MANAGE": true,
    "BUILD": false
},

The MANAGE flag is used to enable/disable the management of BLF_ACTIONS. Only if it is true the BUILD flag is considered and it is used to specify if the BLF service should be activated or not. More precisely:

  • If MANAGE is false the APIO will do nothing specific, it will configure the keys as requested and that’s all.

  • If MANAGE is true the APIO will at least generate the BLF List URI and update the service with that info. In addition to this:

    • If it gets in input a list in the field “BlfList” it will push that list on the BLF Service as the list of monitored users.

    • Otherwise if BUILD is true for each key configured with a BLF action (the action defined in “BLF_ACTIONS”) the APIO will check if the phone number/extension provided is the one of a user and it will add this user to the monitored list.

    • Otherwise it is ignored. In that case the list of monitored users is fully replaced by the new built list.

The BLF_ACTION defines which actions are of type BLF:

"BLF_ACTIONS": [
    "BLF",
    "BLF_CP",
    "BLF_CALL",
    "BLF_CP_CALL",
    "BLF_LIST"
],

In APIO we took the following conventions for their name:

  • BLF_LIST means that you want to allocate any BLF item to that key. It is the phone who will decide which one and it can vary over the time.

  • BLF means you want to allocate a specific BLF item to that key. You need then to provide the extension or the phone number of the user to be monitored.

  • These bales can be extended if the phone type supports also aditional optional features on a BLF list such as direct call or call pickup.

The VENDOR_ACTIONS (mandatory element) defines the mapping between the APIO name for an Action and the vale that must be set in the phone configuration file in order that it understands it:

"VENDOR_ACTIONS": {
    "DIRECT_CALL": "sd",
    "BLF": "blf",
    "BLF_CP": "blf+cp",
    "BLF_CALL": "blf+spd",
    "BLF_CP_CALL": "blf+cp+spd",
    "DND_TOGGLE":"dnd"
},

The COMBINED_RULES defines the rule to create the value of the COMBINED tag based on the other tags:

"COMBINED_RULES": {
    "DIRECT_CALL": "fnc=%FLEX_KEY_ACT_{}%;ext=%FLEX_KEY_ARG_{}%@$PROXY;nme=%FLEX_KEY_LABEL_{}%",
    "BLF": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
    "BLF_CP": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
    "BLF_CALL": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
    "BLF_CP_CALL": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
    "DND_TOGGLE": ["fnc=%FLEX_KEY_ACT_{}%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%"]
}

It has been introduced in 1.9.1 to support Cisco phone.

The value can be a string if these is only one format, or an array of 2 strings if there are two formats depending if there is a lable or not. The first one is with label and the second without label:

"COMBINED_RULES": {
    "DIRECT_CALL": "fnc=%FLEX_KEY_ACT_{}%;ext=%FLEX_KEY_ARG_{}%@$PROXY;nme=%FLEX_KEY_LABEL_{}%",
    "BLF": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
    "BLF_CP": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
    "BLF_CALL": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
    "BLF_CP_CALL": ["fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%;sub=%BLF_URI%;usr=%BLF_USER%"],
    "DND_TOGGLE": ["fnc=%FLEX_KEY_ACT_{}%;nme=%FLEX_KEY_LABEL_{}%", "fnc=%FLEX_KEY_ACT_{}%"]
}

The APIO_ACTIONS_VALUES is a specific feature to enhance, if supported, the native list of Action of a phone type:

"APIO_ACTIONS_VALUES": {
    "CF_ACTIVATION_WITH_NUMBER": {"shortCode": "*72{}", "needNumber": true},
    "CF_DEACTIVATION": {"shortCode": "*73", "needNumber": false},
    "DND_ACTIVATION": {"shortCode": "*78", "needNumber": false},
    "DND_DEACTIVATION": {"shortCode": "*79", "needNumber": false},
    "CALLPICKUP": {"shortCode": "*98", "needNumber": false}
},

It is based on the following concept: it is usually possible to activate or deactivate a feature calling a Feature Access Code / Short Code.

In that case, the phone will initiate a call with the FAC as destination to launch this activation deactivation.

Each imme will contain the indication of the code to be used and if it require a phone number as parameter in that case the ‘{}’ will be replaced by the phone number by the APIO.

It is very important to note that the current version of the APIO requires to have the FAC value explicitly defined here. It means that this sub-feature can not be used if the customers (Group Admin or Tenant Admin) are allowed to modify their FAC values for their Group/Tenant. And if such customization is done and the feature is no more working this will not be considered as a bug.

And the DIRECT_CALL_ACTION indicate what native Action has to be used for this:

"DIRECT_CALL_ACTION": "DIRECT_CALL",