The com.innovaphone.devices api enables apps to find and configure specific devices.
The client consumeApi function is used to access the Api:
var devicesApi = start.consumeApi("com.innovaphone.devices");
devicesApi.onmessage.attach(onmessage); // onmessage is called for responses from the API
Retrieves all gateways and IPVAs.
devicesApi.send({ mt: "GetGateways" });
string hwIds | A comma separated list of hardware IDs (e.g. "009033010101,009033010102") (optional). |
boolean justFxs | If true, just returns devices with FXS support (optional). |
The result message for the GetGateways request.
array gateways | An array of device objects. |
boolean last | If true, no more GetGatewaysResult messages are to be expected, otherwise more will follow with further devices. |
string error | An error string if an error happened (optional). |
number id | A unique ID for this device. |
string hwId | The hardware ID. |
string name | The name of the device, if configured. |
number domainId | The domain ID. |
string product | The product name, e.g. IP811. |
string version | The software and hardware version, e.g. 13r1 dvl [13.A110/13A146/200] |
string type | The hardware type (possible types are GW,VA,PHONE,DECT,APP_PLATFORM). |
boolean pbxActive | If true, the PBX is enabled on this device. |
boolean online | If true, this device is currently online. |
boolean hasLeaseLicenses | If true, this device has rental licenses. |
string uri | The URI under which this device is accessible during the current session. |
{
"mt":"GetGatewaysResult",
"last":true,
"gateways":[
{
"id":1,
"hwId":"0090334100be",
"name":"Kari2",
"domainId":2,
"product":"IP811",
"version":"13r1 dvl [13.A110/13A146/200]",
"type":"GW",
"pbxActive":true,
"online":true,
"uri":"http://172.16.14.38/devices/passthrough/0090334100be/fa0550ed-e360-41fb-9714-b212f10ef20c/"
}
]
}
Retrieves all App Platforms.
devicesApi.send({ mt: "GetAppPlatforms" });
string hwIds | A comma separated list of hardware IDs (e.g. "029033010101,029033010102") (optional). |
The result message for the GetAppPlatforms request.
array appPlatforms | An array of device objects. |
boolean last | If true, no more GetAppPlatformsResult messages are to be expected, otherwise more will follow with further devices. |
string error | An error string if an error happened (optional). |
Retrieves all phones.
devicesApi.send({ mt: "GetPhones" });
string hwIds | A comma separated list of hardware IDs (e.g. "029033010101,029033010102") (optional). |
The result message for the GetPhones request.
array phones | An array of device objects. |
boolean last | If true, no more GetPhonesResult messages are to be expected, otherwise more will follow with further devices. |
string error | An error string if an error happened (optional). |
Retrieves all phones.
devicesApi.send({ mt: "GetDects" });
string hwIds | A comma separated list of hardware IDs (e.g. "029033010101,029033010102") (optional). |
The result message for the GetDects request.
array dects | An array of device objects. |
boolean last | If true, no more GetDectsResult messages are to be expected, otherwise more will follow with further devices. |
string error | An error string if an error happened (optional). |
Retrieves a specific device.
devicesApi.send({ mt: "GetDevice", hwId: "009033010101" });
string hwId | A hardware ID. |
The result message for the GetDevice request.
object device | A device object. |
string error | An error string if an error happened (optional). |
Retrieves the provisioned phones of an FXS device.
devicesApi.send({ mt: "GetDevicePhones", hwId: "009033010101" });
string hwId | A hardware ID. |
The result message for the GetDevicePhones request.
array phones | An array of strings, while each string is a provisioned FXS interface. |
string error | An error string if an error happened (optional). |
Removes a provisioned FXS phone from a gateway.
devicesApi.send({ mt: "RemoveDevicePhone", hwId: "009033010101", id: "TEL1" });
string hwId | A hardware ID. |
string id | The id/name of the interface retrieved in the array of the GetDevicePhonesResult message. |
The result message for the RemoveDevicePhone request.
string error | An error string if an error happened (optional). |
Executes an HTTP GET request and returns the result.
devicesApi.send({ mt: "HttpGet", "uri": device.uri + "log.txt" });
string uri | The absolute URI starting with the uri retrieved inside the device object. |
The result message for the HttpGet request.