The PbxApi protocol is available on AppWebsocket connections to innovaphone PBX objects, if the object is enabled for the PbxApi. It allows access to the presence, favourties and node information.
{
"api": "PbxApi",
"src": string,
"mt": string,
}
In general operatios are performed by sending a message with a message type <name> to the PBX. The result is retured with a message with message type <name>Result. Some operations turn on monitoring and cause additional update messages sent by the PBX.
Operations{
"api": "PbxApi",
"mt": "SubscribePresence",
"sip": string,
"num": string
}
Start monitoring of the presence of the object defined by sip
or num
.
{
"api": "PbxApi",
"mt": "SubscribePresenceResult"
}
Message sent back to confirm start of the monitoring
{
"api": "PbxApi",
"mt": "PresenceState"
"up": boolean
"sip": string,
"num": string,
"dn": string,
"email": string
}
Message sent back whenever the state of the presence monitoring has changed. It also includes the full endpoint info that was retrieved with the subscription.
{
"api": "PbxApi",
"mt": "PresenceUpdate",
"presence": [presence]
}
Sent after the presence monitor is up and whenever the presence of the monitored user changes afterwards. The presence array
{
"api": "PbxApi",
"mt": "UnsubscribePresence",
"sip": string,
"num": string
}
Stop monitoring of the presence of the object defined by sip
or num
.
{
"api": "PbxApi",
"mt": "UnsubscribePresenceResult"
}
Message sent back to confirm that the monitoring has been stopped.
{
"api": "PbxApi",
"mt": "SetPresence",
"sip": string,
"guid": string,
"contact": string,
"activity": string,
"note": string
}
Sets the presence for a given contact of a user, defined by the SIP URI or GUID.
{
"api": "PbxApi",
"mt": "SetPresenceResult",
"error": unsigned,
"errorText": string
}
Message sent back to confirm that setting the presence has been completed or failed.
{
"api": "PbxApi",
"mt": "SubscribeProfile"
}
Starts monitoring the first profile of the user that established the AppWebsocket connection.
{
"api": "PbxApi",
"mt": "SubscribeProfileResult",
"profile": profile
}
Confirmation that the monitor has been set up. Also this message contains the initial value of the first profile.
{
"api": "PbxApi",
"mt": "ProfileContactAdded",
"profile": {
"id": unsigned,
"contact": contact
}
}
This message is sent when a new favourite has been added to the first profile.
{
"api": "PbxApi",
"mt": "ProfileContactDeleted",
"profile": {
"id": unsigned,
"contact": {
"id": unsigned
}
}
}
This message is sent when a favourite has been deleted from the first profile.
{
"api": "PbxApi",
"mt": "UnsubscribeProfile"
}
Stops monitoring the users profile.
{
"api": "PbxApi",
"mt": "UnsubscribeProfileResult"
}
Confirmation that the monitor has been deleted.
{
"api": "PbxApi",
"mt": "AddProfile",
"name": string,
}
Adds a new profile with a given name.
{
"api": "PbxApi",
"mt": "DelProfile",
"id": unsigned,
}
Deletes a profile with a given id.
{
"api": "PbxApi",
"mt": "UpdateProfile",
"id": unsigned,
"name": string,
}
Changes the name of a profile identified by id.
{
"api": "PbxApi",
"mt": "AddProfileContact",
"id": unsigned,
"name": string,
"contact": {
"dn": string,
"sip": string,
"num": string
}
}
Adds a new favourite to the given profile. If the profile does not exist, it is created.
{
"api": "PbxApi",
"mt": "DelProfileContact",
"id": unsigned,
"contact": {
"id": unsigned
}
}
Deletes a favourite from the given profile.
{
"api": "PbxApi",
"mt": "UpdateProfileContact",
"id": unsigned,
"contact": contact
}
Updates an existing favourite.
{
"api": "PbxApi",
"mt": "GetNodeInfo"
}
Requests information about the node of the user that is authenticated on the underlying AppWebsocket connection.
{
"api": "PbxApi",
"mt": "GetNodeInfoResult",
"name": string,
"prefix_intl": string,
"prefix_ntl": string,
"prefix_subs": string,
"country_code": string
}
Contains information about the node of the user that is authenticated on the underlying AppWebsocket connection.
{
"contact": string,
"status": string,
"activity": string,
"note": string
}
{
"id": integer,
"name": string,
"contacts": [contact]
}
{
"id": integer,
"name": string,
"num": string,
"dsp": string,
"presence": boolean,
"dialog": boolean,
"ext": string
}