The PbxMessages protocol is available on AppWebsocket connections to innovaphone PBX objects, if the object is enabled for the PbxMessages api. It allows an application to send requests to the Messages instance, which is configured at the object.
These requests are forwarded to the Messages instance using the AppWebsocket connection which is established by the Messages PBX object to the Messages instance.
Chat applications may use this Api to connect to messages and read stored chat messages
{
"api": "PbxMessages",
"src": string,
"mt": string,
}
Any message with a "mt" property not being "Session" is forwarded to Messages, if a session is already established with the "Session" message. When the message is forwarded the following operations are performed on the message
{
"api": "PbxMessages",
"mt": "Session",
"src": string,
"flags": string
}
This message initiates a session to the messages instance. A unique session_id is generated on the PBX. In addition to the normal operations on messages a property "dn" is added for the display name of the object using this api and the message is forwarded to Messages.
{
"api": "PbxMessages",
"mt": "SessionResult",
"src": string,
"session": ulong64
}
Returns the session id
{
"api": "PbxMessages",
"mt": "Error",
}
Indicates that an error happened and the session is not valid anymore. A new Session Message is needed to re-establish the session. A timeout before re-establishing the session is recommened, because Error may be sent as response to Session.