pbx_admin.h

IPbxAdminApi is an interface, which provides administrative access to the PBX. It uses the Websocket/Json interface "PbxAdmin". To be able to use this interface inside an App Service, a Websocket connection from the PBX has to exist. For this connection access to the "PbxAdminApi" has to be granted

File information

Filecommon/interface/pbx_admin.h

Classes IPbxAdminApi
UPbxMonitorAdminObject
UPbxMonitorConfig

Classes

IPbxAdminApi

class IPbxAdminApi : public UJsonApiContext {
public:
    static class IPbxAdminApi * Create(const char * domain, const char * pbx);
    virtual ~IPbxAdminApi() {};

    virtual void SetPbx(const char * domain, const char * pbx) = 0;
    virtual void MonitorAdminObject(class UPbxMonitorAdminObject * monitor) = 0;
    virtual void MonitorConfig(class UPbxMonitorConfig * monitor) = 0;
};

This is the interface class which provides the public functions for the features of the interface after initialization is done.

Public functions

Create

This functions needs to be called as part of the initialization to create the interface class.

Parameters
char * domainThe name of the domain, to be used for the Api
char * pbxThe name of the pbx, to be used for the Api
Return value
Returns the pointer to the IPbxAdmin class

For this to work, the AppInstance class needs to use JsonApiContext as base class.

class <Your App Name> : public AppInstance, ... , public JsonApiContext

After the Create function the interface has to be registered in the JsonApiContext

pbxAdminApi = IPbxAdminApi::Create(domain, pbx);
RegisterJsonApi(pbxAdminApi);
MonitorAdminObject

Starts monitoring of the PBX Admin object. The UPbxMonitorAdminObject virtual functions are called on changes

Parameters
class UPbxMonitorAdminObject * monitorThe virtual class for the callback functions

Use UPbxMonitorAdminObject as a base class of one of your classes and call this function to start monitoring. Example:

class <Your App Name> : public AppInstance, ... , public UPbxMonitorAdminObject {
    ...
    pbxAdminApi->MonitorAdminObject(this);
}
MonitorConfig

Starts monitoring of the PBX for some basic config changes

Parameters
class UPbxMonitorConfig * monitorThe virtual class for the callback functions

Use UPbxMonitorConfig as a base class of one of your classes and call this function to start monitoring. Example:

class <Your App Name> : public AppInstance, ... , public UPbxMonitorConfig {
    ...
    pbxAdminApi->MonitorConfig(this);
}

UPbxMonitorAdminObject

class UPbxMonitorAdminObject {
public:
    virtual void PbxAdminObjectUpdate(const char * pwd, const char * key) = 0;
};

Virtual base class to be used for the callback on Admin object changes

UPbxMonitorConfig

class UPbxMonitorConfig {
public:
    virtual void PbxConfigUpdate(const char * domain, const char * pbx, const char * dns) = 0;
};

Virtual base class to be used for the callback on PBX config changes