utilities.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * CallingAPI.h
  3. * 对讲UI所有接口通过这个文件对接底层
  4. * Created on: 2021年12月10日
  5. * Author: Admin
  6. */
  7. #ifndef JNI_CALL_CALLINGAPI_H_
  8. #define JNI_CALL_CALLINGAPI_H_
  9. #include <system/Thread.h>
  10. #include "voip/telephone.h"
  11. #include "sip_config.h"
  12. #include "utils/Log.h"
  13. #include "storage/StoragePreferences.h"
  14. #include "base/prefs.hpp"
  15. #define SETTINGS_SCREENSAVER_BRIGHTNESS "screensaver_brightness"
  16. #define SETTINGS_ADDRESS "address"
  17. #define SETTINGS_VOLUME_SIZE "volume_size"
  18. voip::Telephone* GetTelephone();
  19. void ReleaseTelephone();
  20. //自动测试
  21. class AutoDialTest : public Thread {
  22. virtual bool threadLoop() {
  23. sleep(3000);
  24. std::string domain = StoragePreferences::getString(SIP_REG_DOMAIN,
  25. SIP_REG_DOMAIN_DEFAULT);
  26. std::string door_number = StoragePreferences::getString(SIP_REG_DOOR_ACCOUNT,
  27. SIP_REG_DOOR_ACCOUNT_DEFAULT);
  28. std::string door_uri = URI(door_number, domain);
  29. if (base::startswith(door_number, "192.168")) {
  30. door_uri = std::string("sip:") + door_number;
  31. }
  32. voip::CallSetting setting;
  33. setting.enable_video = true;
  34. LOGD("make call %s, video %d", door_uri.c_str(), setting.enable_video);
  35. GetTelephone()->MakeCall(door_uri, setting);
  36. sleep(8000);
  37. GetTelephone()->Hangup();
  38. return true;
  39. }
  40. };
  41. std::string GetVersion();
  42. int GetVersionNo();
  43. std::string GetDeviceUid();
  44. void HeadSetting(voip::CallSetting& setting);
  45. //bool GetLocalAddress(j::house_setting* profile);
  46. //void SetLocalAddress(const j::house_setting& profile);
  47. #endif /* JNI_CALL_CALLINGAPI_H_ */