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.
{
"api": "PbxApi",
"mt": "AddAlienCall",
}
Adds a call to the PBX, which will result in a busy state of the user and also shows up as on the phone presence
{
"api": "PbxApi",
"mt": "AddAlienCallResult",
"id": unsigned
}
The id can be used to delete the call
{
"api": "PbxApi",
"mt": "DelAlienCall",
"id": unsigned
}
Deletes a call added with AddAlienCall. The id identifies the call to be deleted
{
"api": "PbxApi",
"mt": "DelAlienCallResult",
}
{
"api": "PbxApi",
"mt": "AddDiversion",
"sip": string,
"guid": string,
"ep-sip":string,
"ep-num":string,
"type":string,
}
Adds a diversion (cfb, cfu, cfnr) to the PBX but no admin diversion
{
"api": "PbxApi",
"mt": "AddDiversionResult",
"ok": boolean,
}
OK indicates that the diversion can be set.
{
"api": "PbxApi",
"mt": "DelDiversion",
"sip": string,
"guid": string,
"type":string,
}
Deletes a diversion (cfb, cfu, cfnr) of that type of the PBX but no admin diversion
{
"api": "PbxApi",
"mt": "DelDiversionResult",
"ok": boolean,
}
OK indicates that the diversion can be deleted.
{
"api": "PbxApi",
"mt": "GetDiversion",
"sip": string,
"guid": string,
"type":string,
}
Get a diversion of the types (cfb, cfu, cfnr) from the PBX but no admin diversion
{
"api": "PbxApi",
"mt": "GetDiversionResult",
"num": string,
"sip":string,
}
Number and/or SIP are delivered if a diversion of that type persists.
{
"api": "PbxApi",
"mt": "AppNotify",
"sip": string,
"link": string,
"title":string,
"text":string,
}
Sends an app notification to a specified user. The notification will be displayed by all myApps sessions of the user that have app notifications enabled.
someapp
, someapp?discussion=3&action=show
{
"api": "PbxApi",
"mt": "AppNotifyResult",
"error": string,
}
The response to the AppNotify message.
{
"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
}