| 12345678910111213141516171819202122232425262728293031323334353637 |
- #pragma once
- #include <iostream>
- #include <string>
- #include <json/json.h>
- #include <fstream>
- #define CFGPATH "cfg.json"
- class CConfig
- {
- public:
- CConfig();
- ~CConfig();
- bool load();
- bool write();
- std::string fsAddr();
- short int fsPort();
- std::string fsPwd();
- uint16_t wsPort();
- std::string dbAddr();
- std::string dbUser();
- std::string dbPwd();
- std::string dbDatabase();
- int trunkCount(); // 中继数量
- std::string extContext();
- std::string meetingContext();
- std::string ttsPath(); //tts路径
- std::string recordPath(); // 录音路径
- std::string gateWayPrefix(); // 出局字冠
- std::string gateWayCaller(); // 网关号码/底号
- std::string gateWayAccount(); // 网关名字
- bool isAutoRecord(); // 是否自动录音
- static CConfig* GetInstance() { return &cfg; }
- private:
- static CConfig cfg;
- Json::Value root;
- };
|