linux版本中间件

Config.h 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include <iostream>
  3. #include <string>
  4. #include <json/json.h>
  5. #include <fstream>
  6. #define CFGPATH "cfg.json"
  7. class CConfig
  8. {
  9. public:
  10. CConfig();
  11. ~CConfig();
  12. bool load();
  13. bool write();
  14. std::string fsAddr();
  15. short int fsPort();
  16. std::string fsPwd();
  17. uint16_t wsPort();
  18. std::string dbAddr();
  19. std::string dbUser();
  20. std::string dbPwd();
  21. std::string dbDatabase();
  22. int trunkCount(); // 中继数量
  23. std::string extContext();
  24. std::string meetingContext();
  25. std::string ttsPath(); //tts路径
  26. std::string recordPath(); // 录音路径
  27. std::string gateWayPrefix(); // 出局字冠
  28. std::string gateWayCaller(); // 网关号码/底号
  29. std::string gateWayAccount(); // 网关名字
  30. bool isDynamicGw(); // 是否动态网关
  31. bool isAutoRecord(); // 是否自动录音
  32. int postProcessTime(); // 话后处理时长
  33. std::string aesKey(); // aes密码
  34. std::string aesMark(); // 标识
  35. bool isVideo(); // 是否是视频
  36. bool isWss(); // 是否开启wss
  37. std::string sslCert(); // ssl证书
  38. std::string sslKey(); // ssl私钥
  39. static CConfig* GetInstance() { return &cfg; }
  40. private:
  41. static CConfig cfg;
  42. Json::Value root;
  43. };