5.6.3 api phone config

The  /api/phone/config function is used for monitoring and checking the SIP account settings.

The  GET method can be used for downloading and the  PUT method for uploading the configuration in this function.

The function is part of the  Phone/Call service and, if authentication is required, the user has to be assigned the  Phone/Calls ā€“ Monitoring privilege for the GET method and  Phone/Calls ā€“ Management for the  PUT method


GET Method

Request parameters:

Parameter

Description

account

Optional parameter defining the SIP account identifier (1 or 2). If the parameter is not included, the function returns the states of all the SIP accounts.

The response is in the  application/json format for the  GET  method and provides a list of the device SIP accounts (accounts) including their current states. In case the account is specified using the account parameter, the response only provides information on the given account.

Caution

  • For security reasons, the device does not return the password if the  GET  method is used.


Example:

GET /api/phone/config
{
    "success": true,
    "result": {
        "accounts": [
            {
                "account": 1,
                "enabled": false,
                "displayName": "",
                "sipNumber": "",
                "domain": "",
                "domainPort": "",
                "authId": "",
                "proxyAddress": "",
                "proxyPort": "",
                "registrationEnabled": false,
                "registrarAddress": "",
                "registrarPort": "",
                "answerMode": "1"
            },
            {
                "account": 2,
                "enabled": false,
                "displayName": "",
                "sipNumber": "",
                "domain": "",
                "domainPort": "",
                "authId": "",
                "proxyAddress": "",
                "proxyPort": "",
                "registrationEnabled": false,
                "registrarAddress": "",
                "registrarPort": "",
                "answerMode": "1"
            }
        ]
   }
}

PUT Method

Request parameters:

Parameter

Description

blob-json

Mandatory parameter containing the SIP account configurations (in the JSON format).

The blob-json parameter is mandatory for the PUT method and can include all the accounts parameters from the file obtained using the GET method. In addition to the mandatory account parameter, one more parameter must be included at least. The other parameters are optional. It is possible to specify the password parameter  and enter the password in the open form for each account in the JSON file uploaded. This parameter is not part of the response to the GET method for security reasons. The response is in the application/json format. Should an error occur during verification, the whole process fails and none of the parameters will be used.


Example:

PUT /api/phone/config
{
    "success": true,
}

The database parameters correspond to the JSON file parameters as follows:

Database parameter

JSON parameter

Additional info

Phone.Sip

account

Numbering starts from 1, not from 0.

Phone.Sip.Enabled

enabled


Phone.Sip.User.DisplayName

displayName


Phone.Sip.User.Id

sipNumber


Phone.Sip.User.AuthId

authId

If the parameter is empty, the Phone.Sip.User.Id parameter is used instead.

Phone.Sip.User.PasswordString

password

In open form ā€“ can be uploaded into the device only using the PUT method, cannot be obtained using the GET method.

Phone.Sip.Client.Domain

domain


Phone.Sip.Client.Port

domainPort


Phone.Sip.Proxy.Address

proxyAddress


Phone.Sip.Proxy.Port

proxyPort


Phone.Sip.Registrar.Enabled

registrationEnabled


Phone.Sip.Registrar.Address

registrarAddress


Phone.Sip.Registrar.Port

registrarPort


Phone.Sip.Misc.AnswerMode

answerMode