Re: How to use IPbxAdminApi with MonitorConfig.
Hi Andreas
I had to add following to appwebsocket session class and then it worked.
maybe it would be helpfull for other people if you update documentation.
class JsonApi* jsonAdminApi = dynamic_cast<class JsonApiContext*>(instance)->CreateJsonApi("PbxAdminApi", this, msg, base);
Regards
Iqbal
if (!strcmp(mt, "PbxInfo")) { if (!strcmp(app, "XXXX"))
{
const char* pbx = msg.get_string(base, "pbx");
const char* domain = msg.get_string(base, "domain");
PBXManager::get()->setPbx(domain, "localhost");
// start pbx admin session
instance->StartPbxSession(domain, pbx);
class JsonApi* jsonAdminApi = dynamic_cast<class JsonApiContext*>(instance)->CreateJsonApi("PbxAdminApi", this, msg, base);
if (jsonAdminApi)
{
jsonAdminApi->JsonApiStart();
}
instance->StartUpdate(domain, pbx);
class JsonApi* jsonApi = dynamic_cast<class JsonApiContext*>(instance)->CreateJsonApi("PbxTableUsers", this, msg, base);
if (jsonApi)
{
jsonApi->JsonApiStart();
}
}
}